diff options
author | NavaL <mnandri@thoughtworks.com> | 2016-01-05 19:44:07 +0100 |
---|---|---|
committer | NavaL <mnandri@thoughtworks.com> | 2016-01-05 19:45:38 +0100 |
commit | 17695c1c9037d9edc927fb5265d380384eb6866a (patch) | |
tree | 44e26d41fec052c9b641d0eba0c92f625680c263 /web-ui/test/spec/mail_view/data/attachment_list.spec.js | |
parent | 0ca01a8a8e2cd9201f43fa840a30a0822215bfef (diff) |
emptying attachment list when email sent -- in case the user stays on the same screen and re-click compose
Issue #548
Diffstat (limited to 'web-ui/test/spec/mail_view/data/attachment_list.spec.js')
-rw-r--r-- | web-ui/test/spec/mail_view/data/attachment_list.spec.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/web-ui/test/spec/mail_view/data/attachment_list.spec.js b/web-ui/test/spec/mail_view/data/attachment_list.spec.js index 3d93537b..45167e33 100644 --- a/web-ui/test/spec/mail_view/data/attachment_list.spec.js +++ b/web-ui/test/spec/mail_view/data/attachment_list.spec.js @@ -16,6 +16,20 @@ describeMixin('mail_view/data/attachment_list', function () { expect(this.component.attr.attachments).toEqual([stubAttachment, anotherStubAttachment]); }); + it('should reset attachment list on compose', function () { + this.component.attr.attachments = ['some array']; + $(document).trigger(Pixelated.events.mail.resetAttachments); + + expect(this.component.attr.attachments).toEqual([]); + }); + + it('should reset attachment list and tear down when email sent', function () { + this.component.attr.attachments = ['some array']; + $(document).trigger(Pixelated.events.mail.sent); + + expect(this.component.attr.attachments).toEqual([]); + }); + }); }); |