diff options
author | Patrick Maia <pixelated-team+patrick@thoughtworks.com> | 2014-08-08 17:51:33 -0300 |
---|---|---|
committer | Patrick Maia <patrickjourdanmaia@gmail.com> | 2014-08-08 17:51:33 -0300 |
commit | 97e762a0832593031ae71ab1e11d4c0e377a00f4 (patch) | |
tree | 213e835f4effbaf97f0922e5941065b1329d0501 /web-ui/test/spec/tags | |
parent | f22a6a32e901f52b2b3f2b3fd8625c43302ff001 (diff) |
replaces Smail by Pixelated in all js files
Diffstat (limited to 'web-ui/test/spec/tags')
-rw-r--r-- | web-ui/test/spec/tags/data/tags.spec.js | 10 | ||||
-rw-r--r-- | web-ui/test/spec/tags/ui/tag.spec.js | 32 | ||||
-rw-r--r-- | web-ui/test/spec/tags/ui/tag_list.spec.js | 16 | ||||
-rw-r--r-- | web-ui/test/spec/tags/ui/tag_shortcut.spec.js | 4 |
4 files changed, 31 insertions, 31 deletions
diff --git a/web-ui/test/spec/tags/data/tags.spec.js b/web-ui/test/spec/tags/data/tags.spec.js index 8e7d33c3..a8b160fd 100644 --- a/web-ui/test/spec/tags/data/tags.spec.js +++ b/web-ui/test/spec/tags/data/tags.spec.js @@ -8,7 +8,7 @@ describeComponent('tags/data/tags', function () { it('asks the server for tags when receiving the tags:want event', function() { spyOn($, 'ajax').andReturn({done: function() {}}); - this.component.trigger(Smail.events.tags.want); + this.component.trigger(Pixelated.events.tags.want); expect($.ajax.mostRecentCall.args[0]).toEqual('/tags'); }); @@ -17,9 +17,9 @@ describeComponent('tags/data/tags', function () { var f; spyOn($, 'ajax').andReturn({done: function(d) { f = d; }}); var me = {}; - var eventSpy = spyOnEvent(me, Smail.events.tags.received); + var eventSpy = spyOnEvent(me, Pixelated.events.tags.received); - this.component.trigger(Smail.events.tags.want, { caller: me}); + this.component.trigger(Pixelated.events.tags.want, { caller: me}); f(['foo', 'bar', 'quux/bar']); expect(eventSpy).toHaveBeenTriggeredOn(me); @@ -29,8 +29,8 @@ describeComponent('tags/data/tags', function () { var f; spyOn($, 'ajax').andReturn({done: function(d) { f = d; }}); var me = {}; - var eventSpy = spyOnEvent(me, Smail.events.tags.received); - this.component.trigger(Smail.events.tags.want, { caller: me }); + var eventSpy = spyOnEvent(me, Pixelated.events.tags.received); + this.component.trigger(Pixelated.events.tags.want, { caller: me }); var tags = ['foo', 'bar', 'quux/bar']; f(tags); tags.push(this.component.all); diff --git a/web-ui/test/spec/tags/ui/tag.spec.js b/web-ui/test/spec/tags/ui/tag.spec.js index 12f16330..de78ba75 100644 --- a/web-ui/test/spec/tags/ui/tag.spec.js +++ b/web-ui/test/spec/tags/ui/tag.spec.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ /*global _ */ describeComponent('tags/ui/tag', function () { @@ -19,8 +19,8 @@ describeComponent('tags/ui/tag', function () { }); it('selects the tag on click', function () { - var tagSelectEvent = spyOnEvent(document, Smail.events.ui.tag.select); - var cleanSelectedEvent = spyOnEvent(document, Smail.events.ui.mails.cleanSelected); + var tagSelectEvent = spyOnEvent(document, Pixelated.events.ui.tag.select); + var cleanSelectedEvent = spyOnEvent(document, Pixelated.events.ui.mails.cleanSelected); this.component.$node.click(); @@ -33,28 +33,28 @@ describeComponent('tags/ui/tag', function () { it('should remove selected class when selecting a different tag', function () { this.$node.click(); - $(document).trigger(Smail.events.ui.tag.select, {tag: 'drafts'}); + $(document).trigger(Pixelated.events.ui.tag.select, {tag: 'drafts'}); expect(this.$node).not.toHaveClass('selected'); }); it('triggers tag selected on tag select', function () { - var tagSelectedEvent = spyOnEvent(document, Smail.events.ui.tag.select); + var tagSelectedEvent = spyOnEvent(document, Pixelated.events.ui.tag.select); - $(document).trigger(Smail.events.ui.tag.select, { tag: 'drafts'}); + $(document).trigger(Pixelated.events.ui.tag.select, { tag: 'drafts'}); expect(tagSelectedEvent).toHaveBeenTriggeredOnAndWith(document, { tag: 'drafts'}); }); it('increases the read count when there is an email read and the email has that tag', function () { - $(document).trigger(Smail.events.mail.read, { tags: ['inbox'] }); + $(document).trigger(Pixelated.events.mail.read, { tags: ['inbox'] }); expect(this.component.attr.tag.counts.read).toEqual(1); expect(this.$node.html()).toMatch('<span class="unread-count">99</span>'); }); it('doesnt increase the read count when the read email doesnt have the tag', function () { - $(document).trigger(Smail.events.mail.read, { tags: ['amazing']}); + $(document).trigger(Pixelated.events.mail.read, { tags: ['amazing']}); expect(this.component.attr.tag.counts.read).toEqual(0); expect(this.$node.html()).not.toMatch('<span class="unread-count">99</span>'); @@ -62,7 +62,7 @@ describeComponent('tags/ui/tag', function () { it('doesnt display the unread count when there are no unreads', function () { this.component.attr.tag.counts.read = 100; - $(document).trigger(Smail.events.mail.read, { tags: ['inbox']}); + $(document).trigger(Pixelated.events.mail.read, { tags: ['inbox']}); expect(this.$node.html()).not.toMatch('"unread-count"'); }); }); @@ -83,7 +83,7 @@ describeComponent('tags/ui/tag', function () { }); it('shows the total count instead of the unread count', function () { - $(document).trigger(Smail.events.mail.read, { tags: ['drafts']}); + $(document).trigger(Pixelated.events.mail.read, { tags: ['drafts']}); expect(this.$node.html()).toMatch('<span class="total-count">100</span>'); expect(this.$node.html()).not.toMatch('"unread-count"'); }); @@ -104,18 +104,18 @@ describeComponent('tags/ui/tag', function () { }); it('adds searching class when user is doing a search', function(){ - $(document).trigger(Smail.events.search.perform, {}); + $(document).trigger(Pixelated.events.search.perform, {}); expect(this.$node.attr('class')).toMatch('searching'); }); it('removes searching class when user searches for empty string', function(){ - $(document).trigger(Smail.events.search.perform, {}); - $(document).trigger(Smail.events.search.empty); + $(document).trigger(Pixelated.events.search.perform, {}); + $(document).trigger(Pixelated.events.search.empty); expect(this.$node.attr('class')).not.toMatch('searching'); }); it('removes searching class when user clicks in any tag', function(){ - $(document).trigger(Smail.events.search.perform, {}); + $(document).trigger(Pixelated.events.search.perform, {}); this.$node.click(); expect(this.$node.attr('class')).not.toMatch('searching'); }); @@ -138,12 +138,12 @@ describeComponent('tags/ui/tag', function () { }); it('doesn\'t display unread count for special folder', function () { - $(document).trigger(Smail.events.mail.read, { tags: [tag_name]}); + $(document).trigger(Pixelated.events.mail.read, { tags: [tag_name]}); expect(this.$node.html()).not.toMatch('unread-count'); }); it('doesn\'t display read count for special folder', function () { - $(document).trigger(Smail.events.mail.read, { tags: [tag_name]}); + $(document).trigger(Pixelated.events.mail.read, { tags: [tag_name]}); expect(this.$node.html()).not.toMatch('total-count'); }); }); diff --git a/web-ui/test/spec/tags/ui/tag_list.spec.js b/web-ui/test/spec/tags/ui/tag_list.spec.js index af3ddd3a..f39fbf36 100644 --- a/web-ui/test/spec/tags/ui/tag_list.spec.js +++ b/web-ui/test/spec/tags/ui/tag_list.spec.js @@ -16,7 +16,7 @@ describeComponent('tags/ui/tag_list', function () { this.component.attr.default = false; var tagList = [tag('tag1', 1), tag('tag2', 2), tag('tag3', 3)]; - $(document).trigger(Smail.events.ui.tagList.load, {tags: tagList}); + $(document).trigger(Pixelated.events.ui.tagList.load, {tags: tagList}); var items = _.map(this.$node.find('li'), function(el) { return $(el).attr('id'); @@ -28,7 +28,7 @@ describeComponent('tags/ui/tag_list', function () { it('should render the default tags when tagsList:load is received and default attribute is true', function() { var tagList = [tag('tag1', 1, false), tag('tag2', 2, true), tag('tag3', 3, true)]; - $(document).trigger(Smail.events.ui.tagList.load, {tags: tagList}); + $(document).trigger(Pixelated.events.ui.tagList.load, {tags: tagList}); var items = _.map(this.component.select('defaultTagList').find('li'), function(el) { return $(el).attr('id'); @@ -40,7 +40,7 @@ describeComponent('tags/ui/tag_list', function () { it('should render the custom tags when tagsList:load is received and default attribute is false', function() { var tagList = [tag('tag1', 1, false), tag('tag2', 2, true), tag('tag3', 3, true)]; - $(document).trigger(Smail.events.ui.tagList.load, {tags: tagList}); + $(document).trigger(Pixelated.events.ui.tagList.load, {tags: tagList}); var items = _.map(this.component.select('customTagList').find('li'), function(el) { return $(el).attr('id'); @@ -51,23 +51,23 @@ describeComponent('tags/ui/tag_list', function () { it('should trigger event to tell that tags were loaded sending the current tag', function () { this.component.attr.currentTag = 'Drafts'; - var tagsLoadedEvent = spyOnEvent(document, Smail.events.ui.tags.loaded); + var tagsLoadedEvent = spyOnEvent(document, Pixelated.events.ui.tags.loaded); - $(document).trigger(Smail.events.ui.tagList.load, {tags: [] }); + $(document).trigger(Pixelated.events.ui.tagList.load, {tags: [] }); expect(tagsLoadedEvent).toHaveBeenTriggeredOnAndWith(document, { tag: 'Drafts'}); }); it('should send tag as undefined when tags are loaded and no tag was selected yet', function () { - var tagsLoadedEvent = spyOnEvent(document, Smail.events.ui.tags.loaded); + var tagsLoadedEvent = spyOnEvent(document, Pixelated.events.ui.tags.loaded); - $(document).trigger(Smail.events.ui.tagList.load, {tags: [] }); + $(document).trigger(Pixelated.events.ui.tagList.load, {tags: [] }); expect(tagsLoadedEvent).toHaveBeenTriggeredOnAndWith(document, { tag: undefined }); }); it('should save the current tag when a tag is selected', function () { - $(document).trigger(Smail.events.ui.tag.selected, { tag: 'amazing'}); + $(document).trigger(Pixelated.events.ui.tag.selected, { tag: 'amazing'}); expect(this.component.attr.currentTag).toEqual('amazing'); }); diff --git a/web-ui/test/spec/tags/ui/tag_shortcut.spec.js b/web-ui/test/spec/tags/ui/tag_shortcut.spec.js index 7df35631..5e464350 100644 --- a/web-ui/test/spec/tags/ui/tag_shortcut.spec.js +++ b/web-ui/test/spec/tags/ui/tag_shortcut.spec.js @@ -17,11 +17,11 @@ describeComponent("tags/ui/tag_shortcut", function () { }); it('selects and unselect on tag.select', function () { - $(document).trigger(Smail.events.ui.tag.select, { tag: 'inbox'}); + $(document).trigger(Pixelated.events.ui.tag.select, { tag: 'inbox'}); expect(shortcut.$node).toHaveClass("selected"); - $(document).trigger(Smail.events.ui.tag.select, { tag: 'sent'}); + $(document).trigger(Pixelated.events.ui.tag.select, { tag: 'sent'}); expect(shortcut.$node).not.toHaveClass("selected"); }); |