Tarea #471 credit/create/index.js Front unit test
This commit is contained in:
parent
ac90bb3b18
commit
439adaf409
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue