diff options
-rw-r--r-- | web-ui/app/js/tags/ui/tag_list.js | 1 | ||||
-rw-r--r-- | web-ui/test/spec/tags/ui/tag_list.spec.js | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/web-ui/app/js/tags/ui/tag_list.js b/web-ui/app/js/tags/ui/tag_list.js index a2172c6d..d6f6f76c 100644 --- a/web-ui/app/js/tags/ui/tag_list.js +++ b/web-ui/app/js/tags/ui/tag_list.js @@ -98,6 +98,7 @@ define( this.after('initialize', function() { this.on(document, events.tags.received, this.displayTags); this.on(document, events.ui.tag.select, this.updateCurrentTag); + this.on(document, events.ui.tag.select, events.ui.mails.uncheckAll); this.renderTagListTemplate(); }); } 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 f92f72af..e84c68aa 100644 --- a/web-ui/test/spec/tags/ui/tag_list.spec.js +++ b/web-ui/test/spec/tags/ui/tag_list.spec.js @@ -62,6 +62,13 @@ 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}); |