diff options
author | sw00 <sett.wai@gmail.com> | 2015-04-08 20:41:46 -0300 |
---|---|---|
committer | Bruno Wagner <bwgpro@gmail.com> | 2015-04-09 12:11:12 -0300 |
commit | ec5846325bdb06a1a231ccc6531adffc3625bcc1 (patch) | |
tree | ba27838a329464937e07fbed35775813df01693c /web-ui | |
parent | fdee1e35c070420192b8e754040d6a7d9a8cd6dc (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.js | 1 | ||||
-rw-r--r-- | web-ui/test/spec/tags/data/tags.spec.js | 8 |
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'); + }); }); |