summaryrefslogtreecommitdiff
path: root/web-ui/test/spec
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui/test/spec')
-rw-r--r--web-ui/test/spec/mixins/with_mail_edit_base.spec.js27
-rw-r--r--web-ui/test/spec/services/model/mail.spec.js3
2 files changed, 8 insertions, 22 deletions
diff --git a/web-ui/test/spec/mixins/with_mail_edit_base.spec.js b/web-ui/test/spec/mixins/with_mail_edit_base.spec.js
index 10b7d04c..f62c1f75 100644
--- a/web-ui/test/spec/mixins/with_mail_edit_base.spec.js
+++ b/web-ui/test/spec/mixins/with_mail_edit_base.spec.js
@@ -15,33 +15,18 @@ describeMixin('mixins/with_mail_edit_base', function () {
});
describe('initialization', function() {
- it('should enable send button when rendering with recipients', function() {
- var enableSendButtonEvent = spyOnEvent(document, Pixelated.events.ui.sendbutton.enable);
- this.component.render(function() {}, {
- recipients: { to: ['foobar@mail.com'], cc: [] }
- });
- expect(enableSendButtonEvent).toHaveBeenTriggeredOn(document);
- enableSendButtonEvent = spyOnEvent(document, Pixelated.events.ui.sendbutton.enable);
- this.component.render(function() {}, {
- recipients: { to: ['foobar@mail.com'], cc: undefined }
- });
- expect(enableSendButtonEvent).toHaveBeenTriggeredOn(document);
- });
+ it('should warn send button of existing recipients', function () {
+ var recipientsUpdatedEvent = spyOnEvent(document, Pixelated.events.ui.recipients.updated);
- it('should not enable send button when rendering without recipients', function() {
- var enableSendButtonEvent = spyOnEvent(document, Pixelated.events.ui.sendbutton.enable);
this.component.render(function() {}, {
- recipients: { to: [], cc: [] }
+ recipients: { to: ['foobar@mail.com'], cc: [] }
});
- expect(enableSendButtonEvent).not.toHaveBeenTriggeredOn(document);
- enableSendButtonEvent = spyOnEvent(document, Pixelated.events.ui.sendbutton.enable);
- this.component.render(function() {}, {
- recipients: { to: undefined, cc: undefined }
- });
- expect(enableSendButtonEvent).not.toHaveBeenTriggeredOn(document);
+ expect(recipientsUpdatedEvent).toHaveBeenTriggeredOnAndWith(document, { newRecipients: ['foobar@mail.com'], name: 'to'});
+ expect(recipientsUpdatedEvent).not.toHaveBeenTriggeredOnAndWith(document, { newRecipients: [], name: 'cc'});
});
+
});
describe('when the user is typing in subject or body', function() {
diff --git a/web-ui/test/spec/services/model/mail.spec.js b/web-ui/test/spec/services/model/mail.spec.js
index 9b5f71c6..24a8d244 100644
--- a/web-ui/test/spec/services/model/mail.spec.js
+++ b/web-ui/test/spec/services/model/mail.spec.js
@@ -9,7 +9,8 @@ require(['services/model/mail'], function (Mail) {
it('returns the "to" and "cc" addresses if the mail was sent', function () {
var mail = Mail.create({
header: { to: ['a@b.c', 'e@f.g'], cc: ['x@x.x'] },
- tags: ['sent']
+ tags: [],
+ mailbox: 'SENT'
});
var addresses = mail.replyToAddress();