fixed a front unit test with jest.fn() as spy
This commit is contained in:
parent
dfa74221dd
commit
296967ab4b
|
@ -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');
|
||||
|
||||
|
|
Loading…
Reference in New Issue