summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/mail_list/ui/mail_items/draft_item.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui/test/spec/mail_list/ui/mail_items/draft_item.spec.js')
-rw-r--r--web-ui/test/spec/mail_list/ui/mail_items/draft_item.spec.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/web-ui/test/spec/mail_list/ui/mail_items/draft_item.spec.js b/web-ui/test/spec/mail_list/ui/mail_items/draft_item.spec.js
new file mode 100644
index 00000000..fbe285c6
--- /dev/null
+++ b/web-ui/test/spec/mail_list/ui/mail_items/draft_item.spec.js
@@ -0,0 +1,32 @@
+describeComponent('mail_list/ui/mail_items/draft_item', function () {
+ 'use strict';
+
+ var mail;
+
+ beforeEach(function () {
+ mail = Pixelated.testData().parsedMail.draft;
+
+ this.setupComponent('<li></li>', {
+ mail: mail,
+ selected: false,
+ templateType: 'single'
+ });
+ });
+
+ it('should de-select the item if a new mail is composed', function () {
+ this.component.$node.addClass('selected');
+
+ $(document).trigger(Pixelated.events.ui.composeBox.newMessage);
+
+ expect(this.component.$node).not.toHaveClass('selected');
+ });
+
+ it('should trigger the openDraft event when clicked', function () {
+ var openDraftEvent = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openDraft);
+
+ this.$node.find('a').click();
+
+ expect(openDraftEvent).toHaveBeenTriggeredOnAndWith(document, { ident: 'B2432' });
+ });
+});
+