summaryrefslogtreecommitdiff
path: root/web-ui/test
diff options
context:
space:
mode:
authorPatrick Maia <patrickjourdanmaia@gmail.com>2015-02-06 19:22:25 +0000
committerPatrick Maia <patrickjourdanmaia@gmail.com>2015-02-06 19:24:58 +0000
commitf55a7e5198bfcb8d85c60d86bdf37c18f08c40db (patch)
tree0f2f83c6b9291020f7bbec8ff5151a266bc77ae2 /web-ui/test
parent63acf3c1965d8a8b4b1a9acef7f93f19a8f7cbc2 (diff)
Issue #274 - fixes bug on numeric tags removal
Diffstat (limited to 'web-ui/test')
-rw-r--r--web-ui/test/spec/mail_view/ui/mail_view.spec.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/web-ui/test/spec/mail_view/ui/mail_view.spec.js b/web-ui/test/spec/mail_view/ui/mail_view.spec.js
index 55b37de2..2d2d4688 100644
--- a/web-ui/test/spec/mail_view/ui/mail_view.spec.js
+++ b/web-ui/test/spec/mail_view/ui/mail_view.spec.js
@@ -33,10 +33,23 @@ describeComponent('mail_view/ui/mail_view', function () {
it('removes the tag from the mail when the tag label is clicked', function() {
var updateSpy = spyOnEvent(document, Pixelated.events.mail.tags.update);
+ testData.mail.tags = ['inbox', 'other'];
this.component.displayMail({}, testData);
this.component.removeTag('inbox');
expect(updateSpy).toHaveBeenTriggeredOn(document);
+ expect(updateSpy.mostRecentCall.data.tags).toEqual(['other']);
+ });
+
+ it('removes numeric tag from the mail when its label is clicked', function() {
+ var updateSpy = spyOnEvent(document, Pixelated.events.mail.tags.update);
+
+ testData.mail.tags = ['inbox', '12345'];
+ this.component.displayMail({}, testData);
+ this.component.removeTag(12345);
+
+ expect(updateSpy).toHaveBeenTriggeredOn(document);
+ expect(updateSpy.mostRecentCall.data.tags).toEqual(['inbox']);
});
it('remove tag triggers refreshTagList event', function(){