diff options
author | Giovane <giovaneliberato@gmail.com> | 2015-11-23 15:47:07 -0200 |
---|---|---|
committer | Giovane <giovaneliberato@gmail.com> | 2015-11-23 15:47:40 -0200 |
commit | ac4425ce923143d7d9d50ffed720211858b9834f (patch) | |
tree | e4518ee3241594c94dfdbedae6b809b39175770d /web-ui/test/spec | |
parent | 8349915f538e670cd86b7327e31fd6bd87500db2 (diff) |
Fix tokenization when email has dash on domain #513
Diffstat (limited to 'web-ui/test/spec')
-rw-r--r-- | web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js | 18 |
1 files changed, 16 insertions, 2 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 6fdf9711..829bf890 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 @@ -144,7 +144,7 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () { }); }); - describe('when entering an invalid address', function() { + describe('validate email format', function() { var invalidAddressEnteredEvent, addressEnteredEvent, blurEvent; beforeEach(function () { @@ -187,6 +187,20 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () { expect(invalidAddressEnteredEvent.calls[0].data).toEqual({name: 'to', address: 'Invalid <email@example>'}); }); + it('parses email with dash' , function() { + this.$node.val('team@pixelated-project.org'); + this.$node.trigger(blurEvent); - }); + expect(blurEvent.preventDefault).toHaveBeenCalled(); + expect(addressEnteredEvent.calls[0].data).toEqual({name: 'to', address: 'team@pixelated-project.org'}); + }); + + it('parses cannonical email with dash' , function() { + this.$node.val('Pixelated <team@pixelated-project.org>'); + this.$node.trigger(blurEvent); + + expect(blurEvent.preventDefault).toHaveBeenCalled(); + expect(addressEnteredEvent.calls[0].data).toEqual({name: 'to', address: 'Pixelated <team@pixelated-project.org>'}); + }); + }); }); |