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 +++++++++ web-ui/test/spec/tags/ui/tag_list.spec.js | 7 ------- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'web-ui/test/spec') 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(); diff --git a/web-ui/test/spec/tags/ui/tag_list.spec.js b/web-ui/test/spec/tags/ui/tag_list.spec.js index e84c68aa..f92f72af 100644 --- a/web-ui/test/spec/tags/ui/tag_list.spec.js +++ b/web-ui/test/spec/tags/ui/tag_list.spec.js @@ -62,13 +62,6 @@ describeComponent('tags/ui/tag_list', function () { expect(this.component.attr.currentTag).toEqual('amazing'); }); - it('should uncheck all emails when a new tag is selected', function () { - var uncheckAllEvent = spyOnEvent(document, Pixelated.events.ui.mails.uncheckAll); - $(document).trigger(Pixelated.events.ui.tag.select, { tag: 'amazing'}); - - expect(uncheckAllEvent).toHaveBeenTriggeredOn(document); - }); - it('resets the tag lists when loading tags', function () { var tagList = [tag('tag1', 1, false), tag('tag2', 2, true), tag('tag3', 3, true)]; $(document).trigger(Pixelated.events.tags.received, {tags: tagList}); -- cgit v1.2.3