diff options
| author | Giovane <giovaneliberato@gmail.com> | 2015-10-26 17:01:18 -0200 | 
|---|---|---|
| committer | Giovane <giovaneliberato@gmail.com> | 2015-10-26 17:01:39 -0200 | 
| commit | 2981e337140f67c1d555741fa5f9f663c651f26f (patch) | |
| tree | 2f5e9f240177721eba4e39e4efb8d6df9d67ac0c /web-ui/test/spec | |
| parent | 800f211937e4e09a02779c20c6c79ce6edd833f1 (diff) | |
Add incomplete email domain verification on compose box.
Diffstat (limited to 'web-ui/test/spec')
| -rw-r--r-- | web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js | 19 | 
1 files changed, 18 insertions, 1 deletions
| diff --git a/web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js b/web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js index 29194ee8..c0b3d22f 100644 --- a/web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js +++ b/web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js @@ -34,7 +34,7 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () {          expect(addressEnteredEvent).not.toHaveBeenTriggeredOnAndWith(this, { name: 'to', address: '' });        }); -      it('wont add address if shift key is pressed together: ' + keycode[1], function () { +      it('won`t add address if shift key is pressed together: ' + keycode[1], function () {          var addressEnteredEvent = spyOnEvent(this.$node, Pixelated.events.ui.recipients.entered);          var enterAddressKeyPressEvent = $.Event('keydown', { which: keycode[0], shiftKey: true }); @@ -186,5 +186,22 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () {        expect(addressEnteredEvent.calls[0].data).toEqual({name: 'to', address: 'email@example.com'});      }); +    it('displays it as an invalid address token when domain isn`t complete', function() { +      this.$node.val('email@example'); +      this.$node.trigger(blurEvent); + +      expect(blurEvent.preventDefault).toHaveBeenCalled(); +      expect(invalidAddressEnteredEvent.calls[0].data).toEqual({name: 'to', address: 'email@example'}); +    }); + +    it('displays it as an invalid address token when cannonical email domain isn`t complete', function() { +      this.$node.val('Invalid <email@example>'); +      this.$node.trigger(blurEvent); + +      expect(blurEvent.preventDefault).toHaveBeenCalled(); +      expect(invalidAddressEnteredEvent.calls[0].data).toEqual({name: 'to', address: 'Invalid <email@example>'}); +    }); + +    });  }); | 
