diff options
Diffstat (limited to 'web-ui/test/spec/mail_list_actions')
-rw-r--r-- | web-ui/test/spec/mail_list_actions/ui/compose_trigger.spec.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/web-ui/test/spec/mail_list_actions/ui/compose_trigger.spec.js b/web-ui/test/spec/mail_list_actions/ui/compose_trigger.spec.js index 5e65ddbb..20deeae3 100644 --- a/web-ui/test/spec/mail_list_actions/ui/compose_trigger.spec.js +++ b/web-ui/test/spec/mail_list_actions/ui/compose_trigger.spec.js @@ -13,4 +13,19 @@ describeComponent('mail_list_actions/ui/compose_trigger', function () { expect(spyEvent).toHaveBeenTriggeredOn(document); }); + it('trigger showEmailSuccess message when message is sent', function () { + var spyEvent = spyOnEvent(document, Pixelated.events.ui.userAlerts.displayMessage); + + this.component.trigger(document, Pixelated.events.mail.sent); + + expect(spyEvent).toHaveBeenTriggeredOnAndWith(document, {message: 'Your message was sent!', class: 'success'}); + }); + + it('trigger showEmailError message when message is not sent', function () { + var spyEvent = spyOnEvent(document, Pixelated.events.ui.userAlerts.displayMessage); + + this.component.trigger(document, Pixelated.events.mail.send_failed, {responseJSON: {message: 'failure'}}); + + expect(spyEvent).toHaveBeenTriggeredOnAndWith(document, {message: 'Error, message not sent: failure', class: 'error'}); + }); }); |