summaryrefslogtreecommitdiff
path: root/web-ui/test
diff options
context:
space:
mode:
authorPedro Vereza <pdrvereza@gmail.com>2014-10-24 09:57:15 -0200
committerPedro Vereza <pdrvereza@gmail.com>2014-10-24 10:13:07 -0200
commit7bbc79dd46f8b23961d6abc9567dc66365d03398 (patch)
treed30922804f1f682f3de4dd8c857d3d0f55e428d0 /web-ui/test
parent7005b03934b2b666b56fb972cfad057a46d2fcbd (diff)
Issue #78 - Tokenize emails on blur
Diffstat (limited to 'web-ui/test')
-rw-r--r--web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js13
1 files changed, 13 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 499065c2..6b486fa9 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
@@ -99,4 +99,17 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () {
});
});
+ describe('on blur', function() {
+ it('tokenizes recipient email if there is an input val', function() {
+ var addressEnteredEvent = spyOnEvent(this.$node, Pixelated.events.ui.recipients.entered);
+ var blurEvent = $.Event('blur');
+ spyOn(blurEvent, 'preventDefault');
+
+ this.$node.val('a@b.c');
+ this.$node.trigger(blurEvent);
+
+ expect(blurEvent.preventDefault).toHaveBeenCalled();
+ expect(addressEnteredEvent).toHaveBeenTriggeredOnAndWith(this, {name: 'to', address: 'a@b.c'});
+ })
+ });
});