summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/mail_view/ui/attachment_list.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui/test/spec/mail_view/ui/attachment_list.spec.js')
-rw-r--r--web-ui/test/spec/mail_view/ui/attachment_list.spec.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/web-ui/test/spec/mail_view/ui/attachment_list.spec.js b/web-ui/test/spec/mail_view/ui/attachment_list.spec.js
index c66b959c..8bbc9f1a 100644
--- a/web-ui/test/spec/mail_view/ui/attachment_list.spec.js
+++ b/web-ui/test/spec/mail_view/ui/attachment_list.spec.js
@@ -4,7 +4,7 @@ describeComponent('mail_view/ui/attachment_list', function () {
describe('initialization', function () {
beforeEach(function () {
this.setupComponent('<div id="attachment-list">' +
- '<ul><li id="attachment-list-item"> </li></ul>' +
+ '<ul id="attachment-list-item"></ul>' +
'</div>');
});
@@ -22,10 +22,20 @@ describeComponent('mail_view/ui/attachment_list', function () {
$(document).trigger(Pixelated.events.mail.uploadedAttachment, stubAttachment);
- var expected_li = '<a href="/attachment/faked?filename=haha.txt&amp;encoding=base64">haha.txt (4.39 Kb)</a>';
+ var expected_li = '<li><a href="/attachment/faked?filename=haha.txt&amp;encoding=base64">haha.txt (4.39 Kb)</a></li>';
expect(this.component.select('attachmentListItem').html()).toEqual(expected_li);
});
+ it('should tear down when email sent', function () {
+ var mockTearDown = spyOn(this.Component.prototype, 'resetAll');
+ this.setupComponent('<div id="attachment-list">' +
+ '<ul id="attachment-list-item"></ul>' +
+ '</div>');
+ $(document).trigger(Pixelated.events.mail.sent);
+
+ expect(mockTearDown).toHaveBeenCalled();
+ });
+
xit('should start uploading attachments', function () {
var stubAttachment = {attachment_id: 'faked', filename: 'haha.txt', filesize: 4500};
var mockAjax = spyOn($, 'ajax').and.callFake(function (params) {params.success(stubAttachment);});