summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/mail_view/ui
diff options
context:
space:
mode:
authorPatrick Maia <pixelated-team+patrick@thoughtworks.com>2014-08-08 17:51:33 -0300
committerPatrick Maia <patrickjourdanmaia@gmail.com>2014-08-08 17:51:33 -0300
commit97e762a0832593031ae71ab1e11d4c0e377a00f4 (patch)
tree213e835f4effbaf97f0922e5941065b1329d0501 /web-ui/test/spec/mail_view/ui
parentf22a6a32e901f52b2b3f2b3fd8625c43302ff001 (diff)
replaces Smail by Pixelated in all js files
Diffstat (limited to 'web-ui/test/spec/mail_view/ui')
-rw-r--r--web-ui/test/spec/mail_view/ui/compose_box.spec.js54
-rw-r--r--web-ui/test/spec/mail_view/ui/draft_box.spec.js20
-rw-r--r--web-ui/test/spec/mail_view/ui/draft_save_status.spec.js8
-rw-r--r--web-ui/test/spec/mail_view/ui/forward_box.spec.js14
-rw-r--r--web-ui/test/spec/mail_view/ui/mail_actions.spec.js10
-rw-r--r--web-ui/test/spec/mail_view/ui/mail_view.spec.js34
-rw-r--r--web-ui/test/spec/mail_view/ui/recipients/recipients.spec.js8
-rw-r--r--web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js14
-rw-r--r--web-ui/test/spec/mail_view/ui/recipients/recipients_iterator.spec.js2
-rw-r--r--web-ui/test/spec/mail_view/ui/reply_box.spec.js18
-rw-r--r--web-ui/test/spec/mail_view/ui/reply_section.spec.js14
-rw-r--r--web-ui/test/spec/mail_view/ui/send_button.spec.js24
12 files changed, 110 insertions, 110 deletions
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);
});
});
});