summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/tags/ui/tag.spec.js
diff options
context:
space:
mode:
authorDuda Dornelles <dudassdornelles@gmail.com>2015-01-07 11:36:43 -0200
committerDuda Dornelles <dudassdornelles@gmail.com>2015-01-07 11:36:43 -0200
commit2bcc7203073d71814483b0d6ba797c187048fc1e (patch)
tree082eaf4f95433a229a99d22969a56bd90211a4fa /web-ui/test/spec/tags/ui/tag.spec.js
parentb4bd74e59313cb40638d954a2369a0c9650d75f7 (diff)
parentb0720edaa0d51ee9e807495fa536d890d332c50d (diff)
Merge pull request #223 from pixelated-project/refactoring-events
Refactoring events on web-ui left-pane
Diffstat (limited to 'web-ui/test/spec/tags/ui/tag.spec.js')
-rw-r--r--web-ui/test/spec/tags/ui/tag.spec.js24
1 files changed, 23 insertions, 1 deletions
diff --git a/web-ui/test/spec/tags/ui/tag.spec.js b/web-ui/test/spec/tags/ui/tag.spec.js
index 3bc0c7fc..36fc83f2 100644
--- a/web-ui/test/spec/tags/ui/tag.spec.js
+++ b/web-ui/test/spec/tags/ui/tag.spec.js
@@ -23,7 +23,6 @@ describeComponent('tags/ui/tag', function () {
this.component.$node.click();
- expect(this.component.attr.selected).toBeTruthy();
expect(this.$node.attr('class')).toMatch('selected');
expect(tagSelectEvent).toHaveBeenTriggeredOnAndWith(document, { tag: 'inbox' });
});
@@ -94,6 +93,18 @@ describeComponent('tags/ui/tag', function () {
$(document).trigger(Pixelated.events.mail.read, { tags: ['inbox']});
expect(this.$node.html()).not.toMatch('"unread-count"');
});
+
+ it('should not be selected when a search is performed', function() {
+ this.component.trigger(document, Pixelated.events.search.perform);
+
+ expect(this.component.$node).not.toHaveClass('selected');
+ });
+
+ it('should not be selected when the search is cleared', function() {
+ this.component.trigger(document, Pixelated.events.search.empty);
+
+ expect(this.component.$node).not.toHaveClass('selected');
+ });
});
describe('drafts tag', function () {
@@ -149,6 +160,17 @@ describeComponent('tags/ui/tag', function () {
expect(this.$node.attr('class')).not.toMatch('searching');
});
+ it('should be selected when a search is performed', function() {
+ this.component.trigger(document, Pixelated.events.search.perform);
+
+ expect(this.component.$node).toHaveClass('selected');
+ });
+
+ it('should be selected when the search is cleared', function() {
+ this.component.trigger(document, Pixelated.events.search.empty);
+
+ expect(this.component.$node).toHaveClass('selected');
+ });
});
_.each(['sent', 'trash'], function (tag_name) {