summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/mail_view/data/attachment_list.spec.js
diff options
context:
space:
mode:
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.js21
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]);
+ });
+
+ });
+
+});