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 /web-ui/test/spec/mail_view/ui | |
parent | 337663b578f1fcf0681e3d12ea91197d5e8a719c (diff) |
Fixing js unit tests
Diffstat (limited to 'web-ui/test/spec/mail_view/ui')
-rw-r--r-- | web-ui/test/spec/mail_view/ui/recipients/recipients_iterator.spec.js | 24 |
1 files changed, 12 insertions, 12 deletions
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 () { |