diff options
author | Gislene Pereira <gislene01@gmail.com> | 2016-02-19 14:56:09 -0300 |
---|---|---|
committer | NavaL <ayoyo@thoughtworks.com> | 2016-02-19 15:40:54 -0300 |
commit | 940df3e2e12ff862c9e190fdfcd9a0278164a318 (patch) | |
tree | 327c126f1ba7251854006e43380e3eba6122d0d1 /web-ui/test/spec/mail_list_actions | |
parent | a6202acbb44162e867f107a9cf262d95a41e4347 (diff) |
Close the compose/inline box right after user clicks Send button and
show message later when the email is sent or not.
The Growl will be yellow if success and red if the email failed to be
sent.
Issue #609
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'}); + }); }); |