diff options
Diffstat (limited to 'web-ui')
47 files changed, 364 insertions, 364 deletions
diff --git a/web-ui/Gruntfile.js b/web-ui/Gruntfile.js index 082d55e1..1ab0f80c 100644 --- a/web-ui/Gruntfile.js +++ b/web-ui/Gruntfile.js @@ -320,7 +320,7 @@ module.exports = function (grunt) { handlebars: { dist: { options: { - namespace: 'Smail' + namespace: 'Pixelated' }, files: { '<%= yeoman.dist %>/js/templates.js': '<%= yeoman.app %>/templates/**/*.hbs' @@ -328,7 +328,7 @@ module.exports = function (grunt) { }, dev: { options: { - namespace: 'Smail' + namespace: 'Pixelated' }, files: { '<%= yeoman.app %>/js/generated/hbs/templates.js': '<%= yeoman.app %>/templates/**/*.hbs' diff --git a/web-ui/app/js/dispatchers/right_pane_dispatcher.js b/web-ui/app/js/dispatchers/right_pane_dispatcher.js index 3e62e581..834fc795 100644 --- a/web-ui/app/js/dispatchers/right_pane_dispatcher.js +++ b/web-ui/app/js/dispatchers/right_pane_dispatcher.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ define( [ diff --git a/web-ui/app/js/mail_view/ui/forward_box.js b/web-ui/app/js/mail_view/ui/forward_box.js index e112b43d..befd7a32 100644 --- a/web-ui/app/js/mail_view/ui/forward_box.js +++ b/web-ui/app/js/mail_view/ui/forward_box.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ /*global _ */ define( diff --git a/web-ui/app/js/mail_view/ui/mail_actions.js b/web-ui/app/js/mail_view/ui/mail_actions.js index dc16ea9f..653b5c26 100644 --- a/web-ui/app/js/mail_view/ui/mail_actions.js +++ b/web-ui/app/js/mail_view/ui/mail_actions.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ /*global _ */ define( diff --git a/web-ui/app/js/mail_view/ui/mail_view.js b/web-ui/app/js/mail_view/ui/mail_view.js index 33eb71d9..149a7f13 100644 --- a/web-ui/app/js/mail_view/ui/mail_view.js +++ b/web-ui/app/js/mail_view/ui/mail_view.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ /*global _ */ /*global Bloodhound */ diff --git a/web-ui/app/js/mail_view/ui/reply_box.js b/web-ui/app/js/mail_view/ui/reply_box.js index 2c39d8d6..a358fc98 100644 --- a/web-ui/app/js/mail_view/ui/reply_box.js +++ b/web-ui/app/js/mail_view/ui/reply_box.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ /*global _ */ define( diff --git a/web-ui/app/js/main.js b/web-ui/app/js/main.js index 665416fc..04c58859 100644 --- a/web-ui/app/js/main.js +++ b/web-ui/app/js/main.js @@ -46,8 +46,8 @@ require( ], function(compose, registry, advice, withLogging, debug, events, initializeDefault, _monkeyPatched) { - window.Smail = window.Smail || {}; - window.Smail.events = events; + window.Pixelated = window.Pixelated || {}; + window.Pixelated.events = events; compose.mixin(registry, [advice.withAdvice, withLogging]); diff --git a/web-ui/app/js/mixins/with_enable_disable_on_event.js b/web-ui/app/js/mixins/with_enable_disable_on_event.js index fa574a97..ca8f1a4c 100644 --- a/web-ui/app/js/mixins/with_enable_disable_on_event.js +++ b/web-ui/app/js/mixins/with_enable_disable_on_event.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ /*global _ */ define([], diff --git a/web-ui/app/js/search/results_highlighter.js b/web-ui/app/js/search/results_highlighter.js index c40f917b..79651ef4 100644 --- a/web-ui/app/js/search/results_highlighter.js +++ b/web-ui/app/js/search/results_highlighter.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ /*global _ */ define( diff --git a/web-ui/app/js/search/search_trigger.js b/web-ui/app/js/search/search_trigger.js index 4f8a7a5e..b7db97d0 100644 --- a/web-ui/app/js/search/search_trigger.js +++ b/web-ui/app/js/search/search_trigger.js @@ -1,5 +1,5 @@ /*global _ */ -/*global Smail */ +/*global Pixelated */ define( [ diff --git a/web-ui/app/js/services/mail_service.js b/web-ui/app/js/services/mail_service.js index b23d569a..dab72c6f 100644 --- a/web-ui/app/js/services/mail_service.js +++ b/web-ui/app/js/services/mail_service.js @@ -1,5 +1,5 @@ /*global _ */ -/*global Smail */ +/*global Pixelated */ define( [ diff --git a/web-ui/app/js/views/templates.js b/web-ui/app/js/views/templates.js index cc120093..a59c3a5a 100644 --- a/web-ui/app/js/views/templates.js +++ b/web-ui/app/js/views/templates.js @@ -5,37 +5,37 @@ define(['hbs/templates'], function (templates) { var Templates = { compose: { - box: window.Smail['app/templates/compose/compose_box.hbs'], - inlineBox: window.Smail['app/templates/compose/inline_box.hbs'], - replySection: window.Smail['app/templates/compose/reply_section.hbs'], - recipientInput: window.Smail['app/templates/compose/recipient_input.hbs'], - fixedRecipient: window.Smail['app/templates/compose/fixed_recipient.hbs'], - recipients: window.Smail['app/templates/compose/recipients.hbs'] + box: window.Pixelated['app/templates/compose/compose_box.hbs'], + inlineBox: window.Pixelated['app/templates/compose/inline_box.hbs'], + replySection: window.Pixelated['app/templates/compose/reply_section.hbs'], + recipientInput: window.Pixelated['app/templates/compose/recipient_input.hbs'], + fixedRecipient: window.Pixelated['app/templates/compose/fixed_recipient.hbs'], + recipients: window.Pixelated['app/templates/compose/recipients.hbs'] }, tags: { - tagList: window.Smail['app/templates/tags/tag_list.hbs'], - tag: window.Smail['app/templates/tags/tag.hbs'], - tagInner: window.Smail['app/templates/tags/tag_inner.hbs'], - shortcut: window.Smail['app/templates/tags/shortcut.hbs'] + tagList: window.Pixelated['app/templates/tags/tag_list.hbs'], + tag: window.Pixelated['app/templates/tags/tag.hbs'], + tagInner: window.Pixelated['app/templates/tags/tag_inner.hbs'], + shortcut: window.Pixelated['app/templates/tags/shortcut.hbs'] }, userAlerts: { - message: window.Smail['app/templates/user_alerts/message.hbs'] + message: window.Pixelated['app/templates/user_alerts/message.hbs'] }, mails: { - single: window.Smail['app/templates/mails/single.hbs'], - fullView: window.Smail['app/templates/mails/full_view.hbs'], - mailActions: window.Smail['app/templates/mails/mail_actions.hbs'], - sent: window.Smail['app/templates/mails/sent.hbs'] + single: window.Pixelated['app/templates/mails/single.hbs'], + fullView: window.Pixelated['app/templates/mails/full_view.hbs'], + mailActions: window.Pixelated['app/templates/mails/mail_actions.hbs'], + sent: window.Pixelated['app/templates/mails/sent.hbs'] }, mailActions: { - actionsBox: window.Smail['app/templates/mail_actions/actions_box.hbs'], - composeTrigger: window.Smail['app/templates/mail_actions/compose_trigger.hbs'], - refreshTrigger: window.Smail['app/templates/mail_actions/refresh_trigger.hbs'], - paginationTrigger: window.Smail['app/templates/mail_actions/pagination_trigger.hbs'] + actionsBox: window.Pixelated['app/templates/mail_actions/actions_box.hbs'], + composeTrigger: window.Pixelated['app/templates/mail_actions/compose_trigger.hbs'], + refreshTrigger: window.Pixelated['app/templates/mail_actions/refresh_trigger.hbs'], + paginationTrigger: window.Pixelated['app/templates/mail_actions/pagination_trigger.hbs'] }, - noMessageSelected: window.Smail['app/templates/no_message_selected.hbs'], + noMessageSelected: window.Pixelated['app/templates/no_message_selected.hbs'], search: { - trigger: window.Smail['app/templates/search/search_trigger.hbs'] + trigger: window.Pixelated['app/templates/search/search_trigger.hbs'] } }; diff --git a/web-ui/test/spec/dispatchers/left_pane_dispatcher.spec.js b/web-ui/test/spec/dispatchers/left_pane_dispatcher.spec.js index fb5b169a..86b54a48 100644 --- a/web-ui/test/spec/dispatchers/left_pane_dispatcher.spec.js +++ b/web-ui/test/spec/dispatchers/left_pane_dispatcher.spec.js @@ -1,11 +1,11 @@ -/*global Smail */ +/*global Pixelated */ describeComponent('dispatchers/left_pane_dispatcher', function () { 'use strict'; describe('initialize', function () { it('asks for tags', function () { - var tagWantEvent = spyOnEvent(document, Smail.events.tags.want); + var tagWantEvent = spyOnEvent(document, Pixelated.events.tags.want); setupComponent(); @@ -20,58 +20,58 @@ describeComponent('dispatchers/left_pane_dispatcher', function () { }); it('pushes the url state when a tag is selected but not for the first tag', function () { - var pushStateEvent = spyOnEvent(document, Smail.events.router.pushState); + var pushStateEvent = spyOnEvent(document, Pixelated.events.router.pushState); - $(document).trigger(Smail.events.ui.tag.selected, { tag: 'Drafts'}); - $(document).trigger(Smail.events.ui.tag.selected, { tag: 'inbox'}); + $(document).trigger(Pixelated.events.ui.tag.selected, { tag: 'Drafts'}); + $(document).trigger(Pixelated.events.ui.tag.selected, { tag: 'inbox'}); expect(pushStateEvent).toHaveBeenTriggeredOn(document, { tag: 'inbox'}); }); it('fetches mails by tag when a tag is selected', function () { - var fetchByTagEvent = spyOnEvent(document, Smail.events.ui.mails.fetchByTag); + var fetchByTagEvent = spyOnEvent(document, Pixelated.events.ui.mails.fetchByTag); - $(document).trigger(Smail.events.ui.tag.selected, { tag: 'Drafts'}); + $(document).trigger(Pixelated.events.ui.tag.selected, { tag: 'Drafts'}); expect(fetchByTagEvent).toHaveBeenTriggeredOn(document, { tag: 'Drafts'}); }); it('doesnt fetch mails by tag when skipMailListRefresh is sent on tag.selected', function () { - var fetchByTagEvent = spyOnEvent(document, Smail.events.ui.mails.fetchByTag); + var fetchByTagEvent = spyOnEvent(document, Pixelated.events.ui.mails.fetchByTag); - $(document).trigger(Smail.events.ui.tag.selected, { tag: 'Drafts', skipMailListRefresh: true}); + $(document).trigger(Pixelated.events.ui.tag.selected, { tag: 'Drafts', skipMailListRefresh: true}); expect(fetchByTagEvent).not.toHaveBeenTriggeredOn(document, { tag: 'Drafts'}); }); it('asks for more tags when refreshTagList is fired', function () { - var tagWantEvent = spyOnEvent(document, Smail.events.tags.want); + var tagWantEvent = spyOnEvent(document, Pixelated.events.tags.want); - $(document).trigger(Smail.events.dispatchers.tags.refreshTagList); + $(document).trigger(Pixelated.events.dispatchers.tags.refreshTagList); expect(tagWantEvent).toHaveBeenTriggeredOn(document); }); it('fires tagLoad when the tags are received', function () { - var tagListLoadEvent = spyOnEvent(document, Smail.events.ui.tagList.load); + var tagListLoadEvent = spyOnEvent(document, Pixelated.events.ui.tagList.load); - this.$node.trigger(Smail.events.tags.received, { tags: ['tags']}); + this.$node.trigger(Pixelated.events.tags.received, { tags: ['tags']}); expect(tagListLoadEvent).toHaveBeenTriggeredOn(document, { tags: ['tags']}); }); it('on tags loaded selects the inbox tag if no data is provided', function () { - var selectTagEvent = spyOnEvent(document, Smail.events.ui.tag.select); + var selectTagEvent = spyOnEvent(document, Pixelated.events.ui.tag.select); - $(document).trigger(Smail.events.ui.tags.loaded); + $(document).trigger(Pixelated.events.ui.tags.loaded); expect(selectTagEvent).toHaveBeenTriggeredOnAndWith(document, { tag: 'inbox' }); }); it('on tags loaded selects the a different tag if tag is provided', function () { - var selectTagEvent = spyOnEvent(document, Smail.events.ui.tag.select); + var selectTagEvent = spyOnEvent(document, Pixelated.events.ui.tag.select); - $(document).trigger(Smail.events.ui.tags.loaded, { tag: 'Drafts' }); + $(document).trigger(Pixelated.events.ui.tags.loaded, { tag: 'Drafts' }); expect(selectTagEvent).toHaveBeenTriggeredOnAndWith(document, { tag: 'Drafts' }); }); diff --git a/web-ui/test/spec/dispatchers/middle_pane_dispatchers.spec.js b/web-ui/test/spec/dispatchers/middle_pane_dispatchers.spec.js index 2dd0de2e..f35218d0 100644 --- a/web-ui/test/spec/dispatchers/middle_pane_dispatchers.spec.js +++ b/web-ui/test/spec/dispatchers/middle_pane_dispatchers.spec.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ describeComponent('dispatchers/middle_pane_dispatcher', function () { 'use strict'; @@ -8,20 +8,20 @@ describeComponent('dispatchers/middle_pane_dispatcher', function () { }); it ('listens to refresh mail list event', function() { - var mailsListRefreshEventSpy = spyOnEvent(document, Smail.events.ui.mails.fetchByTag); - this.component.trigger(document, Smail.events.dispatchers.middlePane.refreshMailList); + var mailsListRefreshEventSpy = spyOnEvent(document, Pixelated.events.ui.mails.fetchByTag); + this.component.trigger(document, Pixelated.events.dispatchers.middlePane.refreshMailList); expect(mailsListRefreshEventSpy).toHaveBeenTriggeredOn(document); }); it ('listens to unselect event', function() { - var mailListUnselectEvent = spyOnEvent(document, Smail.events.ui.mails.cleanSelected); - this.component.trigger(document, Smail.events.dispatchers.middlePane.cleanSelected); + var mailListUnselectEvent = spyOnEvent(document, Pixelated.events.ui.mails.cleanSelected); + this.component.trigger(document, Pixelated.events.dispatchers.middlePane.cleanSelected); expect(mailListUnselectEvent).toHaveBeenTriggeredOn(document); }); it('resets the scrollTop value when asked to', function() { this.component.select('middlePane').scrollTop(200); - this.component.trigger(document, Smail.events.dispatchers.middlePane.resetScroll); + this.component.trigger(document, Pixelated.events.dispatchers.middlePane.resetScroll); expect(this.component.select('middlePane').scrollTop()).toEqual(0); }); }); diff --git a/web-ui/test/spec/dispatchers/right_pane_dispatcher.spec.js b/web-ui/test/spec/dispatchers/right_pane_dispatcher.spec.js index 5fc7ecd7..79802eee 100644 --- a/web-ui/test/spec/dispatchers/right_pane_dispatcher.spec.js +++ b/web-ui/test/spec/dispatchers/right_pane_dispatcher.spec.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ describeComponent('dispatchers/right_pane_dispatcher', function () { 'use strict'; @@ -12,7 +12,7 @@ describeComponent('dispatchers/right_pane_dispatcher', function () { var composeBox = require('mail_view/ui/compose_box'); spyOn(composeBox, 'attachTo'); - this.component.trigger(document, Smail.events.dispatchers.rightPane.openComposeBox); + this.component.trigger(document, Pixelated.events.dispatchers.rightPane.openComposeBox); expect(composeBox.attachTo).toHaveBeenCalled(); }); @@ -25,32 +25,32 @@ describeComponent('dispatchers/right_pane_dispatcher', function () { }); it('listen to open no message selected event and creates a no-message-selected-pane', function () { - this.component.trigger(document, Smail.events.dispatchers.rightPane.openNoMessageSelected); + this.component.trigger(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelected); expect(noMessageSelectedPane.attachTo).toHaveBeenCalled(); }); it('sends an dispatchers.middlePane.unselect event', function () { - var unselectEvent = spyOnEvent(document, Smail.events.dispatchers.middlePane.cleanSelected); - this.component.trigger(document, Smail.events.dispatchers.rightPane.openNoMessageSelected); + var unselectEvent = spyOnEvent(document, Pixelated.events.dispatchers.middlePane.cleanSelected); + this.component.trigger(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelected); expect(unselectEvent).toHaveBeenTriggeredOn(document); }); it('pushes the current state with the current tag', function () { - var pushStateEvent = spyOnEvent(document, Smail.events.router.pushState); + var pushStateEvent = spyOnEvent(document, Pixelated.events.router.pushState); this.component.attr.currentTag = 'sometag'; - this.component.trigger(document, Smail.events.dispatchers.rightPane.openNoMessageSelected); + this.component.trigger(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelected); expect(pushStateEvent).toHaveBeenTriggeredOnAndWith(document, jasmine.objectContaining({tag: this.component.attr.currentTag })); }); it('pushes the current state stating that it meant to close the right pane', function () { - var pushStateEvent = spyOnEvent(document, Smail.events.router.pushState); + var pushStateEvent = spyOnEvent(document, Pixelated.events.router.pushState); this.component.attr.currentTag = 'sometag'; - this.component.trigger(document, Smail.events.dispatchers.rightPane.openNoMessageSelected); + this.component.trigger(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelected); expect(pushStateEvent).toHaveBeenTriggeredOnAndWith(document, jasmine.objectContaining({ isDisplayNoMessageSelected: true })); }); @@ -62,7 +62,7 @@ describeComponent('dispatchers/right_pane_dispatcher', function () { var draftBox = require('mail_view/ui/draft_box'); spyOn(draftBox, 'attachTo'); - this.component.trigger(document, Smail.events.dispatchers.rightPane.openDraft, { ident: '1' }); + this.component.trigger(document, Pixelated.events.dispatchers.rightPane.openDraft, { ident: '1' }); expect(draftBox.attachTo).toHaveBeenCalled(); }); @@ -77,7 +77,7 @@ describeComponent('dispatchers/right_pane_dispatcher', function () { }); it('opens the no message selected pane but doesnt push the state', function () { - var pushStateEvent = spyOnEvent(document, Smail.events.router.pushState); + var pushStateEvent = spyOnEvent(document, Pixelated.events.router.pushState); setupComponent(); diff --git a/web-ui/test/spec/helpers/view_helper.spec.js b/web-ui/test/spec/helpers/view_helper.spec.js index 1bcf68dd..1dedca44 100644 --- a/web-ui/test/spec/helpers/view_helper.spec.js +++ b/web-ui/test/spec/helpers/view_helper.spec.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ define(['helpers/view_helper'], function (viewHelper) { 'use strict'; @@ -6,7 +6,7 @@ define(['helpers/view_helper'], function (viewHelper) { var testData; describe('view helper', function() { beforeEach(function () { - testData = Smail.testData(); + testData = Pixelated.testData(); }); describe('quote email', function() { diff --git a/web-ui/test/spec/mail_list/ui/mail_items/generic_mail_item.spec.js b/web-ui/test/spec/mail_list/ui/mail_items/generic_mail_item.spec.js index b49bc7f0..6c49c1cf 100644 --- a/web-ui/test/spec/mail_list/ui/mail_items/generic_mail_item.spec.js +++ b/web-ui/test/spec/mail_list/ui/mail_items/generic_mail_item.spec.js @@ -4,7 +4,7 @@ describeComponent('mail_list/ui/mail_items/generic_mail_item', function () { var mail; beforeEach(function () { - mail = Smail.testData().parsedMail.simpleTextPlain; + mail = Pixelated.testData().parsedMail.simpleTextPlain; mail.tags = ['inbox']; setupComponent('<li></li>', { @@ -15,7 +15,7 @@ describeComponent('mail_list/ui/mail_items/generic_mail_item', function () { }); it('should trigger ui:openMail on click', function () { - var spyEvent = spyOnEvent(document, Smail.events.ui.mail.open); + var spyEvent = spyOnEvent(document, Pixelated.events.ui.mail.open); this.component.$node.find('a').click(); @@ -30,7 +30,7 @@ describeComponent('mail_list/ui/mail_items/generic_mail_item', function () { }); it('should remove selected class when selecting a different mail', function () { - $(document).trigger(Smail.events.ui.mail.updateSelected, { ident: 2 }); + $(document).trigger(Pixelated.events.ui.mail.updateSelected, { ident: 2 }); expect(this.$node).not.toHaveClass('selected'); }); @@ -38,7 +38,7 @@ describeComponent('mail_list/ui/mail_items/generic_mail_item', function () { it('should remove selected class when enabling compose box', function () { this.$node.find('a').click(); - $(document).trigger(Smail.events.ui.composeBox.newMessage); + $(document).trigger(Pixelated.events.ui.composeBox.newMessage); expect(this.$node).not.toHaveClass('selected'); }); @@ -58,8 +58,8 @@ describeComponent('mail_list/ui/mail_items/generic_mail_item', function () { it('triggers mail open and pushes the state', function () { var clickEvent = createClickEvent(); - var mailOpenEvent = spyOnEvent(document, Smail.events.ui.mail.open); - var pushStateEvent = spyOnEvent(document, Smail.events.router.pushState); + var mailOpenEvent = spyOnEvent(document, Pixelated.events.ui.mail.open); + var pushStateEvent = spyOnEvent(document, Pixelated.events.router.pushState); $(this.$node.find('a')).trigger(clickEvent); @@ -77,8 +77,8 @@ describeComponent('mail_list/ui/mail_items/generic_mail_item', function () { ], function (specialKey) { it('doesnt trigger mail open and nor pushes the state', function () { var clickEvent = createClickEvent(specialKey); - var mailOpenEvent = spyOnEvent(document, Smail.events.ui.mail.open); - var pushStateEvent = spyOnEvent(document, Smail.events.router.pushState); + var mailOpenEvent = spyOnEvent(document, Pixelated.events.ui.mail.open); + var pushStateEvent = spyOnEvent(document, Pixelated.events.router.pushState); $(this.$node.find('a')).trigger(clickEvent); @@ -89,7 +89,7 @@ describeComponent('mail_list/ui/mail_items/generic_mail_item', function () { it('marks the email as read', function () { debugger; - var mailReadEvent = spyOnEvent(document, Smail.events.mail.read); + var mailReadEvent = spyOnEvent(document, Pixelated.events.mail.read); var clickEvent = createClickEvent(specialKey); $(this.$node.find('a')).trigger(clickEvent); @@ -107,7 +107,7 @@ describeComponent('mail_list/ui/mail_items/generic_mail_item', function () { describe('marking emails as read', function () { it('should trigger mail:read event when unread is clicked', function () { - var mailReadEvent = spyOnEvent(document, Smail.events.mail.read); + var mailReadEvent = spyOnEvent(document, Pixelated.events.mail.read); this.$node.find('a').click(); @@ -115,7 +115,7 @@ describeComponent('mail_list/ui/mail_items/generic_mail_item', function () { }); it('should not trigger mail:read event when clicking mail that is already read', function () { - var mailReadEvent = spyOnEvent(document, Smail.events.mail.read); + var mailReadEvent = spyOnEvent(document, Pixelated.events.mail.read); this.component.attr.mail.status.push(this.component.status.READ); this.$node.find('a').click(); diff --git a/web-ui/test/spec/mail_list/ui/mail_items/mail_item.spec.js b/web-ui/test/spec/mail_list/ui/mail_items/mail_item.spec.js index 1b5899a1..8b0712c5 100644 --- a/web-ui/test/spec/mail_list/ui/mail_items/mail_item.spec.js +++ b/web-ui/test/spec/mail_list/ui/mail_items/mail_item.spec.js @@ -1,10 +1,10 @@ -/*global Smail */ +/*global Pixelated */ describeMixin('mail_list/ui/mail_items/mail_item', function () { 'use strict'; beforeEach(function () { - var mail = Smail.testData().parsedMail.simpleTextPlain; + var mail = Pixelated.testData().parsedMail.simpleTextPlain; mail.tags = ['inbox']; setupComponent('<li><input type="checkbox"></input></li>', { @@ -17,8 +17,8 @@ describeMixin('mail_list/ui/mail_items/mail_item', function () { describe('mail checkbox', function () { var mailCheckedEvent, mailUncheckedEvent, checkbox; beforeEach(function () { - mailCheckedEvent = spyOnEvent(document, Smail.events.ui.mail.checked); - mailUncheckedEvent = spyOnEvent(document, Smail.events.ui.mail.unchecked); + mailCheckedEvent = spyOnEvent(document, Pixelated.events.ui.mail.checked); + mailUncheckedEvent = spyOnEvent(document, Pixelated.events.ui.mail.unchecked); checkbox = this.component.$node.find('input[type=checkbox]'); }); diff --git a/web-ui/test/spec/mail_list/ui/mail_list.spec.js b/web-ui/test/spec/mail_list/ui/mail_list.spec.js index f383d540..11993ba1 100644 --- a/web-ui/test/spec/mail_list/ui/mail_list.spec.js +++ b/web-ui/test/spec/mail_list/ui/mail_list.spec.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ describeComponent('mail_list/ui/mail_list', function () { 'use strict'; @@ -30,12 +30,12 @@ describeComponent('mail_list/ui/mail_list', function () { return '10'; } }; - var openMailEvent = spyOnEvent(document, Smail.events.ui.mail.open); + var openMailEvent = spyOnEvent(document, Pixelated.events.ui.mail.open); - this.$node.trigger(Smail.events.mails.available, { mails: mailList }); + this.$node.trigger(Pixelated.events.mails.available, { mails: mailList }); expect(openMailEvent).toHaveBeenTriggeredOnAndWith(document, { ident: '10' }); - this.$node.trigger(Smail.events.mails.available, { mails: mailList }); + this.$node.trigger(Pixelated.events.mails.available, { mails: mailList }); expect(openMailEvent.calls.length).toEqual(1); }); @@ -48,10 +48,10 @@ describeComponent('mail_list/ui/mail_list', function () { return '10'; } }; - var pushState = spyOnEvent(document, Smail.events.router.pushState); + var pushState = spyOnEvent(document, Pixelated.events.router.pushState); this.component.attr.currentTag = 'inbox'; - this.$node.trigger(Smail.events.mails.available, { mails: mailList }); + this.$node.trigger(Pixelated.events.mails.available, { mails: mailList }); expect(pushState).toHaveBeenTriggeredOnAndWith(document, { tag: 'inbox', mailIdent: '10' }); }); @@ -63,7 +63,7 @@ describeComponent('mail_list/ui/mail_list', function () { this.component.attr.checkedMails = {}; - $(document).trigger(Smail.events.ui.mail.checked, {mail: mailList[0]}); + $(document).trigger(Pixelated.events.ui.mail.checked, {mail: mailList[0]}); checkedMails[mailList[0].ident] = mailList[0]; @@ -73,18 +73,18 @@ describeComponent('mail_list/ui/mail_list', function () { it('returns the list of checked mails to whomever requests them', function () { var caller = {}; this.component.attr.checkedMails = {'1': {}}; - var mailHereCheckedEvent = spyOnEvent(caller, Smail.events.ui.mail.hereChecked); + var mailHereCheckedEvent = spyOnEvent(caller, Pixelated.events.ui.mail.hereChecked); - $(document).trigger(Smail.events.ui.mail.wantChecked, caller); + $(document).trigger(Pixelated.events.ui.mail.wantChecked, caller); expect(mailHereCheckedEvent).toHaveBeenTriggeredOnAndWith(caller, { checkedMails: {'1': {} }}); }); it('returns an empty list to whomever requests the checked mails if there are no checked mails', function () { var caller = {}; - var mailHereCheckedEvent = spyOnEvent(caller, Smail.events.ui.mail.hereChecked); + var mailHereCheckedEvent = spyOnEvent(caller, Pixelated.events.ui.mail.hereChecked); - $(document).trigger(Smail.events.ui.mail.wantChecked, caller); + $(document).trigger(Pixelated.events.ui.mail.wantChecked, caller); expect(mailHereCheckedEvent).toHaveBeenTriggeredOnAndWith(caller, { checkedMails: {} }); }); @@ -96,15 +96,15 @@ describeComponent('mail_list/ui/mail_list', function () { '3': {} }; - $(document).trigger(Smail.events.ui.mail.unchecked, {mail: {ident: '1'}}); + $(document).trigger(Pixelated.events.ui.mail.unchecked, {mail: {ident: '1'}}); expect(this.component.attr.checkedMails).toEqual({'2': {}, '3': {} }); }); it('checks the check all checkbox if at least one mail is checked', function () { - var setCheckAllCheckboxEvent = spyOnEvent(document, Smail.events.ui.mails.hasMailsChecked); + var setCheckAllCheckboxEvent = spyOnEvent(document, Pixelated.events.ui.mails.hasMailsChecked); - $(document).trigger(Smail.events.ui.mail.checked, {mail: mailList[0]}); + $(document).trigger(Pixelated.events.ui.mail.checked, {mail: mailList[0]}); expect(setCheckAllCheckboxEvent).toHaveBeenTriggeredOnAndWith(document, true); }); @@ -112,9 +112,9 @@ describeComponent('mail_list/ui/mail_list', function () { it('unchecks the check all checkbox if no mail is left checked', function () { this.component.attr.checkedMails = {1: {}}; - var setCheckAllCheckboxEvent = spyOnEvent(document, Smail.events.ui.mails.hasMailsChecked); + var setCheckAllCheckboxEvent = spyOnEvent(document, Pixelated.events.ui.mails.hasMailsChecked); - $(document).trigger(Smail.events.ui.mail.unchecked, {mail: {ident: '1'}}); + $(document).trigger(Pixelated.events.ui.mail.unchecked, {mail: {ident: '1'}}); expect(setCheckAllCheckboxEvent).toHaveBeenTriggeredOnAndWith(document, false); }); @@ -122,35 +122,35 @@ describeComponent('mail_list/ui/mail_list', function () { describe('when mails are available', function () { it('should open email if popstate event happened (when mailIdent isnt undefined)', function () { - var openMailEvent = spyOnEvent(document, Smail.events.ui.mail.open); + var openMailEvent = spyOnEvent(document, Pixelated.events.ui.mail.open); - this.component.$node.trigger(Smail.events.mails.available, { mails: mailList, mailIdent: '30' }); + this.component.$node.trigger(Pixelated.events.mails.available, { mails: mailList, mailIdent: '30' }); expect(openMailEvent).toHaveBeenTriggeredOnAndWith(document, { ident: '30'}); }); it('should open draft in popstate event if tag is Drafts', function () { - var openDraftEvent = spyOnEvent(document, Smail.events.dispatchers.rightPane.openDraft); + var openDraftEvent = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openDraft); - this.component.$node.trigger(Smail.events.mails.available, { mails: mailList, mailIdent: '30', tag: 'drafts' }); + this.component.$node.trigger(Pixelated.events.mails.available, { mails: mailList, mailIdent: '30', tag: 'drafts' }); expect(openDraftEvent).toHaveBeenTriggeredOnAndWith(document, { ident: '30'}); }); }); it('should not append emails when another mails:available event is triggered', function () { - this.component.$node.trigger(Smail.events.mails.available, { mails: mailList }); + this.component.$node.trigger(Pixelated.events.mails.available, { mails: mailList }); expect(this.component.$node.find('a').length).toEqual(2); - this.component.$node.trigger(Smail.events.mails.available, { mails: mailList }); + this.component.$node.trigger(Pixelated.events.mails.available, { mails: mailList }); expect(this.component.$node.find('a').length).toEqual(2); }); it('resets scroll when opening a new tag or choosing a new tag', function () { - var eventSpy = spyOnEvent(document, Smail.events.dispatchers.middlePane.resetScroll); - this.component.$node.trigger(Smail.events.mails.available, { mails: mailList }); + var eventSpy = spyOnEvent(document, Pixelated.events.dispatchers.middlePane.resetScroll); + this.component.$node.trigger(Pixelated.events.mails.available, { mails: mailList }); expect(eventSpy).toHaveBeenTriggeredOn(document); }); @@ -158,7 +158,7 @@ describeComponent('mail_list/ui/mail_list', function () { describe('when mails are available for refreshing', function () { it('renders the new mails', function () { - this.component.$node.trigger(Smail.events.mails.availableForRefresh, { mails: mailList }); + this.component.$node.trigger(Pixelated.events.mails.availableForRefresh, { mails: mailList }); matchMail(mailList[0], this.component.$node); matchMail(mailList[1], this.component.$node); @@ -167,7 +167,7 @@ describeComponent('mail_list/ui/mail_list', function () { }); it('should render all mails sent in ui:mails:show event', function () { - this.component.$node.trigger(Smail.events.mails.available, { mails: mailList }); + this.component.$node.trigger(Pixelated.events.mails.available, { mails: mailList }); matchMail(mailList[0], this.component.$node); matchMail(mailList[1], this.component.$node); @@ -176,7 +176,7 @@ describeComponent('mail_list/ui/mail_list', function () { it('should select the current email when mails are available', function () { this.component.attr.currentMailIdent = '1'; - this.component.trigger(Smail.events.mails.available, { mails: mailList }); + this.component.trigger(Pixelated.events.mails.available, { mails: mailList }); matchSelectedMail(mailList[0], this.component.$node); matchMail(mailList[1], this.component.$node); @@ -187,14 +187,14 @@ describeComponent('mail_list/ui/mail_list', function () { mailIdent = mailList[0].ident; this.component.attr.checkedMails[mailIdent] = mailList[0]; - this.component.$node.trigger(Smail.events.mails.available, { mails: [mailList[0]] }); + this.component.$node.trigger(Pixelated.events.mails.available, { mails: [mailList[0]] }); checkbox = this.$node.find('input[type=checkbox]'); expect(checkbox.prop('checked')).toBe(true); }); it('should render links for the emails', function () { - this.component.$node.trigger(Smail.events.mails.available, { mails: mailList, tag: 'inbox' }); + this.component.$node.trigger(Pixelated.events.mails.available, { mails: mailList, tag: 'inbox' }); expect(this.$node.html()).toMatch('href="/#/inbox/mail/1'); expect(this.$node.html()).toMatch('href="/#/inbox/mail/2'); @@ -202,7 +202,7 @@ describeComponent('mail_list/ui/mail_list', function () { it('should clean the selected email', function () { this.component.attr.currentMailIdent = '1'; - this.component.trigger(Smail.events.ui.mails.cleanSelected); + this.component.trigger(Pixelated.events.ui.mails.cleanSelected); expect(this.component.attr.currentMailIdent).toEqual(''); }); @@ -222,18 +222,18 @@ describeComponent('mail_list/ui/mail_list', function () { describe('when saving a draft', function () { it('refreshes the list if the current tag is drafts', function () { this.component.attr.currentTag = 'drafts'; - var spyRefresh = spyOnEvent(document, Smail.events.ui.mails.refresh); - var spyScroll = spyOnEvent(document, Smail.events.dispatchers.middlePane.resetScroll); - this.component.trigger(Smail.events.mail.draftSaved, {ident: 1}); + var spyRefresh = spyOnEvent(document, Pixelated.events.ui.mails.refresh); + var spyScroll = spyOnEvent(document, Pixelated.events.dispatchers.middlePane.resetScroll); + this.component.trigger(Pixelated.events.mail.draftSaved, {ident: 1}); expect(spyRefresh).toHaveBeenTriggeredOn(document); expect(spyScroll).toHaveBeenTriggeredOn(document); }); it('does not refresh the list if the current tag is not drafts', function() { this.component.attr.currentTag = 'sent'; - var spyRefresh = spyOnEvent(document, Smail.events.ui.mails.refresh); - var spyScroll = spyOnEvent(document, Smail.events.dispatchers.middlePane.resetScroll); - this.component.trigger(Smail.events.mail.draftSaved, {ident: 1}); + var spyRefresh = spyOnEvent(document, Pixelated.events.ui.mails.refresh); + var spyScroll = spyOnEvent(document, Pixelated.events.dispatchers.middlePane.resetScroll); + this.component.trigger(Pixelated.events.mail.draftSaved, {ident: 1}); expect(spyRefresh).not.toHaveBeenTriggeredOn(document); expect(spyScroll).not.toHaveBeenTriggeredOn(document); }); @@ -242,25 +242,25 @@ describeComponent('mail_list/ui/mail_list', function () { describe('when sending a mail', function () { it('refreshes the list if the current tag is drafts', function () { this.component.attr.currentTag = 'drafts'; - var spyRefresh = spyOnEvent(document, Smail.events.ui.mails.refresh); - var spyScroll = spyOnEvent(document, Smail.events.dispatchers.middlePane.resetScroll); - this.component.trigger(Smail.events.mail.sent); + var spyRefresh = spyOnEvent(document, Pixelated.events.ui.mails.refresh); + var spyScroll = spyOnEvent(document, Pixelated.events.dispatchers.middlePane.resetScroll); + this.component.trigger(Pixelated.events.mail.sent); expect(spyRefresh).toHaveBeenTriggeredOn(document); expect(spyScroll).toHaveBeenTriggeredOn(document); }); it('refreshes the list if the current tag is sent', function() { this.component.attr.currentTag = 'sent'; - var spyRefresh = spyOnEvent(document, Smail.events.ui.mails.refresh); - var spyScroll = spyOnEvent(document, Smail.events.dispatchers.middlePane.resetScroll); - this.component.trigger(Smail.events.mail.sent); + var spyRefresh = spyOnEvent(document, Pixelated.events.ui.mails.refresh); + var spyScroll = spyOnEvent(document, Pixelated.events.dispatchers.middlePane.resetScroll); + this.component.trigger(Pixelated.events.mail.sent); expect(spyRefresh).toHaveBeenTriggeredOn(document); expect(spyScroll).toHaveBeenTriggeredOn(document); }); }); function createMail(subject, from, ident, date) { - var mail = Smail.testData().parsedMail.simpleTextPlain; + var mail = Pixelated.testData().parsedMail.simpleTextPlain; return _.merge(mail, { header: { diff --git a/web-ui/test/spec/mail_list_actions/ui/compose_trigger.spec.js b/web-ui/test/spec/mail_list_actions/ui/compose_trigger.spec.js index 4942b5b6..78104ce9 100644 --- a/web-ui/test/spec/mail_list_actions/ui/compose_trigger.spec.js +++ b/web-ui/test/spec/mail_list_actions/ui/compose_trigger.spec.js @@ -6,7 +6,7 @@ describeComponent('mail_list_actions/ui/compose_trigger', function () { }); it('triggers the enableComposebox event when clicked', function () { - var spyEvent = spyOnEvent(document, Smail.events.dispatchers.rightPane.openComposeBox); + var spyEvent = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openComposeBox); this.component.trigger('click'); diff --git a/web-ui/test/spec/mail_list_actions/ui/pagination_trigger.spec.js b/web-ui/test/spec/mail_list_actions/ui/pagination_trigger.spec.js index 67c2f3ef..bf47794a 100644 --- a/web-ui/test/spec/mail_list_actions/ui/pagination_trigger.spec.js +++ b/web-ui/test/spec/mail_list_actions/ui/pagination_trigger.spec.js @@ -6,20 +6,20 @@ describeComponent('mail_list_actions/ui/pagination_trigger', function () { }); it('triggers the ui:page:previous event when the left arrow is clicked', function () { - var eventSpy = spyOnEvent(document, Smail.events.ui.page.previous); + var eventSpy = spyOnEvent(document, Pixelated.events.ui.page.previous); this.component.select('previous').click(); expect(eventSpy).toHaveBeenTriggeredOn(document); }); it('triggers the ui:page:next event when the right arrow is clicked', function () { - var eventSpy = spyOnEvent(document, Smail.events.ui.page.next); + var eventSpy = spyOnEvent(document, Pixelated.events.ui.page.next); this.component.select('next').click(); expect(eventSpy).toHaveBeenTriggeredOn(document); }); it('re-renders with current page number when page changes', function () { - this.component.trigger(document, Smail.events.ui.page.changed, {currentPage: 0}); + this.component.trigger(document, Pixelated.events.ui.page.changed, {currentPage: 0}); expect(this.component.select('currentPage').text()).toBe('1'); }); diff --git a/web-ui/test/spec/mail_view/data/mail_sender.spec.js b/web-ui/test/spec/mail_view/data/mail_sender.spec.js index 3bdc1934..12b1be21 100644 --- a/web-ui/test/spec/mail_view/data/mail_sender.spec.js +++ b/web-ui/test/spec/mail_view/data/mail_sender.spec.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ describeComponent('mail_view/data/mail_sender', function () { 'use strict'; @@ -8,17 +8,17 @@ describeComponent('mail_view/data/mail_sender', function () { beforeEach(function () { mailBuilder = require('mail_view/data/mail_builder'); - mail = Smail.testData().parsedMail.simpleTextPlain; + mail = Pixelated.testData().parsedMail.simpleTextPlain; setupComponent(); }); it('sends mail data with a POST to the server when asked to send email', function() { - var mailSentEventSpy = spyOnEvent(document, Smail.events.mail.sent); + var mailSentEventSpy = spyOnEvent(document, Pixelated.events.mail.sent); var g; spyOn($, 'ajax').andReturn({done: function(f) { g = f; return {fail: function(){}};}}); - this.component.trigger(Smail.events.mail.send, mail); + this.component.trigger(Pixelated.events.mail.send, mail); g(); @@ -31,13 +31,13 @@ describeComponent('mail_view/data/mail_sender', function () { }); it('save draft data with a POST to the server when asked to save draft for the first time', function() { - var draftSavedEventSpy = spyOnEvent(document, Smail.events.mail.draftSaved); + var draftSavedEventSpy = spyOnEvent(document, Pixelated.events.mail.draftSaved); var g; spyOn($, 'ajax').andReturn({done: function(f) { g = f; return {fail: function(){}};}}); mail.ident = ''; - this.component.trigger(Smail.events.mail.saveDraft, mail); + this.component.trigger(Pixelated.events.mail.saveDraft, mail); g(); @@ -50,13 +50,13 @@ describeComponent('mail_view/data/mail_sender', function () { }); it('save draft data with a PUT to the server when asked to save draft for the second time', function() { - var draftSavedEventSpy = spyOnEvent(document, Smail.events.mail.draftSaved); + var draftSavedEventSpy = spyOnEvent(document, Pixelated.events.mail.draftSaved); var g; spyOn($, 'ajax').andReturn({done: function(f) { g = f; return {fail: function(){}};}}); mail.ident = 0; - this.component.trigger(Smail.events.mail.saveDraft, mail); + this.component.trigger(Pixelated.events.mail.saveDraft, mail); g(); diff --git a/web-ui/test/spec/mail_view/ui/compose_box.spec.js b/web-ui/test/spec/mail_view/ui/compose_box.spec.js index a131d2cf..f5abac42 100644 --- a/web-ui/test/spec/mail_view/ui/compose_box.spec.js +++ b/web-ui/test/spec/mail_view/ui/compose_box.spec.js @@ -1,10 +1,10 @@ /*global jasmine */ -/*global Smail */ +/*global Pixelated */ describeComponent('mail_view/ui/compose_box', function () { 'use strict'; beforeEach(function () { - Smail.mockBloodhound(); + Pixelated.mockBloodhound(); setupComponent('<div style="display:none"></div>'); }); @@ -12,21 +12,21 @@ describeComponent('mail_view/ui/compose_box', function () { describe('compose new mail', function() { it('only sends if all the recipients are valid emails', function() { - $(document).trigger(Smail.events.ui.recipients.updated, {recipientsName: 'to', newRecipients: ['valid@email.example']}); + $(document).trigger(Pixelated.events.ui.recipients.updated, {recipientsName: 'to', newRecipients: ['valid@email.example']}); - var eventSpy = spyOnEvent(document, Smail.events.mail.send); + var eventSpy = spyOnEvent(document, Pixelated.events.mail.send); - $(document).trigger(Smail.events.ui.mail.send); + $(document).trigger(Pixelated.events.ui.mail.send); expect(eventSpy).toHaveBeenTriggeredOn(document); }); it('sends the recipient entered', function () { - $(document).trigger(Smail.events.ui.recipients.updated, {recipientsName: 'to', newRecipients: ['fox@somewhere.com']}); + $(document).trigger(Pixelated.events.ui.recipients.updated, {recipientsName: 'to', newRecipients: ['fox@somewhere.com']}); - var eventSpy = spyOnEvent(document, Smail.events.mail.send); + var eventSpy = spyOnEvent(document, Pixelated.events.mail.send); - $(document).trigger(Smail.events.ui.mail.send); + $(document).trigger(Pixelated.events.ui.mail.send); expect(eventSpy).toHaveBeenTriggeredOn(document); expect(eventSpy.mostRecentCall.data.header).toEqual(jasmine.objectContaining({ @@ -35,10 +35,10 @@ describeComponent('mail_view/ui/compose_box', function () { }); it('sends the multiple recipients entered', function () { - $(document).trigger(Smail.events.ui.recipients.updated, {recipientsName: 'to', newRecipients: ['fox@somewhere.com', 'blarg@someone.com', 'fox2@google.se']}); - var eventSpy = spyOnEvent(document, Smail.events.mail.send); + $(document).trigger(Pixelated.events.ui.recipients.updated, {recipientsName: 'to', newRecipients: ['fox@somewhere.com', 'blarg@someone.com', 'fox2@google.se']}); + var eventSpy = spyOnEvent(document, Pixelated.events.mail.send); - $(document).trigger(Smail.events.ui.mail.send); + $(document).trigger(Pixelated.events.ui.mail.send); expect(eventSpy).toHaveBeenTriggeredOn(document); expect(eventSpy.mostRecentCall.data.header).toEqual(jasmine.objectContaining({ @@ -47,11 +47,11 @@ describeComponent('mail_view/ui/compose_box', function () { }); it('sends the subject line entered', function () { - $(document).trigger(Smail.events.ui.recipients.updated, {recipientsName: 'to', newRecipients: ['aa@aa.com']}); + $(document).trigger(Pixelated.events.ui.recipients.updated, {recipientsName: 'to', newRecipients: ['aa@aa.com']}); this.component.select('subjectBox').val('A new fancy subject!'); - var eventSpy = spyOnEvent(document, Smail.events.mail.send); + var eventSpy = spyOnEvent(document, Pixelated.events.mail.send); - $(document).trigger(Smail.events.ui.mail.send); + $(document).trigger(Pixelated.events.ui.mail.send); expect(eventSpy).toHaveBeenTriggeredOn(document); expect(eventSpy.mostRecentCall.data.header).toEqual(jasmine.objectContaining({ @@ -60,10 +60,10 @@ describeComponent('mail_view/ui/compose_box', function () { }); it('sends the multiple CCs entered', function () { - $(document).trigger(Smail.events.ui.recipients.updated, {recipientsName: 'cc', newRecipients: ['cc1@foo.bar', 'cc2@bar.foo', 'cc3@zz.top']}); - var eventSpy = spyOnEvent(document, Smail.events.mail.send); + $(document).trigger(Pixelated.events.ui.recipients.updated, {recipientsName: 'cc', newRecipients: ['cc1@foo.bar', 'cc2@bar.foo', 'cc3@zz.top']}); + var eventSpy = spyOnEvent(document, Pixelated.events.mail.send); - $(document).trigger(Smail.events.ui.mail.send); + $(document).trigger(Pixelated.events.ui.mail.send); expect(eventSpy).toHaveBeenTriggeredOn(document); expect(eventSpy.mostRecentCall.data.header).toEqual(jasmine.objectContaining({ @@ -72,10 +72,10 @@ describeComponent('mail_view/ui/compose_box', function () { }); it('sends the multiple BCCs entered', function () { - $(document).trigger(Smail.events.ui.recipients.updated, {recipientsName: 'bcc', newRecipients: ['bcc1@foo.bar', 'bcc2@bar.foo', 'bcc3@zz.top']}); - var eventSpy = spyOnEvent(document, Smail.events.mail.send); + $(document).trigger(Pixelated.events.ui.recipients.updated, {recipientsName: 'bcc', newRecipients: ['bcc1@foo.bar', 'bcc2@bar.foo', 'bcc3@zz.top']}); + var eventSpy = spyOnEvent(document, Pixelated.events.mail.send); - $(document).trigger(Smail.events.ui.mail.send); + $(document).trigger(Pixelated.events.ui.mail.send); expect(eventSpy).toHaveBeenTriggeredOn(document); expect(eventSpy.mostRecentCall.data.header).toEqual(jasmine.objectContaining({ @@ -84,21 +84,21 @@ describeComponent('mail_view/ui/compose_box', function () { }); it('shows no message selected pane when deleting the email being composed', function() { - var openNoMessageSelectedPaneEvent = spyOnEvent(document, Smail.events.dispatchers.rightPane.openNoMessageSelected); + var openNoMessageSelectedPaneEvent = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelected); var mails = [{ident: 123}]; this.component.attr.ident = 123; - this.component.trigger(document, Smail.events.mail.deleted, {mails: mails}); + this.component.trigger(document, Pixelated.events.mail.deleted, {mails: mails}); expect(openNoMessageSelectedPaneEvent).toHaveBeenTriggeredOn(document); }); it('does not show no message selected pane when deleting a different set of emails', function() { - var openNoMessageSelectedPaneEvent = spyOnEvent(document, Smail.events.dispatchers.rightPane.openNoMessageSelected); + var openNoMessageSelectedPaneEvent = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelected); var mails = [{ident: 321}]; this.component.attr.ident = 123; - this.component.trigger(document, Smail.events.mail.deleted, {mails: mails}); + this.component.trigger(document, Pixelated.events.mail.deleted, {mails: mails}); expect(openNoMessageSelectedPaneEvent).not.toHaveBeenTriggeredOn(document); }); @@ -107,7 +107,7 @@ describeComponent('mail_view/ui/compose_box', function () { describe('close button behavior', function() { it('should fire Show no message selected if the close button is clicked', function() { - var spy = spyOnEvent(document, Smail.events.dispatchers.rightPane.openNoMessageSelected); + var spy = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelected); this.component.select('closeButton').click(); expect(spy).toHaveBeenTriggeredOn(document); }); @@ -116,10 +116,10 @@ describeComponent('mail_view/ui/compose_box', function () { describe('draft compose box', function() { it('should save a draft when click on draft button', function () { - $(document).trigger(Smail.events.ui.recipients.updated, {recipientsName: 'to', newRecipients: ['fox@somewhere.com']}); + $(document).trigger(Pixelated.events.ui.recipients.updated, {recipientsName: 'to', newRecipients: ['fox@somewhere.com']}); this.component.select('subjectBox').val('A new fancy subject!'); - var eventSpy = spyOnEvent(document, Smail.events.mail.saveDraft); + var eventSpy = spyOnEvent(document, Pixelated.events.mail.saveDraft); this.component.select('draftButton').click(); diff --git a/web-ui/test/spec/mail_view/ui/draft_box.spec.js b/web-ui/test/spec/mail_view/ui/draft_box.spec.js index 3e02f752..9a93791d 100644 --- a/web-ui/test/spec/mail_view/ui/draft_box.spec.js +++ b/web-ui/test/spec/mail_view/ui/draft_box.spec.js @@ -1,4 +1,4 @@ -/* global Smail */ +/* global Pixelated */ describeComponent('mail_view/ui/draft_box', function () { 'use strict'; @@ -6,13 +6,13 @@ describeComponent('mail_view/ui/draft_box', function () { var mail; beforeEach(function () { - Smail.mockBloodhound(); - mail = Smail.testData().parsedMail.simpleTextPlain; + Pixelated.mockBloodhound(); + mail = Pixelated.testData().parsedMail.simpleTextPlain; }); describe('when initializing', function () { it('fetches the email to draft', function () { - var mailWantEvent = spyOnEvent(document, Smail.events.mail.want); + var mailWantEvent = spyOnEvent(document, Pixelated.events.mail.want); setupComponent({mailIdent: '1'}); @@ -32,7 +32,7 @@ describeComponent('mail_view/ui/draft_box', function () { spyOn(this.component, 'render'); - this.component.trigger(this.component, Smail.events.mail.here, { mail: mail}); + this.component.trigger(this.component, Pixelated.events.mail.here, { mail: mail}); expect(this.component.render).toHaveBeenCalledWith(templates.compose.box, { recipients: { to: mail.header.to, cc: mail.header.cc, bcc: mail.header.bcc }, @@ -45,21 +45,21 @@ describeComponent('mail_view/ui/draft_box', function () { it('sending a draft sends the correct mailIdent', function () { setupComponent({mailIdent: mail.ident}); - this.component.trigger(this.component, Smail.events.mail.here, { mail: mail}); + this.component.trigger(this.component, Pixelated.events.mail.here, { mail: mail}); - var sendDraftEvent = spyOnEvent(document, Smail.events.mail.saveDraft); + var sendDraftEvent = spyOnEvent(document, Pixelated.events.mail.saveDraft); this.component.select('draftButton').click(); expect(sendDraftEvent).toHaveBeenTriggeredOnAndWith(document, jasmine.objectContaining({ident: mail.ident})); }); it('shows no message selected pane when draft is sent', function() { - var openNoMessageSelectedEvent = spyOnEvent(document, Smail.events.dispatchers.rightPane.openNoMessageSelected); + var openNoMessageSelectedEvent = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelected); setupComponent({mailIdent: mail.ident}); - this.component.trigger(this.component, Smail.events.mail.here, { mail: mail}); + this.component.trigger(this.component, Pixelated.events.mail.here, { mail: mail}); - this.component.trigger(document, Smail.events.mail.sent); + this.component.trigger(document, Pixelated.events.mail.sent); expect(openNoMessageSelectedEvent).toHaveBeenTriggeredOn(document); }); diff --git a/web-ui/test/spec/mail_view/ui/draft_save_status.spec.js b/web-ui/test/spec/mail_view/ui/draft_save_status.spec.js index fb989f4c..bbcd6b1a 100644 --- a/web-ui/test/spec/mail_view/ui/draft_save_status.spec.js +++ b/web-ui/test/spec/mail_view/ui/draft_save_status.spec.js @@ -1,4 +1,4 @@ -/* global Smail */ +/* global Pixelated */ describeComponent('mail_view/ui/draft_save_status', function () { 'use strict'; @@ -10,17 +10,17 @@ describeComponent('mail_view/ui/draft_save_status', function () { }); it('should display status when saving a draft', function() { - $(document).trigger(Smail.events.mail.saveDraft); + $(document).trigger(Pixelated.events.mail.saveDraft); expect(this.$node.text()).toBe('Saving to Drafts...'); }); it('should display status when draft is saved', function() { - $(document).trigger(Smail.events.mail.draftSaved); + $(document).trigger(Pixelated.events.mail.draftSaved); expect(this.$node.text()).toBe('Draft Saved.'); }); it('should reset status when mail is changed since last save', function() { - $(document).trigger(Smail.events.ui.mail.changedSinceLastSave); + $(document).trigger(Pixelated.events.ui.mail.changedSinceLastSave); expect(this.$node.text()).toBe(''); }); }); diff --git a/web-ui/test/spec/mail_view/ui/forward_box.spec.js b/web-ui/test/spec/mail_view/ui/forward_box.spec.js index fc878447..cba50bc9 100644 --- a/web-ui/test/spec/mail_view/ui/forward_box.spec.js +++ b/web-ui/test/spec/mail_view/ui/forward_box.spec.js @@ -1,5 +1,5 @@ /*global jasmine */ -/*global Smail */ +/*global Pixelated */ describeComponent('mail_view/ui/forward_box', function () { 'use strict'; @@ -7,9 +7,9 @@ describeComponent('mail_view/ui/forward_box', function () { var attrs; var testMail; beforeEach(function () { - testMail = Smail.testData().parsedMail.simpleTextPlain; + testMail = Pixelated.testData().parsedMail.simpleTextPlain; - Smail.mockBloodhound(); + Pixelated.mockBloodhound(); }); it('should have a subject of Fwd: <original_message>', function() { @@ -50,7 +50,7 @@ describeComponent('mail_view/ui/forward_box', function () { }); it('should copy original message headers', function() { - var mailSendEvent = spyOnEvent(document, Smail.events.mail.send); + var mailSendEvent = spyOnEvent(document, Pixelated.events.mail.send); testMail.header.bcc = 'original_bcc@email.com'; testMail.header.cc = 'original_cc@email.com'; @@ -64,7 +64,7 @@ describeComponent('mail_view/ui/forward_box', function () { setupComponent({ mail: testMail }); this.component.attr.recipientValues.to.push('forward_to@email.com'); - $(document).trigger(Smail.events.ui.mail.send); + $(document).trigger(Pixelated.events.ui.mail.send); expect(mailSendEvent).toHaveBeenTriggeredOn(document); var sentMail = mailSendEvent.mostRecentCall.data; @@ -82,9 +82,9 @@ describeComponent('mail_view/ui/forward_box', function () { }); it('triggers openMail when email is sent', function() { - var eventSpy = spyOnEvent(document, Smail.events.ui.mail.open); + var eventSpy = spyOnEvent(document, Pixelated.events.ui.mail.open); setupComponent({ mail: testMail }); - $(document).trigger(Smail.events.mail.sent, {ident: testMail.ident}); + $(document).trigger(Pixelated.events.mail.sent, {ident: testMail.ident}); expect(eventSpy).toHaveBeenTriggeredOnAndWith(document, {ident: testMail.ident}); }); }); diff --git a/web-ui/test/spec/mail_view/ui/mail_actions.spec.js b/web-ui/test/spec/mail_view/ui/mail_actions.spec.js index 93db0193..cee4f689 100644 --- a/web-ui/test/spec/mail_view/ui/mail_actions.spec.js +++ b/web-ui/test/spec/mail_view/ui/mail_actions.spec.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ describeComponent('mail_view/ui/mail_actions', function () { 'use strict'; @@ -6,7 +6,7 @@ describeComponent('mail_view/ui/mail_actions', function () { var testData; beforeEach(function(){ - testData = Smail.testData(); + testData = Pixelated.testData(); setupComponent(testData); }); @@ -27,7 +27,7 @@ describeComponent('mail_view/ui/mail_actions', function () { it('triggers a show reply box event when clicking on reply-button-top', function(){ - var showReplyBoxEvent = spyOnEvent(document, Smail.events.ui.replyBox.showReply); + var showReplyBoxEvent = spyOnEvent(document, Pixelated.events.ui.replyBox.showReply); this.component.select('replyButtonTop').click(); @@ -36,7 +36,7 @@ describeComponent('mail_view/ui/mail_actions', function () { it('triggers a show reply all box event when clicking on reply-button-top and hide more actions list', function(){ - var showReplyAllEvent = spyOnEvent(document, Smail.events.ui.replyBox.showReplyAll); + var showReplyAllEvent = spyOnEvent(document, Pixelated.events.ui.replyBox.showReplyAll); this.component.select('viewMoreActions').click(); this.component.select('replyAllButtonTop').click(); @@ -49,7 +49,7 @@ describeComponent('mail_view/ui/mail_actions', function () { it('triggers a delete event when clicking on delete-button-top', function(){ - var deleteEvent = spyOnEvent(document, Smail.events.ui.mail.delete); + var deleteEvent = spyOnEvent(document, Pixelated.events.ui.mail.delete); this.component.select('viewMoreActions').click(); this.component.select('deleteButtonTop').click(); 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 80f253e0..36b58b87 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 @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ describeComponent('mail_view/ui/mail_view', function () { 'use strict'; @@ -9,13 +9,13 @@ describeComponent('mail_view/ui/mail_view', function () { beforeEach(function () { mail = {ident: 1, header: { date: '12/12/12T12:12' }, tags: ['inbox']}; - testData = {mail: Smail.testData().parsedMail.simpleTextPlain}; - Smail.mockBloodhound(); + testData = {mail: Pixelated.testData().parsedMail.simpleTextPlain}; + Pixelated.mockBloodhound(); setupComponent('<div></div>', {mail: mail}); }); it('triggers mail:want on ui:openMail', function () { - var spyEvent = spyOnEvent(document, Smail.events.mail.want); + var spyEvent = spyOnEvent(document, Pixelated.events.mail.want); setupComponent('<div></div>', {ident: mail.ident }); @@ -24,16 +24,16 @@ describeComponent('mail_view/ui/mail_view', function () { }); it('triggers dispatchers.rightPane.openNoMessageSelected when getting mail.notFound', function () { - var openNoMessageSelectedEvent = spyOnEvent(document, Smail.events.dispatchers.rightPane.openNoMessageSelected); + var openNoMessageSelectedEvent = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelected); - this.component.trigger(this.component, Smail.events.mail.notFound); + this.component.trigger(this.component, Pixelated.events.mail.notFound); expect(openNoMessageSelectedEvent).toHaveBeenTriggeredOn(document); }); it('removes the tag from the mail when the tag label is clicked', function() { - var updateSpy = spyOnEvent(document, Smail.events.mail.tags.update); + var updateSpy = spyOnEvent(document, Pixelated.events.mail.tags.update); this.component.displayMail({}, testData); this.component.removeTag('inbox'); @@ -154,8 +154,8 @@ describeComponent('mail_view/ui/mail_view', function () { }); it('creates new tag when pressing Enter key on new tag input', function(){ - var tagsUpdateEvent = spyOnEvent(document, Smail.events.mail.tags.update); - var tagListRefreshEvent = spyOnEvent(document, Smail.events.dispatchers.tags.refreshTagList); + var tagsUpdateEvent = spyOnEvent(document, Pixelated.events.mail.tags.update); + var tagListRefreshEvent = spyOnEvent(document, Pixelated.events.dispatchers.tags.refreshTagList); var e = creatingEvent("keydown", 13); this.component.displayMail({}, testData); @@ -173,7 +173,7 @@ describeComponent('mail_view/ui/mail_view', function () { }); it('trigger mail delete event when moving email to trash', function(){ - var mailDeleteEvent = spyOnEvent(document, Smail.events.ui.mail.delete); + var mailDeleteEvent = spyOnEvent(document, Pixelated.events.ui.mail.delete); Foundation.global.namespace = ''; $(document).foundation(); @@ -185,28 +185,28 @@ describeComponent('mail_view/ui/mail_view', function () { }); it('shows no message selected pane when deleting the email being composed', function() { - var openNoMessageSelectedPaneEvent = spyOnEvent(document, Smail.events.dispatchers.rightPane.openNoMessageSelected); + var openNoMessageSelectedPaneEvent = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelected); var mails = [{ident: 123}]; this.component.attr.mail = mails[0]; - this.component.trigger(document, Smail.events.mail.deleted, {mails: mails}); + this.component.trigger(document, Pixelated.events.mail.deleted, {mails: mails}); expect(openNoMessageSelectedPaneEvent).toHaveBeenTriggeredOn(document); }); it('does not show no message selected pane when deleting a different set of emails', function() { - var openNoMessageSelectedPaneEvent = spyOnEvent(document, Smail.events.dispatchers.rightPane.openNoMessageSelected); + var openNoMessageSelectedPaneEvent = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelected); var mails = [{ident: 321}]; this.component.attr.mail = {ident: 123}; - this.component.trigger(document, Smail.events.mail.deleted, {mails: mails}); + this.component.trigger(document, Pixelated.events.mail.deleted, {mails: mails}); expect(openNoMessageSelectedPaneEvent).not.toHaveBeenTriggeredOn(document); }); describe('archiving email', function() { it('trigger tag updates events with no tags', function(){ - var tagsUpdateEvent = spyOnEvent(document, Smail.events.mail.tags.update); + var tagsUpdateEvent = spyOnEvent(document, Pixelated.events.mail.tags.update); Foundation.global.namespace = ''; $(document).foundation(); @@ -218,7 +218,7 @@ describeComponent('mail_view/ui/mail_view', function () { }); it('opens no message selected pane', function() { - var openNoMessageSelectedEvent = spyOnEvent(document, Smail.events.dispatchers.rightPane.openNoMessageSelected); + var openNoMessageSelectedEvent = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelected); Foundation.global.namespace = ''; $(document).foundation(); @@ -231,7 +231,7 @@ describeComponent('mail_view/ui/mail_view', function () { }); it('opens the no message selected pane when clicking the close button', function() { - var openNoMessageSelectedEvent = spyOnEvent(document, Smail.events.dispatchers.rightPane.openNoMessageSelected); + var openNoMessageSelectedEvent = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelected); this.component.displayMail({}, testData); this.component.select('closeMailButton').click(); diff --git a/web-ui/test/spec/mail_view/ui/recipients/recipients.spec.js b/web-ui/test/spec/mail_view/ui/recipients/recipients.spec.js index 692bf0eb..672cf4a3 100644 --- a/web-ui/test/spec/mail_view/ui/recipients/recipients.spec.js +++ b/web-ui/test/spec/mail_view/ui/recipients/recipients.spec.js @@ -1,4 +1,4 @@ -/* global Smail */ +/* global Pixelated */ describeComponent('mail_view/ui/recipients/recipients',function () { 'use strict'; @@ -11,7 +11,7 @@ describeComponent('mail_view/ui/recipients/recipients',function () { }); it('does not trigger recipients updated events on initialization', function() { - recipientsUpdatedEvent = spyOnEvent(document, Smail.events.ui.recipients.updated); + recipientsUpdatedEvent = spyOnEvent(document, Pixelated.events.ui.recipients.updated); setupComponent({name: 'to', addresses: ['foobar@gmail.com'] }); expect(recipientsUpdatedEvent).not.toHaveBeenTriggeredOn(document); @@ -21,8 +21,8 @@ describeComponent('mail_view/ui/recipients/recipients',function () { describe('adding recipients from the ui', function() { beforeEach(function () { setupComponent(); - recipientsUpdatedEvent = spyOnEvent(document, Smail.events.ui.recipients.updated); - this.component.trigger(Smail.events.ui.recipients.entered, {name: 'to', addresses: ['foobar@gmail.com'] }); + recipientsUpdatedEvent = spyOnEvent(document, Pixelated.events.ui.recipients.updated); + this.component.trigger(Pixelated.events.ui.recipients.entered, {name: 'to', addresses: ['foobar@gmail.com'] }); }); it('triggers recipients updated', function() { diff --git a/web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js b/web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js index 0f98d007..f54781a7 100644 --- a/web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js +++ b/web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js @@ -1,4 +1,4 @@ -/* global Smail */ +/* global Pixelated */ describeComponent('mail_view/ui/recipients/recipients_input',function () { 'use strict'; @@ -17,7 +17,7 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () { ], function (keycode) { it(': ' + keycode[1], function () { - var addressEnteredEvent = spyOnEvent(this.$node, Smail.events.ui.recipients.entered); + var addressEnteredEvent = spyOnEvent(this.$node, Pixelated.events.ui.recipients.entered); var enterAddressKeyPressEvent = $.Event('keydown', { which: keycode[0] }); this.$node.val('a@b.c'); @@ -27,7 +27,7 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () { }); it('wont add address if val is empty: ' + keycode[1], function () { - var addressEnteredEvent = spyOnEvent(this.$node, Smail.events.ui.recipients.entered); + var addressEnteredEvent = spyOnEvent(this.$node, Pixelated.events.ui.recipients.entered); var enterAddressKeyPressEvent = $.Event('keydown', { which: keycode[0] }); this.$node.val(''); @@ -54,7 +54,7 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () { describe('when tab is pressed', function () { it('enters an address and prevents event default if there is an input val', function () { - var addressEnteredEvent = spyOnEvent(this.$node, Smail.events.ui.recipients.entered); + var addressEnteredEvent = spyOnEvent(this.$node, Pixelated.events.ui.recipients.entered); var tabKeyPressEvent = $.Event('keydown', { which: 9}); spyOn(tabKeyPressEvent, 'preventDefault'); @@ -67,7 +67,7 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () { }); it('doesnt enter an address and doesnt prevent event default if input val is empty (so tab moves it to the next input)', function () { - var addressEnteredEvent = spyOnEvent(this.$node, Smail.events.ui.recipients.entered); + var addressEnteredEvent = spyOnEvent(this.$node, Pixelated.events.ui.recipients.entered); var tabKeyPressEvent = $.Event('keydown', { which: 9}); spyOn(tabKeyPressEvent, 'preventDefault'); @@ -83,7 +83,7 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () { describe('on keyup', function () { it('triggers inputHasNoMail if input is empty', function () { - var inputHasNoMailEvent = spyOnEvent(document, Smail.events.ui.recipients.inputHasNoMail); + var inputHasNoMailEvent = spyOnEvent(document, Pixelated.events.ui.recipients.inputHasNoMail); this.$node.val(''); this.$node.trigger('keyup'); @@ -92,7 +92,7 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () { }); it('triggers inputHasMail if input is not empty', function () { - var inputHasMailEvent = spyOnEvent(document, Smail.events.ui.recipients.inputHasMail); + var inputHasMailEvent = spyOnEvent(document, Pixelated.events.ui.recipients.inputHasMail); this.$node.val('lalala'); this.$node.trigger('keyup'); diff --git a/web-ui/test/spec/mail_view/ui/recipients/recipients_iterator.spec.js b/web-ui/test/spec/mail_view/ui/recipients/recipients_iterator.spec.js index 480ea256..095689c2 100644 --- a/web-ui/test/spec/mail_view/ui/recipients/recipients_iterator.spec.js +++ b/web-ui/test/spec/mail_view/ui/recipients/recipients_iterator.spec.js @@ -1,4 +1,4 @@ -/* global Smail */ +/* global Pixelated */ define(['mail_view/ui/recipients/recipients_iterator'], function (RecipientsIterator) { 'use strict'; diff --git a/web-ui/test/spec/mail_view/ui/reply_box.spec.js b/web-ui/test/spec/mail_view/ui/reply_box.spec.js index c6db4de3..0f1550c5 100644 --- a/web-ui/test/spec/mail_view/ui/reply_box.spec.js +++ b/web-ui/test/spec/mail_view/ui/reply_box.spec.js @@ -1,5 +1,5 @@ /*global jasmine */ -/*global Smail */ +/*global Pixelated */ describeComponent('mail_view/ui/reply_box', function () { 'use strict'; @@ -7,7 +7,7 @@ describeComponent('mail_view/ui/reply_box', function () { var attrs, i18n; beforeEach(function () { attrs = { - mail: Smail.testData().parsedMail.simpleTextPlain + mail: Pixelated.testData().parsedMail.simpleTextPlain }; setupComponent(attrs); i18n = require('views/i18n'); @@ -49,12 +49,12 @@ describeComponent('mail_view/ui/reply_box', function () { }); it('should use set In-Reply-To header when Message-Id header is set', function() { - var mailSendEvent = spyOnEvent(document, Smail.events.mail.send); + var mailSendEvent = spyOnEvent(document, Pixelated.events.mail.send); attrs.mail.header.message_id = '12345'; setupComponent(attrs); - $(document).trigger(Smail.events.ui.mail.send); + $(document).trigger(Pixelated.events.ui.mail.send); expect(mailSendEvent).toHaveBeenTriggeredOn(document); expect(mailSendEvent.mostRecentCall.data.header).toEqual(jasmine.objectContaining({ @@ -63,11 +63,11 @@ describeComponent('mail_view/ui/reply_box', function () { }); it('keeps the List-Id header when it exists', function() { - var mailSendEvent = spyOnEvent(document, Smail.events.mail.send); + var mailSendEvent = spyOnEvent(document, Pixelated.events.mail.send); attrs.mail.header.list_id = 'somelist'; setupComponent(attrs); - $(document).trigger(Smail.events.ui.mail.send); + $(document).trigger(Pixelated.events.ui.mail.send); expect(mailSendEvent.mostRecentCall.data.header).toEqual(jasmine.objectContaining({ list_id: 'somelist' @@ -85,7 +85,7 @@ describeComponent('mail_view/ui/reply_box', function () { }); it('triggers mail when cancelling a reply', function () { - var mailSaveEvent = spyOnEvent(document, Smail.events.mail.save); + var mailSaveEvent = spyOnEvent(document, Pixelated.events.mail.save); this.component.select('trashButton').click(); @@ -93,9 +93,9 @@ describeComponent('mail_view/ui/reply_box', function () { }); it('reopens the mail after the reply is sent', function () { - var mailOpenEvent = spyOnEvent(document, Smail.events.ui.mail.open); + var mailOpenEvent = spyOnEvent(document, Pixelated.events.ui.mail.open); - this.component.trigger(document, Smail.events.mail.sent); + this.component.trigger(document, Pixelated.events.mail.sent); expect(mailOpenEvent).toHaveBeenTriggeredOnAndWith(document, { ident: this.component.attr.mail.ident diff --git a/web-ui/test/spec/mail_view/ui/reply_section.spec.js b/web-ui/test/spec/mail_view/ui/reply_section.spec.js index e5571e2c..c49c0dda 100644 --- a/web-ui/test/spec/mail_view/ui/reply_section.spec.js +++ b/web-ui/test/spec/mail_view/ui/reply_section.spec.js @@ -1,5 +1,5 @@ /*global jasmine */ -/*global Smail */ +/*global Pixelated */ describeComponent('mail_view/ui/reply_section', function () { 'use strict'; @@ -12,7 +12,7 @@ describeComponent('mail_view/ui/reply_section', function () { var mailWantEvent, expectEventData; beforeEach(function () { - mailWantEvent = spyOnEvent(document, Smail.events.mail.want); + mailWantEvent = spyOnEvent(document, Pixelated.events.mail.want); expectEventData = { mail: '12345', caller: this.component @@ -37,7 +37,7 @@ describeComponent('mail_view/ui/reply_section', function () { var mailData, ReplyBox, ForwardBox; beforeEach(function () { - mailData = Smail.testData().mail; + mailData = Pixelated.testData().mail; ReplyBox = require('mail_view/ui/reply_box'); ForwardBox = require('mail_view/ui/forward_box'); spyOn(ReplyBox, 'attachTo'); @@ -46,7 +46,7 @@ describeComponent('mail_view/ui/reply_section', function () { it('for normal reply', function() { this.component.attr.replyType = 'reply'; - this.component.trigger(this.component, Smail.events.mail.here, { mail: mailData }); + this.component.trigger(this.component, Pixelated.events.mail.here, { mail: mailData }); expect(ReplyBox.attachTo).toHaveBeenCalledWith(jasmine.any(Object), { mail: mailData, @@ -56,7 +56,7 @@ describeComponent('mail_view/ui/reply_section', function () { it('for reply to all', function() { this.component.attr.replyType = 'replyall'; - this.component.trigger(this.component, Smail.events.mail.here, { mail: mailData }); + this.component.trigger(this.component, Pixelated.events.mail.here, { mail: mailData }); expect(ReplyBox.attachTo).toHaveBeenCalledWith(jasmine.any(Object), { mail: mailData, @@ -66,7 +66,7 @@ describeComponent('mail_view/ui/reply_section', function () { it('creates a forward box', function() { this.component.attr.replyType = 'forward'; - this.component.trigger(this.component, Smail.events.mail.here, { mail: mailData }); + this.component.trigger(this.component, Pixelated.events.mail.here, { mail: mailData }); expect(ForwardBox.attachTo).toHaveBeenCalledWith(jasmine.any(Object), { mail: mailData @@ -88,7 +88,7 @@ describeComponent('mail_view/ui/reply_section', function () { this.component.attr.mailIdent = 12345; this.component.select('replyButton').click(); - $(document).trigger(Smail.events.ui.composeBox.trashReply); + $(document).trigger(Pixelated.events.ui.composeBox.trashReply); expect(this.component.select('replyButton')).not.toBeHidden(); expect(this.component.select('replyAllButton')).not.toBeHidden(); diff --git a/web-ui/test/spec/mail_view/ui/send_button.spec.js b/web-ui/test/spec/mail_view/ui/send_button.spec.js index 27bee0f3..579ce4a3 100644 --- a/web-ui/test/spec/mail_view/ui/send_button.spec.js +++ b/web-ui/test/spec/mail_view/ui/send_button.spec.js @@ -11,13 +11,13 @@ describeComponent('mail_view/ui/send_button', function () { }); it('gets enabled in a inputHasMail event', function () { - $(document).trigger(Smail.events.ui.recipients.inputHasMail, { name: 'to' }); + $(document).trigger(Pixelated.events.ui.recipients.inputHasMail, { name: 'to' }); expect(this.$node).not.toBeDisabled(); }); it('gets enabled in a recipients:updated where there are new recipients', function () { - $(document).trigger(Smail.events.ui.recipients.updated, { newRecipients: ['a@b.c']}); + $(document).trigger(Pixelated.events.ui.recipients.updated, { newRecipients: ['a@b.c']}); expect(this.$node).not.toBeDisabled(); }); @@ -27,8 +27,8 @@ describeComponent('mail_view/ui/send_button', function () { it('gets enabled and remains enabled when a inputHasMail is followed by a recipients:updated with NO new recipients', function () { this.$node.prop('disabled', true); - $(document).trigger(Smail.events.ui.recipients.inputHasMail, { name: 'to' }); - $(document).trigger(Smail.events.ui.recipients.updated, { newRecipients: [] }); + $(document).trigger(Pixelated.events.ui.recipients.inputHasMail, { name: 'to' }); + $(document).trigger(Pixelated.events.ui.recipients.updated, { newRecipients: [] }); expect(this.$node).not.toBeDisabled(); }); @@ -36,8 +36,8 @@ describeComponent('mail_view/ui/send_button', function () { it('gets enabled and remains enabled when a recipients:updated with recipients is followed by a inputHasNoMail', function () { this.$node.prop('disabled', true); - $(document).trigger(Smail.events.ui.recipients.updated, { newRecipients: ['a@b.c']}); - $(document).trigger(Smail.events.ui.recipients.inputHasNoMail, { name: 'to' }); + $(document).trigger(Pixelated.events.ui.recipients.updated, { newRecipients: ['a@b.c']}); + $(document).trigger(Pixelated.events.ui.recipients.inputHasNoMail, { name: 'to' }); expect(this.$node).not.toBeDisabled(); }); @@ -49,13 +49,13 @@ describeComponent('mail_view/ui/send_button', function () { }); it('gets disabled in a inputHasNoMail', function () { - $(document).trigger(Smail.events.ui.recipients.inputHasNoMail, { name: 'to' }); + $(document).trigger(Pixelated.events.ui.recipients.inputHasNoMail, { name: 'to' }); expect(this.$node).toBeDisabled(); }); it('gets disabled in a recipients:updated without new recipients', function () { - $(document).trigger(Smail.events.ui.recipients.updated, { newRecipients: []}); + $(document).trigger(Pixelated.events.ui.recipients.updated, { newRecipients: []}); expect(this.$node).toBeDisabled(); }); @@ -64,7 +64,7 @@ describeComponent('mail_view/ui/send_button', function () { describe('on click', function () { it ('asks for the recipients input to complete its current input', function () { - var doCompleteInputEvent = spyOnEvent(document, Smail.events.ui.recipients.doCompleteInput); + var doCompleteInputEvent = spyOnEvent(document, Pixelated.events.ui.recipients.doCompleteInput); this.$node.click(); @@ -78,13 +78,13 @@ describeComponent('mail_view/ui/send_button', function () { }); it('waits for ui:mail:recipientsUpdated to happen 3 times in the mail then sends the mail then stops listening to ui:mail:recipientsUpdated', function () { - var sendMailEvent = spyOnEvent(document, Smail.events.ui.mail.send); + var sendMailEvent = spyOnEvent(document, Pixelated.events.ui.mail.send); spyOn(this.component, 'off'); - _.times(3, function () { $(document).trigger(Smail.events.ui.mail.recipientsUpdated) });; + _.times(3, function () { $(document).trigger(Pixelated.events.ui.mail.recipientsUpdated) });; expect(sendMailEvent).toHaveBeenTriggeredOn(document); - expect(this.component.off).toHaveBeenCalledWith(document, Smail.events.ui.mail.recipientsUpdated); + expect(this.component.off).toHaveBeenCalledWith(document, Pixelated.events.ui.mail.recipientsUpdated); }); }); }); diff --git a/web-ui/test/spec/mixins/with_mail_edit_base.spec.js b/web-ui/test/spec/mixins/with_mail_edit_base.spec.js index 43d3b7cd..35ec0eb6 100644 --- a/web-ui/test/spec/mixins/with_mail_edit_base.spec.js +++ b/web-ui/test/spec/mixins/with_mail_edit_base.spec.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ /*global jasmine */ /*global runs */ /*global waits */ @@ -16,7 +16,7 @@ describeMixin('mixins/with_mail_edit_base', function () { describe('initialization', function() { it('should enable send button when rendering with recipients', function() { - var enableSendButtonEvent = spyOnEvent(document, Smail.events.ui.sendbutton.enable); + var enableSendButtonEvent = spyOnEvent(document, Pixelated.events.ui.sendbutton.enable); this.component.render(function() {}, { recipients: { to: ['foobar@mail.com'], cc: [] } @@ -26,7 +26,7 @@ describeMixin('mixins/with_mail_edit_base', function () { }); it('should not enable send button when rendering without recipients', function() { - var enableSendButtonEvent = spyOnEvent(document, Smail.events.ui.sendbutton.enable); + var enableSendButtonEvent = spyOnEvent(document, Pixelated.events.ui.sendbutton.enable); this.component.render(function() {}, { recipients: { to: [], cc: [] } @@ -42,7 +42,7 @@ describeMixin('mixins/with_mail_edit_base', function () { }); it('saves the draft after the save draft interval number of seconds', function() { - var saveDraftSpy = spyOnEvent(document, Smail.events.mail.saveDraft); + var saveDraftSpy = spyOnEvent(document, Pixelated.events.mail.saveDraft); runs(function () { this.component.monitorInput(); expect(saveDraftSpy).not.toHaveBeenTriggeredOn(document); @@ -54,7 +54,7 @@ describeMixin('mixins/with_mail_edit_base', function () { }); it('does not save if mail is sent before the save draft interval number of seconds', function() { - var saveDraftSpy = spyOnEvent(document, Smail.events.mail.saveDraft); + var saveDraftSpy = spyOnEvent(document, Pixelated.events.mail.saveDraft); runs(function () { this.component.monitorInput(); this.component.sendMail(); @@ -68,15 +68,15 @@ describeMixin('mixins/with_mail_edit_base', function () { describe('when a mail is sent', function () { it('displays a message of mail sent', function () { - var spy = spyOnEvent(document, Smail.events.ui.userAlerts.displayMessage); - this.component.trigger(document, Smail.events.mail.sent); + var spy = spyOnEvent(document, Pixelated.events.ui.userAlerts.displayMessage); + this.component.trigger(document, Pixelated.events.mail.sent); expect(spy).toHaveBeenTriggeredOn(document); }); }); describe('when user asks to trash the mail', function() { it('triggers mail delete for this mail', function() { - var spy = spyOnEvent(document, Smail.events.mail.save); + var spy = spyOnEvent(document, Pixelated.events.mail.save); this.component.trashMail(); expect(spy).toHaveBeenTriggeredOn(document); }); @@ -84,9 +84,9 @@ describeMixin('mixins/with_mail_edit_base', function () { describe('when recipients are updated', function () { it('triggers an event to let the send button know that the recipients in the mail are updated', function () { - var uiMailRecipientsUpdated = spyOnEvent(document, Smail.events.ui.mail.recipientsUpdated); + var uiMailRecipientsUpdated = spyOnEvent(document, Pixelated.events.ui.mail.recipientsUpdated); - $(document).trigger(Smail.events.ui.recipients.updated, {recipientsName: 'to', newRecipients: ['fox@somewhere.com']}); + $(document).trigger(Pixelated.events.ui.recipients.updated, {recipientsName: 'to', newRecipients: ['fox@somewhere.com']}); expect(uiMailRecipientsUpdated).toHaveBeenTriggeredOn(document); }); diff --git a/web-ui/test/spec/page/pane_contract_expand.spec.js b/web-ui/test/spec/page/pane_contract_expand.spec.js index 803f688c..9a09edb2 100644 --- a/web-ui/test/spec/page/pane_contract_expand.spec.js +++ b/web-ui/test/spec/page/pane_contract_expand.spec.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ /*global afterEach */ 'use strict'; @@ -27,28 +27,28 @@ describeComponent('page/pane_contract_expand', function () { }); it('contracts middle pane and expands right pane on mail open', function () { - $(document).trigger(Smail.events.ui.mail.open); + $(document).trigger(Pixelated.events.ui.mail.open); expect($('#middle-pane-container').attr('class')).toEqual(this.component.attr.MIDDLE_PANE_CONTRACT_CLASSES); expect($('#right-pane').attr('class')).toEqual(this.component.attr.RIGHT_PANE_EXPAND_CLASSES); }); it('contracts middle pane and expands right pane on open compose box', function () { - $(document).trigger(Smail.events.dispatchers.rightPane.openComposeBox); + $(document).trigger(Pixelated.events.dispatchers.rightPane.openComposeBox); expect($('#middle-pane-container').attr('class')).toEqual(this.component.attr.MIDDLE_PANE_CONTRACT_CLASSES); expect($('#right-pane').attr('class')).toEqual(this.component.attr.RIGHT_PANE_EXPAND_CLASSES); }); it('contracts middle pane and expands right pane on open draft', function () { - $(document).trigger(Smail.events.dispatchers.rightPane.openDraft); + $(document).trigger(Pixelated.events.dispatchers.rightPane.openDraft); expect($('#middle-pane-container').attr('class')).toEqual(this.component.attr.MIDDLE_PANE_CONTRACT_CLASSES); expect($('#right-pane').attr('class')).toEqual(this.component.attr.RIGHT_PANE_EXPAND_CLASSES); }); it('expands middle pane and contracts right pane on event on open no message selected pane', function () { - $(document).trigger(Smail.events.dispatchers.rightPane.openNoMessageSelected); + $(document).trigger(Pixelated.events.dispatchers.rightPane.openNoMessageSelected); expect($('#middle-pane-container').attr('class')).toEqual(this.component.attr.MIDDLE_PANE_EXPAND_CLASSES); expect($('#right-pane').attr('class')).toEqual(this.component.attr.RIGHT_PANE_CONTRACT_CLASSES); diff --git a/web-ui/test/spec/page/router.spec.js b/web-ui/test/spec/page/router.spec.js index 0b5b6b32..0eb8977d 100644 --- a/web-ui/test/spec/page/router.spec.js +++ b/web-ui/test/spec/page/router.spec.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ /*global jasmine */ describeComponent('page/router', function () { 'use strict'; @@ -12,29 +12,29 @@ describeComponent('page/router', function () { }); it('pushes the state with the tag and the url', function () { - $(document).trigger(Smail.events.router.pushState, { tag: 'inbox'}); + $(document).trigger(Pixelated.events.router.pushState, { tag: 'inbox'}); expect(fakeHistory.pushState).toHaveBeenCalledWith(jasmine.objectContaining({ tag: 'inbox' }), '', '/#/inbox'); }); it('pushes the state with mailIdent', function () { - $(document).trigger(Smail.events.router.pushState, { tag: 'inbox', mailIdent: 1}); + $(document).trigger(Pixelated.events.router.pushState, { tag: 'inbox', mailIdent: 1}); expect(fakeHistory.pushState).toHaveBeenCalledWith(jasmine.objectContaining({ tag: 'inbox', mailIdent: 1 }), '', '/#/inbox/mail/1'); }); it('pushes the state with mailIdent even if mail ident is 0 (that happens for drafts)', function () { - $(document).trigger(Smail.events.router.pushState, { tag: 'inbox', mailIdent: 0}); + $(document).trigger(Pixelated.events.router.pushState, { tag: 'inbox', mailIdent: 0}); expect(fakeHistory.pushState).toHaveBeenCalledWith(jasmine.objectContaining({ tag: 'inbox', mailIdent: 0 }), '', '/#/inbox/mail/0'); }); it('pushes the state with the displayNoMessage boolean forwarded from the event', function () { - $(document).trigger(Smail.events.router.pushState, { tag: 'inbox', mailIdent: 0}); + $(document).trigger(Pixelated.events.router.pushState, { tag: 'inbox', mailIdent: 0}); expect(fakeHistory.pushState).toHaveBeenCalledWith(jasmine.objectContaining({ isDisplayNoMessageSelected: false}), '', '/#/inbox/mail/0'); - $(document).trigger(Smail.events.router.pushState, { tag: 'inbox', mailIdent: 0, isDisplayNoMessageSelected: true}); + $(document).trigger(Pixelated.events.router.pushState, { tag: 'inbox', mailIdent: 0, isDisplayNoMessageSelected: true}); expect(fakeHistory.pushState).toHaveBeenCalledWith(jasmine.objectContaining({ isDisplayNoMessageSelected: true}), '', '/#/inbox/mail/0'); }); @@ -43,7 +43,7 @@ describeComponent('page/router', function () { var urlParams = require("page/router/url_params"); spyOn(urlParams, 'getTag').andReturn('tag'); - var selectTagEvent = spyOnEvent(document, Smail.events.ui.tag.select); + var selectTagEvent = spyOnEvent(document, Pixelated.events.ui.tag.select); this.component.smailPopState({ state: {tag: undefined} }); @@ -54,7 +54,7 @@ describeComponent('page/router', function () { var urlParams = require("page/router/url_params"); spyOn(urlParams, 'getTag').andReturn('tag'); - var displayNoMessageEvent = spyOnEvent(document, Smail.events.dispatchers.rightPane.openNoMessageSelectedWithoutPushState); + var displayNoMessageEvent = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelectedWithoutPushState); this.component.smailPopState({ state: {tag: undefined, isDisplayNoMessageSelected: false} }); diff --git a/web-ui/test/spec/search/search_trigger.spec.js b/web-ui/test/spec/search/search_trigger.spec.js index aaeba3b1..c547df7a 100644 --- a/web-ui/test/spec/search/search_trigger.spec.js +++ b/web-ui/test/spec/search/search_trigger.spec.js @@ -1,5 +1,5 @@ /*global jasmine */ -/*global Smail */ +/*global Pixelated */ describeComponent('search/search_trigger', function () { 'use strict'; @@ -16,14 +16,14 @@ describeComponent('search/search_trigger', function () { } it('should trigger search when the submit occurs', function () { - var spy = spyOnEvent(document, Smail.events.search.perform); + var spy = spyOnEvent(document, Pixelated.events.search.perform); submitSearch('tanana'); expect(spy).toHaveBeenTriggeredOnAndWith(document, { query: 'tanana' }); }); it('should select the "all" tag when submit occurs but should skip mail list refresh', function (){ - var tagSelectEvent = spyOnEvent(document, Smail.events.ui.tag.select); + var tagSelectEvent = spyOnEvent(document, Pixelated.events.ui.tag.select); submitSearch('tanana'); @@ -34,8 +34,8 @@ describeComponent('search/search_trigger', function () { }); it('should select the "all" tag when an empty submit occurs and shoud refresh mail list', function() { - var tagSelectEvent = spyOnEvent(document, Smail.events.ui.tag.select); - var emptySearchEvent = spyOnEvent(document, Smail.events.search.empty); + var tagSelectEvent = spyOnEvent(document, Pixelated.events.ui.tag.select); + var emptySearchEvent = spyOnEvent(document, Pixelated.events.search.empty); submitSearch(''); @@ -46,7 +46,7 @@ describeComponent('search/search_trigger', function () { it('should clear input when selecting a new tag', function(){ submitSearch('tanana'); - $(document).trigger(Smail.events.ui.tag.selected, { tag: 'inbox'}); + $(document).trigger(Pixelated.events.ui.tag.selected, { tag: 'inbox'}); expect(self.component.select('input').val()).toBe(''); }); diff --git a/web-ui/test/spec/services/delete_service.spec.js b/web-ui/test/spec/services/delete_service.spec.js index 3e098877..9652e9d5 100644 --- a/web-ui/test/spec/services/delete_service.spec.js +++ b/web-ui/test/spec/services/delete_service.spec.js @@ -1,5 +1,5 @@ /*global jasmine */ -/*global Smail */ +/*global Pixelated */ describeComponent('services/delete_service', function () { 'use strict'; @@ -24,10 +24,10 @@ describeComponent('services/delete_service', function () { }; it('add Trash tag when deleting an email that does not have it', function () { - var mailDeleteEvent = spyOnEvent(document, Smail.events.mail.delete); - var openNoMessageSelectedEvent = spyOnEvent(document, Smail.events.dispatchers.rightPane.openNoMessageSelected); + var mailDeleteEvent = spyOnEvent(document, Pixelated.events.mail.delete); + var openNoMessageSelectedEvent = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelected); - this.component.trigger(document, Smail.events.ui.mail.delete, {mail: mailWithoutTrashTag}); + this.component.trigger(document, Pixelated.events.ui.mail.delete, {mail: mailWithoutTrashTag}); var expectedDeleteEventData = { mail: mailWithoutTrashTag, @@ -38,10 +38,10 @@ describeComponent('services/delete_service', function () { }); it('removes permanently email that has Trash tag', function(){ - var mailDeleteEvent = spyOnEvent(document, Smail.events.mail.delete); - var openNoMessageSelectedEvent = spyOnEvent(document, Smail.events.dispatchers.rightPane.openNoMessageSelected); + var mailDeleteEvent = spyOnEvent(document, Pixelated.events.mail.delete); + var openNoMessageSelectedEvent = spyOnEvent(document, Pixelated.events.dispatchers.rightPane.openNoMessageSelected); - this.component.trigger(document, Smail.events.ui.mail.delete, {mail: mailWithTrashTag}); + this.component.trigger(document, Pixelated.events.ui.mail.delete, {mail: mailWithTrashTag}); var expectedDeleteEventData = { mail: mailWithTrashTag, diff --git a/web-ui/test/spec/services/mail_service.spec.js b/web-ui/test/spec/services/mail_service.spec.js index 31e130fa..c2b6cb5f 100644 --- a/web-ui/test/spec/services/mail_service.spec.js +++ b/web-ui/test/spec/services/mail_service.spec.js @@ -1,5 +1,5 @@ /*global jasmine */ -/*global Smail */ +/*global Pixelated */ 'use strict'; describeComponent('services/mail_service', function () { @@ -8,14 +8,14 @@ describeComponent('services/mail_service', function () { beforeEach( function () { setupComponent(); - email1 = Smail.testData().parsedMail.simpleTextPlain; + email1 = Pixelated.testData().parsedMail.simpleTextPlain; i18n = require('views/i18n'); } ); it('marks the desired message as read', function () { var readRequest = spyOn($, 'ajax').andReturn({}); - this.component.trigger(Smail.events.mail.read, {ident: 1}); + this.component.trigger(Pixelated.events.mail.read, {ident: 1}); expect(readRequest.mostRecentCall.args[0]).toEqual('/mail/1/read'); }); @@ -25,8 +25,8 @@ describeComponent('services/mail_service', function () { beforeEach(function () { readRequest = spyOn($, 'ajax').andReturn({done: function(f) { doneMarkAsRead = f; return {fail: function() {}};}}); - uncheckedEmailsEvent = spyOnEvent(document, Smail.events.ui.mail.unchecked); - setCheckAllEvent = spyOnEvent(document, Smail.events.ui.mails.hasMailsChecked); + uncheckedEmailsEvent = spyOnEvent(document, Pixelated.events.ui.mail.unchecked); + setCheckAllEvent = spyOnEvent(document, Pixelated.events.ui.mails.hasMailsChecked); spyOn(this.component, 'refreshResults'); checkedMails = { @@ -34,7 +34,7 @@ describeComponent('services/mail_service', function () { 2: {ident: 2} }; - this.component.trigger(Smail.events.mail.read, {checkedMails: checkedMails}); + this.component.trigger(Pixelated.events.mail.read, {checkedMails: checkedMails}); }); it('makes the correct request to the backend', function () { @@ -61,9 +61,9 @@ describeComponent('services/mail_service', function () { it('fetches a single email', function () { var me = {}; var spyAjax = spyOn($, 'ajax').andReturn({done: function(f) { f(email1); return {fail: function() {}};}}); - var mailHereEvent = spyOnEvent(me, Smail.events.mail.here); + var mailHereEvent = spyOnEvent(me, Pixelated.events.mail.here); - this.component.trigger(Smail.events.mail.want, { caller: me, mail: email1.ident }); + this.component.trigger(Pixelated.events.mail.want, { caller: me, mail: email1.ident }); expect(mailHereEvent).toHaveBeenTriggeredOn(me); expect(spyAjax.mostRecentCall.args[0]).toEqual('/mail/' + email1.ident); @@ -72,9 +72,9 @@ describeComponent('services/mail_service', function () { it('answers mail:notFound if mail returned from server is null', function () { var me = {}; var spyAjax = spyOn($, 'ajax').andReturn({done: function(f) { f(null); return {fail: function() {}};}}); - var mailNotFound = spyOnEvent(me, Smail.events.mail.notFound); + var mailNotFound = spyOnEvent(me, Pixelated.events.mail.notFound); - this.component.trigger(Smail.events.mail.want, { caller: me, mail: email1.ident }); + this.component.trigger(Pixelated.events.mail.want, { caller: me, mail: email1.ident }); expect(mailNotFound).toHaveBeenTriggeredOn(me); }); @@ -83,11 +83,11 @@ describeComponent('services/mail_service', function () { spyOn(this.component, 'refreshResults'); var spyAjax = spyOn($, 'ajax').andReturn({done: function(f) { f(); return {fail: function() {}};}}); - var spyEvent = spyOnEvent(document, Smail.events.mail.tags.updated); + var spyEvent = spyOnEvent(document, Pixelated.events.mail.tags.updated); var component = jasmine.createSpyObj('component',['successUpdateTags']); spyOn(this.component, 'fetchMail'); - this.component.trigger(Smail.events.mail.tags.update, { ident: email1.ident, tags: email1.tags }); + this.component.trigger(Pixelated.events.mail.tags.update, { ident: email1.ident, tags: email1.tags }); expect(spyEvent).toHaveBeenTriggeredOn(document); expect(spyAjax.calls[0].args[0]).toEqual('/mail/1/tags'); @@ -98,10 +98,10 @@ describeComponent('services/mail_service', function () { it('triggers an error message when it can\'t update the tags', function () { var spyAjax = spyOn($, 'ajax').andReturn({done: function() { return {fail: function(f) {f();}};}}); - var spyEvent = spyOnEvent(document, Smail.events.ui.userAlerts.displayMessage); + var spyEvent = spyOnEvent(document, Pixelated.events.ui.userAlerts.displayMessage); var component = jasmine.createSpyObj('component',['failureUpdateTags']); - this.component.trigger(Smail.events.mail.tags.update, { ident: email1.ident, tags: email1.tags }); + this.component.trigger(Pixelated.events.mail.tags.update, { ident: email1.ident, tags: email1.tags }); expect(spyEvent).toHaveBeenTriggeredOn(document); expect(spyAjax.mostRecentCall.args[0]).toEqual('/mail/1/tags'); @@ -110,7 +110,7 @@ describeComponent('services/mail_service', function () { it('will try to delete a message when requested to', function() { var spyAjax = spyOn($, 'ajax').andReturn({done: function() { return {fail: function(f) {}};}}); - this.component.trigger(Smail.events.mail.delete, {mail: {ident: '43'}}); + this.component.trigger(Pixelated.events.mail.delete, {mail: {ident: '43'}}); expect(spyAjax).toHaveBeenCalled(); expect(spyAjax.mostRecentCall.args[0]).toEqual('/mail/43'); expect(spyAjax.mostRecentCall.args[1].type).toEqual('DELETE'); @@ -120,10 +120,10 @@ describeComponent('services/mail_service', function () { var displayMessageEvent, uncheckedEmailsEvent, setCheckAllEvent, mailsDeletedEvent; beforeEach(function () { - displayMessageEvent = spyOnEvent(document, Smail.events.ui.userAlerts.displayMessage); - uncheckedEmailsEvent = spyOnEvent(document, Smail.events.ui.mail.unchecked); - setCheckAllEvent = spyOnEvent(document, Smail.events.ui.mails.hasMailsChecked); - mailsDeletedEvent = spyOnEvent(document, Smail.events.mail.deleted); + displayMessageEvent = spyOnEvent(document, Pixelated.events.ui.userAlerts.displayMessage); + uncheckedEmailsEvent = spyOnEvent(document, Pixelated.events.ui.mail.unchecked); + setCheckAllEvent = spyOnEvent(document, Pixelated.events.ui.mails.hasMailsChecked); + mailsDeletedEvent = spyOnEvent(document, Pixelated.events.mail.deleted); spyOn(this.component, 'refreshResults'); this.component.triggerDeleted({ @@ -155,19 +155,19 @@ describeComponent('services/mail_service', function () { it('will trigger an error message when a message cannot be deleted', function() { spyOn($, 'ajax').andReturn({done: function() { return {fail: function(f) { f(); }};}}); - var spyEvent = spyOnEvent(document, Smail.events.ui.userAlerts.displayMessage); + var spyEvent = spyOnEvent(document, Pixelated.events.ui.userAlerts.displayMessage); - this.component.trigger(Smail.events.mail.delete, {mail: {ident: '43'}}); + this.component.trigger(Pixelated.events.mail.delete, {mail: {ident: '43'}}); expect(spyEvent).toHaveBeenTriggeredOnAndWith(document, {message: i18n('Could not delete email')} ); }); it('triggers mails:available with received mails and keeps that tag as the current tag', function() { var g; - var eventSpy = spyOnEvent(document, Smail.events.mails.available); + var eventSpy = spyOnEvent(document, Pixelated.events.mails.available); spyOn($, 'ajax').andReturn({done: function(f) { g = f; return {fail: function(){}};}}); - this.component.trigger(Smail.events.ui.mails.fetchByTag, {tag: 'inbox'}); + this.component.trigger(Pixelated.events.ui.mails.fetchByTag, {tag: 'inbox'}); g({stats: {}, mails: [email1]}); expect(eventSpy.mostRecentCall.data.stats).toEqual({}); @@ -178,18 +178,18 @@ describeComponent('services/mail_service', function () { it('wraps the tag in quotes before fetching by tag (to support tags with spaces)', function () { spyOn($, 'ajax').andReturn({done: function(f) { return {fail: function(){}};}}); - this.component.trigger(Smail.events.ui.mails.fetchByTag, {tag: 'new tag'}); + this.component.trigger(Pixelated.events.ui.mails.fetchByTag, {tag: 'new tag'}); expect($.ajax.mostRecentCall.args[0]).toContain(encodeURI('tag:"new tag"')); }); it('sends the previous tag when mails:refresh is called without a tag (this happens when the refresher calls it)', function () { var g; - var eventSpy = spyOnEvent(document, Smail.events.mails.availableForRefresh); + var eventSpy = spyOnEvent(document, Pixelated.events.mails.availableForRefresh); this.component.attr.currentTag = 'sent'; spyOn($, 'ajax').andReturn({done: function(f) { g = f; return {fail: function(){}};}}); - this.component.trigger(Smail.events.ui.mails.refresh); + this.component.trigger(Pixelated.events.ui.mails.refresh); g({stats: {}, mails: [email1]}); expect(eventSpy.mostRecentCall.data.tag).toEqual('sent'); @@ -201,7 +201,7 @@ describeComponent('services/mail_service', function () { var g; beforeEach(function () { - pageChangedEvent = spyOnEvent(document, Smail.events.ui.page.changed); + pageChangedEvent = spyOnEvent(document, Pixelated.events.ui.page.changed); spyOn($, 'ajax').andReturn({done: function(f) { g = f; return {fail: function(){}}; @@ -212,7 +212,7 @@ describeComponent('services/mail_service', function () { it('changes to the previous page and refetch email when ui:page:previous is fired', function() { this.component.attr.currentPage = 1; - this.component.trigger(Smail.events.ui.page.previous); + this.component.trigger(Pixelated.events.ui.page.previous); expect(this.component.fetchMail).toHaveBeenCalled(); expect(this.component.attr.currentPage).toEqual(0); @@ -221,7 +221,7 @@ describeComponent('services/mail_service', function () { it('won\'t change the page if it was already at the first page and trying to go to previous', function() { this.component.attr.currentPage = 0; - this.component.trigger(Smail.events.ui.page.previous); + this.component.trigger(Pixelated.events.ui.page.previous); expect(this.component.fetchMail).not.toHaveBeenCalled(); expect(this.component.attr.currentPage).toEqual(0); @@ -231,7 +231,7 @@ describeComponent('services/mail_service', function () { this.component.attr.numPages = 10; this.component.attr.currentPage = 1; - this.component.trigger(Smail.events.ui.page.next); + this.component.trigger(Pixelated.events.ui.page.next); expect(this.component.fetchMail).toHaveBeenCalled(); expect(this.component.attr.currentPage).toEqual(2); @@ -241,7 +241,7 @@ describeComponent('services/mail_service', function () { this.component.attr.numPages = 10; this.component.attr.currentPage = 9; - this.component.trigger(Smail.events.ui.page.next); + this.component.trigger(Pixelated.events.ui.page.next); expect(this.component.fetchMail).not.toHaveBeenCalled(); expect(this.component.attr.currentPage).toEqual(9); @@ -250,7 +250,7 @@ describeComponent('services/mail_service', function () { it('triggers pageChanged event when going to next page', function() { this.component.attr.numPages = 10; - this.component.trigger(Smail.events.ui.page.next); + this.component.trigger(Pixelated.events.ui.page.next); expect(pageChangedEvent).toHaveBeenTriggeredOnAndWith(document, {currentPage: 1, numPages: 10}); }); @@ -258,7 +258,7 @@ describeComponent('services/mail_service', function () { it('triggers pageChanged event when going to previous page', function() { this.component.attr.numPages = 10; this.component.attr.currentPage = 1; - this.component.trigger(Smail.events.ui.page.previous); + this.component.trigger(Pixelated.events.ui.page.previous); expect(pageChangedEvent).toHaveBeenTriggeredOnAndWith(document, {currentPage: 0, numPages: 10}); }); @@ -266,7 +266,7 @@ describeComponent('services/mail_service', function () { it('resets currentPage when fetching mails by tag', function() { this.component.attr.numPages = 10; this.component.attr.currentPage = 999; - this.component.trigger(Smail.events.ui.mails.fetchByTag, {tag: 'inbox'}); + this.component.trigger(Pixelated.events.ui.mails.fetchByTag, {tag: 'inbox'}); expect(this.component.attr.currentPage).toEqual(0); expect(pageChangedEvent).toHaveBeenTriggeredOnAndWith(document, {currentPage: 0, numPages: 10}); @@ -285,7 +285,7 @@ describeComponent('services/mail_service', function () { this.component.attr.w = 20; this.component.attr.numPages = 0; - this.component.trigger(Smail.events.ui.mails.fetchByTag, {tag: 'another tag'}); + this.component.trigger(Pixelated.events.ui.mails.fetchByTag, {tag: 'another tag'}); g(mailSetData); expect(this.component.attr.numPages).toBe(5); @@ -296,7 +296,7 @@ describeComponent('services/mail_service', function () { this.component.attr.w = 20; this.component.attr.numPages = 0; - this.component.trigger(Smail.events.ui.mails.fetchByTag, {tag: 'another tag'}); + this.component.trigger(Pixelated.events.ui.mails.fetchByTag, {tag: 'another tag'}); g(mailSetData); expect(this.component.attr.numPages).toBe(6); diff --git a/web-ui/test/spec/services/model/mail.spec.js b/web-ui/test/spec/services/model/mail.spec.js index 5bdad88b..ba91ebde 100644 --- a/web-ui/test/spec/services/model/mail.spec.js +++ b/web-ui/test/spec/services/model/mail.spec.js @@ -1,4 +1,4 @@ -/*global Smail */ +/*global Pixelated */ require(['services/model/mail'], function (Mail) { var testData; @@ -21,10 +21,10 @@ require(['services/model/mail'], function (Mail) { describe('a single email', function () { var sentMail, draftMail, recievedMail, recievedMailWithCC; beforeEach(function () { - sentMail = Mail.create(Smail.testData().rawMail.sent); - draftMail = Mail.create(Smail.testData().rawMail.draft); - recievedMail = Mail.create(Smail.testData().rawMail.recieved); - recievedMailWithCC = Mail.create(Smail.testData().rawMail.recievedWithCC); + sentMail = Mail.create(Pixelated.testData().rawMail.sent); + draftMail = Mail.create(Pixelated.testData().rawMail.draft); + recievedMail = Mail.create(Pixelated.testData().rawMail.recieved); + recievedMailWithCC = Mail.create(Pixelated.testData().rawMail.recievedWithCC); }); it('correctly identifies a sent mail', function () { @@ -64,7 +64,7 @@ require(['services/model/mail'], function (Mail) { var parsedMultipartMail; beforeEach(function () { - parsedMultipartMail = Mail.create(Smail.testData().rawMail.multipart); + parsedMultipartMail = Mail.create(Pixelated.testData().rawMail.multipart); }); it('parses the mail as multipart/alternative', function () { 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"); }); diff --git a/web-ui/test/spec/user_alerts/ui/user_alerts.spec.js b/web-ui/test/spec/user_alerts/ui/user_alerts.spec.js index f013b744..42ef581c 100644 --- a/web-ui/test/spec/user_alerts/ui/user_alerts.spec.js +++ b/web-ui/test/spec/user_alerts/ui/user_alerts.spec.js @@ -6,7 +6,7 @@ describeComponent('user_alerts/ui/user_alerts', function () { }); it('should render message when ui:user_alerts:displayMessage is triggered', function () { - this.component.trigger(Smail.events.ui.userAlerts.displayMessage, { message: 'a message' }); + this.component.trigger(Pixelated.events.ui.userAlerts.displayMessage, { message: 'a message' }); expect(this.component.$node.html()).toMatch('a message'); }); diff --git a/web-ui/test/test-main.js b/web-ui/test/test-main.js index 8bdd45e3..fc82e49f 100644 --- a/web-ui/test/test-main.js +++ b/web-ui/test/test-main.js @@ -37,10 +37,10 @@ requirejs.config({ callback: function () { require(['page/events','test/test_data', 'views/i18n', 'monkey_patching/array', 'views/recipientListFormatter'], function (events, testData, i18n, mp, recipientListFormatter) { - window['Smail'] = window['Smail'] || {}; - window['Smail'].events = events; - window['Smail'].testData = testData; - window['Smail'].mockBloodhound = function() { + window['Pixelated'] = window['Pixelated'] || {}; + window['Pixelated'].events = events; + window['Pixelated'].testData = testData; + window['Pixelated'].mockBloodhound = function() { window.Bloodhound = function() {}; window.Bloodhound.prototype.initialize = function() {}; window.Bloodhound.prototype.ttAdapter = function() {}; |