diff options
author | Victor Shyba <victor.shyba@gmail.com> | 2014-11-18 20:09:13 -0300 |
---|---|---|
committer | Victor Shyba <victor.shyba@gmail.com> | 2014-11-18 20:09:13 -0300 |
commit | db9626029976585edfddfa22243762016ddff221 (patch) | |
tree | dd32ded7d9a038f710e3645f38366bc5869f5fdd /web-ui/test/spec | |
parent | ba583f83895cdf998ebee7c80ace26a40338c414 (diff) |
for #14, space does not finish address input anymore
Diffstat (limited to 'web-ui/test/spec')
-rw-r--r-- | web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js | 16 |
1 files changed, 15 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 6b486fa9..51001e5e 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 @@ -10,7 +10,6 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () { _.each([ [186, 'semicolon'], [188, 'comma'], - [32, 'space'] ], function (keycode) { @@ -77,6 +76,21 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () { expect(addressEnteredEvent).not.toHaveBeenTriggeredOnAndWith(this, { name: 'to', address: ''}); }); }); + + describe('when space is pressed', function () { + it('address input should not finish', function () { + var addressEnteredEvent = spyOnEvent(this.$node, Pixelated.events.ui.recipients.entered); + + var spaceKeyPressEvent = $.Event('keydown', { which: 32}); + spyOn(spaceKeyPressEvent, 'preventDefault'); + + this.$node.val('a@b.c'); + this.$node.trigger(spaceKeyPressEvent); + + expect(spaceKeyPressEvent.preventDefault).not.toHaveBeenCalled(); + expect(addressEnteredEvent).not.toHaveBeenTriggeredOnAndWith(this, { name: 'to', address: 'a@b.c' }); + }); + }); }); describe('on keyup', function () { |