diff options
author | Duda Dornelles <ddornell@thoughtworks.com> | 2014-10-08 16:56:11 +0200 |
---|---|---|
committer | Duda Dornelles <ddornell@thoughtworks.com> | 2014-10-08 16:56:11 +0200 |
commit | f33b22f65a88410a75061f3e8e6d509296f4d69f (patch) | |
tree | 4b1c7d4d7c86bf927b3c4fef812667a1d71347b9 /web-ui/test/spec | |
parent | 84a1e49bdef02ca46df79b7d9151cdf57a574938 (diff) |
#97 - making sure that the send button gets enabled when sending drafts even if recipients are undefined for one recipient type but not the others
Diffstat (limited to 'web-ui/test/spec')
-rw-r--r-- | web-ui/test/spec/mixins/with_mail_edit_base.spec.js | 12 |
1 files changed, 10 insertions, 2 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 35ec0eb6..10b7d04c 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 @@ -17,21 +17,29 @@ 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 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: [] } }); + 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); }); }); |