summaryrefslogtreecommitdiff
path: root/web-ui/test
diff options
context:
space:
mode:
authorDuda Dornelles <dudassdornelles@gmail.com>2014-10-24 14:23:44 +0200
committerDuda Dornelles <dudassdornelles@gmail.com>2014-10-24 14:23:44 +0200
commitf6756ae2a53e3c6a8521c11dd406d8a9e9d0f515 (patch)
treed30922804f1f682f3de4dd8c857d3d0f55e428d0 /web-ui/test
parent7005b03934b2b666b56fb972cfad057a46d2fcbd (diff)
parent7bbc79dd46f8b23961d6abc9567dc66365d03398 (diff)
Merge pull request #123 from pedrovereza/issue-78
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'});
+ })
+ });
});