From bd62a87dfd4c3cbf09e09dbea1cd015410c5fe38 Mon Sep 17 00:00:00 2001 From: rafael lisboa Date: Thu, 9 Apr 2015 10:36:36 -0300 Subject: #289 - uncheck mails when user changes current tag/mailbox change solution to let event be handled in mail item mixin --- web-ui/test/spec/mail_list/ui/mail_items/mail_item.spec.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'web-ui/test/spec/mail_list') diff --git a/web-ui/test/spec/mail_list/ui/mail_items/mail_item.spec.js b/web-ui/test/spec/mail_list/ui/mail_items/mail_item.spec.js index 058040c9..b1ac3037 100644 --- a/web-ui/test/spec/mail_list/ui/mail_items/mail_item.spec.js +++ b/web-ui/test/spec/mail_list/ui/mail_items/mail_item.spec.js @@ -10,6 +10,7 @@ describeMixin('mail_list/ui/mail_items/mail_item', function () { selected: false, tag: 'inbox' }); + this.component.attachListeners(); }); describe('mail checkbox', function () { @@ -20,6 +21,14 @@ describeMixin('mail_list/ui/mail_items/mail_item', function () { checkbox = this.component.$node.find('input[type=checkbox]'); }); + it('unchecks itself when another tag is selected', function () { + this.component.checkCheckbox(); + this.component.trigger(document, Pixelated.events.ui.tag.select, { tag: 'amazing'}); + + expect(mailUncheckedEvent).toHaveBeenTriggeredOn(document); + expect(checkbox.prop('checked')).toBe(false); + }); + it('checkCheckbox checks it and triggers events.ui.mail.checked', function () { this.component.checkCheckbox(); -- cgit v1.2.3