summaryrefslogtreecommitdiff
path: root/web-ui
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui')
-rw-r--r--web-ui/app/js/tags/data/tags.js1
-rw-r--r--web-ui/test/spec/tags/data/tags.spec.js8
2 files changed, 9 insertions, 0 deletions
diff --git a/web-ui/app/js/tags/data/tags.js b/web-ui/app/js/tags/data/tags.js
index 401b41f7..348c1832 100644
--- a/web-ui/app/js/tags/data/tags.js
+++ b/web-ui/app/js/tags/data/tags.js
@@ -57,6 +57,7 @@ define(['flight/lib/component', 'page/events', 'helpers/monitored_ajax', 'mixins
this.after('initialize', function () {
this.on(document, events.tags.want, this.fetchTags);
+ this.on(document, events.mail.sent, this.fetchTags);
});
}
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');
+ });
});