summaryrefslogtreecommitdiff
path: root/web-ui
diff options
context:
space:
mode:
authorsw00 <sett.wai@gmail.com>2015-04-08 20:41:46 -0300
committerBruno Wagner <bwgpro@gmail.com>2015-04-09 12:11:12 -0300
commitec5846325bdb06a1a231ccc6531adffc3625bcc1 (patch)
treeba27838a329464937e07fbed35775813df01693c /web-ui
parentfdee1e35c070420192b8e754040d6a7d9a8cd6dc (diff)
@sw00, @amukiza: #299 tag counters are updated when mail is sent
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');
+ });
});