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()', () => {
|
describe('onAddThermographClick()', () => {
|
||||||
it('should call the show() function of the create thermograph dialog', () => {
|
it('should call the show() function of the create thermograph dialog', () => {
|
||||||
controller.$.newThermographDialog = {show: () => {}};
|
controller.$.newThermographDialog = {show: jest.fn()};
|
||||||
jest.spyOn(controller.$.newThermographDialog, 'show');
|
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');
|
const event = new Event('click');
|
||||||
jest.spyOn(event, 'preventDefault');
|
jest.spyOn(event, 'preventDefault');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue