From 296967ab4b573743218e75ba7f65edab5f6c596e Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 27 May 2020 14:54:29 +0200 Subject: [PATCH] fixed a front unit test with jest.fn() as spy --- modules/travel/front/thermograph/create/index.spec.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/travel/front/thermograph/create/index.spec.js b/modules/travel/front/thermograph/create/index.spec.js index f835f64118..f6ee1f2c0f 100644 --- a/modules/travel/front/thermograph/create/index.spec.js +++ b/modules/travel/front/thermograph/create/index.spec.js @@ -66,8 +66,12 @@ describe('Ticket', () => { describe('onAddThermographClick()', () => { it('should call the show() function of the create thermograph dialog', () => { - controller.$.newThermographDialog = {show: () => {}}; - jest.spyOn(controller.$.newThermographDialog, 'show'); + controller.$.newThermographDialog = {show: jest.fn()}; + controller.$.modelsModel = {refresh: jest.fn()}; + controller.$.temperaturesModel = {refresh: jest.fn()}; + // jest.spyOn(controller.$.newThermographDialog, 'show'); + // jest.spyOn(controller.$.modelsModel, 'refresh'); + // jest.spyOn(controller.$.temperaturesModel, 'refresh'); const event = new Event('click'); jest.spyOn(event, 'preventDefault');