summaryrefslogtreecommitdiff
path: root/web-ui/test/spec
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui/test/spec')
-rw-r--r--web-ui/test/spec/tags/data/tags.spec.js8
-rw-r--r--web-ui/test/spec/tags/ui/tag_list.spec.js7
2 files changed, 15 insertions, 0 deletions
diff --git a/web-ui/test/spec/tags/data/tags.spec.js b/web-ui/test/spec/tags/data/tags.spec.js
index 469ab0ce..53978fb8 100644
--- a/web-ui/test/spec/tags/data/tags.spec.js
+++ b/web-ui/test/spec/tags/data/tags.spec.js
@@ -47,4 +47,12 @@ describeComponent('tags/data/tags', function () {
tags.push(this.component.all);
expect(eventSpy.mostRecentCall.data).toEqual(jasmine.objectContaining({tags: tags}));
});
+
+ it('should reload taglist on mail sent', function(){
+ spyOn($, 'ajax').and.returnValue($.Deferred());
+
+ $(document).trigger(Pixelated.events.mail.sent);
+
+ expect($.ajax.calls.mostRecent().args[0]).toEqual('/tags');
+ });
});
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});