summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/mail_view/ui/recipients/recipients.spec.js
diff options
context:
space:
mode:
authorGiovane <giovaneliberato@gmail.com>2015-10-23 12:19:19 -0200
committerGiovane <giovaneliberato@gmail.com>2015-10-23 12:23:12 -0200
commit72e332e2969d4eb36c9cd64336c1f1d89b6185f1 (patch)
treecfa8bfe38eb2449a57ebdbe7c0bc3b96da14f075 /web-ui/test/spec/mail_view/ui/recipients/recipients.spec.js
parent9bc9f6a2ecf6fbb8092a99fa9d6abbfabc0cc800 (diff)
Add invalid address sinalization on tokens #492
Diffstat (limited to 'web-ui/test/spec/mail_view/ui/recipients/recipients.spec.js')
-rw-r--r--web-ui/test/spec/mail_view/ui/recipients/recipients.spec.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/web-ui/test/spec/mail_view/ui/recipients/recipients.spec.js b/web-ui/test/spec/mail_view/ui/recipients/recipients.spec.js
index 7dd9000f..a3b3381f 100644
--- a/web-ui/test/spec/mail_view/ui/recipients/recipients.spec.js
+++ b/web-ui/test/spec/mail_view/ui/recipients/recipients.spec.js
@@ -26,15 +26,34 @@ describeComponent('mail_view/ui/recipients/recipients',function () {
beforeEach(function () {
this.setupComponent();
recipientsUpdatedEvent = spyOnEvent(document, Pixelated.events.ui.recipients.updated);
- this.component.trigger(Pixelated.events.ui.recipients.entered, {name: 'to', addresses: ['foobar@gmail.com'] });
});
it('triggers recipients updated', function() {
+ this.component.trigger(Pixelated.events.ui.recipients.entered, {name: 'to', addresses: ['foobar@gmail.com'] });
expect(recipientsUpdatedEvent).toHaveBeenTriggeredOn(document);
});
it('adds recipients', function() {
+ this.component.trigger(Pixelated.events.ui.recipients.entered, {name: 'to', addresses: ['foobar@gmail.com'] });
+ expect(this.component.attr.recipients.length).toBe(1);
+ });
+ });
+
+ describe('adding invalid recipients from the ui', function() {
+ beforeEach(function () {
+ this.setupComponent();
+ recipientsUpdatedEvent = spyOnEvent(document, Pixelated.events.ui.recipients.updated);
+ this.component.trigger(Pixelated.events.ui.recipients.enteredInvalid, {name: 'to', addresses: ['invalid.com'] });
+ });
+
+ it('does not trigger recipients updated', function() {
+ expect(recipientsUpdatedEvent).not.toHaveBeenTriggeredOn(document);
+ });
+
+ it('adds recipients with invalid indication', function() {
expect(this.component.attr.recipients.length).toBe(1);
+ expect(this.component.attr.recipients[0].attr.invalidAddress).toBe(true);
});
});
+
});