Tarea #471 credit/create/index.js Front unit test

This commit is contained in:
gerard 2018-08-10 17:13:25 +02:00
parent ac90bb3b18
commit 439adaf409
1 changed files with 17 additions and 0 deletions

View File

@ -67,6 +67,23 @@ describe('Client', () => {
});
});
describe('cancel()', () => {
it('should call preventDefault, stopImmediatePropagation and goToIndex', () => {
let event = {
preventDefault: () => {},
stopImmediatePropagation: () => {}
};
spyOn(event, 'preventDefault');
spyOn(event, 'stopImmediatePropagation');
spyOn(controller, 'goToIndex');
controller.cancel(event);
expect(controller.goToIndex).toHaveBeenCalledWith();
expect(event.preventDefault).toHaveBeenCalledWith();
expect(event.stopImmediatePropagation).toHaveBeenCalledWith();
});
});
describe('returnDialog()', () => {
it('should call addCredit() when is called with ACCEPT', () => {
spyOn(controller, 'addCredit');