From 439adaf409ea28148228c941fd266a60fdb6d669 Mon Sep 17 00:00:00 2001 From: gerard Date: Fri, 10 Aug 2018 17:13:25 +0200 Subject: [PATCH] Tarea #471 credit/create/index.js Front unit test --- client/client/src/credit/create/index.spec.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/client/client/src/credit/create/index.spec.js b/client/client/src/credit/create/index.spec.js index 6efd355d1..9aaa095b7 100644 --- a/client/client/src/credit/create/index.spec.js +++ b/client/client/src/credit/create/index.spec.js @@ -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');