summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2014-11-18 20:09:13 -0300
committerVictor Shyba <victor.shyba@gmail.com>2014-11-18 20:09:13 -0300
commitdb9626029976585edfddfa22243762016ddff221 (patch)
treedd32ded7d9a038f710e3645f38366bc5869f5fdd
parentba583f83895cdf998ebee7c80ace26a40338c414 (diff)
for #14, space does not finish address input anymore
-rw-r--r--web-ui/app/js/mail_view/ui/recipients/recipients_input.js1
-rw-r--r--web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js16
2 files changed, 15 insertions, 2 deletions
diff --git a/web-ui/app/js/mail_view/ui/recipients/recipients_input.js b/web-ui/app/js/mail_view/ui/recipients/recipients_input.js
index e9211d85..b65e6080 100644
--- a/web-ui/app/js/mail_view/ui/recipients/recipients_input.js
+++ b/web-ui/app/js/mail_view/ui/recipients/recipients_input.js
@@ -34,7 +34,6 @@ define([
9: 'tab',
186: 'semicolon',
188: 'comma',
- 32: 'space',
13: 'enter',
27: 'esc'
},
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 () {