diff options
author | NavaL <mnandri@thoughtworks.com> | 2015-12-22 18:58:57 +0100 |
---|---|---|
committer | NavaL <mnandri@thoughtworks.com> | 2015-12-22 19:05:10 +0100 |
commit | ec3a7f46f16c32bbaf22a14a92a890e1ab900e94 (patch) | |
tree | 4e900828ccbc1d7be63b73d5e6253acc40e901aa /web-ui/test/spec/mail_view/data/attachment_list.spec.js | |
parent | 4cb47c1848bb5d20b5ae167a7ab2879d00825f84 (diff) |
front-end for sending attachments
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 | 21 |
1 files changed, 21 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 new file mode 100644 index 00000000..74c1dea7 --- /dev/null +++ b/web-ui/test/spec/mail_view/data/attachment_list.spec.js @@ -0,0 +1,21 @@ +describeMixin('mail_view/data/attachment_list', function () { + 'use strict'; + + describe('initialization', function() { + beforeEach(function(){ + this.setupComponent(); + }); + + it('should add attachment to the list based on uploadedAttachment event', function () { + var stubAttachment = {attachment_id: 'faked'}; + $(document).trigger(Pixelated.events.mail.uploadedAttachment, stubAttachment); + expect(this.component.attr.attachments).toEqual([stubAttachment]); + + var anotherStubAttachment = {attachment_id: 'faked 2'}; + $(document).trigger(Pixelated.events.mail.uploadedAttachment, anotherStubAttachment); + expect(this.component.attr.attachments).toEqual([stubAttachment, anotherStubAttachment]); + }); + + }); + +}); |