summaryrefslogtreecommitdiff
path: root/web-ui/test/spec
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2014-11-18 20:10:40 -0300
committerVictor Shyba <victor.shyba@gmail.com>2014-11-18 20:10:40 -0300
commit8e001a93b7d90bd394c9401c0f1b4acf77e4f9b7 (patch)
tree3a83cec2f67e8b5ba4890286c16f31ba6a8ee2c2 /web-ui/test/spec
parentdb9626029976585edfddfa22243762016ddff221 (diff)
for #14, if shift is pressed with a finish key it should ignore the event, since the key isnt the expected
Diffstat (limited to 'web-ui/test/spec')
-rw-r--r--web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js10
1 files changed, 10 insertions, 0 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 51001e5e..433c145b 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
@@ -33,6 +33,16 @@ 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 () {
+ var addressEnteredEvent = spyOnEvent(this.$node, Pixelated.events.ui.recipients.entered);
+
+ var enterAddressKeyPressEvent = $.Event('keydown', { which: keycode[0], shiftKey: true });
+ this.$node.val('a@b.c');
+ this.$node.trigger(enterAddressKeyPressEvent);
+
+ expect(addressEnteredEvent).not.toHaveBeenTriggeredOnAndWith(this, { name: 'to', address: 'a@b.c' });
+ });
+
it('prevents event default regardless on input val when key is ' + keycode[1], function () {
var enterAddressKeyPressEvent = $.Event('keydown', { which: keycode[0] });
spyOn(enterAddressKeyPressEvent, 'preventDefault');