diff options
author | Duda Dornelles <ddornell@thoughtworks.com> | 2014-10-20 13:17:23 +0200 |
---|---|---|
committer | Duda Dornelles <ddornell@thoughtworks.com> | 2014-10-20 13:17:28 +0200 |
commit | 9a4dd1a4406fb964ff0fc2dc2a658b45736c2b30 (patch) | |
tree | 85504695d74150948a8d315f50228e72dc3d41fa | |
parent | 337663b578f1fcf0681e3d12ea91197d5e8a719c (diff) |
Fixing js unit tests
4 files changed, 17 insertions, 17 deletions
diff --git a/web-ui/app/js/mail_list/ui/mail_items/draft_item.js b/web-ui/app/js/mail_list/ui/mail_items/draft_item.js index d443e958..0037df02 100644 --- a/web-ui/app/js/mail_list/ui/mail_items/draft_item.js +++ b/web-ui/app/js/mail_list/ui/mail_items/draft_item.js @@ -49,7 +49,7 @@ define( var mailItemHtml = templates.mails.sent(this.attr); this.$node.html(mailItemHtml); this.$node.addClass(this.attr.statuses); - if(this.attr.selected) { this.select(); } + if(this.attr.selected) { this.doSelect(); } this.on(this.$node.find('a'), 'click', this.triggerOpenMail); }; @@ -62,7 +62,7 @@ define( this.checkCheckbox(); } - this.on(document, events.ui.composeBox.newMessage, this.unselect); + this.on(document, events.ui.composeBox.newMessage, this.doUnselect); this.on(document, events.ui.mail.updateSelected, this.updateSelected); this.on(document, events.mails.teardown, this.teardown); }); diff --git a/web-ui/app/js/mail_list/ui/mail_items/generic_mail_item.js b/web-ui/app/js/mail_list/ui/mail_items/generic_mail_item.js index c313b030..eb4d2ca5 100644 --- a/web-ui/app/js/mail_list/ui/mail_items/generic_mail_item.js +++ b/web-ui/app/js/mail_list/ui/mail_items/generic_mail_item.js @@ -89,7 +89,7 @@ define( var mailItemHtml = templates.mails.single(this.attr); this.$node.html(mailItemHtml); this.$node.addClass(this.attr.statuses); - if(this.attr.selected) { this.select(); } + if(this.attr.selected) { this.doSelect(); } this.on(this.$node.find('a'), 'click', this.triggerOpenMail); }; diff --git a/web-ui/app/js/mail_list/ui/mail_items/sent_item.js b/web-ui/app/js/mail_list/ui/mail_items/sent_item.js index eeaa845f..3682188b 100644 --- a/web-ui/app/js/mail_list/ui/mail_items/sent_item.js +++ b/web-ui/app/js/mail_list/ui/mail_items/sent_item.js @@ -55,7 +55,7 @@ define( var mailItemHtml = templates.mails.sent(this.attr); this.$node.html(mailItemHtml); this.$node.addClass(this.attr.statuses); - if(this.attr.selected) { this.select(); } + if(this.attr.selected) { this.doSelect(); } this.on(this.$node.find('a'), 'click', this.triggerOpenMail); }; @@ -68,7 +68,7 @@ define( this.checkCheckbox(); } - this.on(document, events.ui.composeBox.newMessage, this.unselect); + this.on(document, events.ui.composeBox.newMessage, this.doUnselect); this.on(document, events.ui.mail.open, this.openMail); this.on(document, events.ui.mail.updateSelected, this.updateSelected); this.on(document, events.mails.teardown, this.teardown); 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 60ea6526..51f18db3 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 @@ -4,7 +4,7 @@ define(['mail_view/ui/recipients/recipients_iterator'], function (RecipientsIter 'use strict'; function createRecipient() { - return jasmine.createSpyObj('recipient', ['select', 'unselect', 'destroy']); + return jasmine.createSpyObj('recipient', ['doSelect', 'doUnselect', 'destroy']); } var recipientsIterator, @@ -15,7 +15,7 @@ define(['mail_view/ui/recipients/recipients_iterator'], function (RecipientsIter } function resetMock(m) { - m.destroy.calls.reset();m.select.calls.reset();m.unselect.calls.reset(); + m.destroy.calls.reset();m.doSelect.calls.reset();m.doUnselect.calls.reset(); } beforeEach(function () { @@ -29,8 +29,8 @@ define(['mail_view/ui/recipients/recipients_iterator'], function (RecipientsIter recipientsIterator = createIterator(elements); recipientsIterator.moveLeft(); - expect(elements[0].select).toHaveBeenCalled(); - expect(elements[1].unselect).toHaveBeenCalled(); + expect(elements[0].doSelect).toHaveBeenCalled(); + expect(elements[1].doUnselect).toHaveBeenCalled(); }); it('doesnt do anything if there are no elements in the left', function () { @@ -41,10 +41,10 @@ define(['mail_view/ui/recipients/recipients_iterator'], function (RecipientsIter recipientsIterator.moveLeft(); - expect(elements[0].select).not.toHaveBeenCalled(); - expect(elements[0].unselect).not.toHaveBeenCalled(); - expect(elements[1].select).not.toHaveBeenCalled(); - expect(elements[1].unselect).not.toHaveBeenCalled(); + expect(elements[0].doSelect).not.toHaveBeenCalled(); + expect(elements[0].doUnselect).not.toHaveBeenCalled(); + expect(elements[1].doSelect).not.toHaveBeenCalled(); + expect(elements[1].doUnselect).not.toHaveBeenCalled(); }); }); @@ -58,8 +58,8 @@ define(['mail_view/ui/recipients/recipients_iterator'], function (RecipientsIter recipientsIterator.moveRight(); - expect(elements[0].unselect).toHaveBeenCalled(); - expect(elements[1].select).toHaveBeenCalled(); + expect(elements[0].doUnselect).toHaveBeenCalled(); + expect(elements[1].doSelect).toHaveBeenCalled(); }); it('unselects current element and focus on exit input if there are no elements on the right', function () { @@ -69,7 +69,7 @@ define(['mail_view/ui/recipients/recipients_iterator'], function (RecipientsIter recipientsIterator = createIterator(elements); recipientsIterator.moveRight(); - expect(elements[1].unselect).toHaveBeenCalled(); + expect(elements[1].doUnselect).toHaveBeenCalled(); expect(exitInput.focus).toHaveBeenCalled(); }); }); @@ -84,7 +84,7 @@ define(['mail_view/ui/recipients/recipients_iterator'], function (RecipientsIter recipientsIterator.deleteCurrent(); expect(toBeDeleted.destroy).toHaveBeenCalled(); - expect(elements[0].select).toHaveBeenCalled(); + expect(elements[0].doSelect).toHaveBeenCalled(); }); it('focus on the input if there are no more elements', function () { |