Skip to content

Commit 86b4f83

Browse files
committed
test: update tests
1 parent 94c3ac2 commit 86b4f83

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/devextreme/js/__internal/scheduler/appointment_popup/appointment_popup.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,6 +1492,7 @@ describe('Appointment Popup Form', () => {
14921492

14931493
it('should call onShowing callback when popup is shown', async () => {
14941494
const onShowing = jest.fn();
1495+
const onAppointmentFormOpening = jest.fn();
14951496
const { scheduler } = await createScheduler({
14961497
...getDefaultConfig(),
14971498
editing: {
@@ -1501,12 +1502,15 @@ describe('Appointment Popup Form', () => {
15011502
onShowing,
15021503
},
15031504
},
1505+
onAppointmentFormOpening,
15041506
});
15051507

15061508
scheduler.showAppointmentPopup(commonAppointment);
15071509

15081510
expect(onShowing).toHaveBeenCalled();
15091511
expect(onShowing).toHaveBeenCalledTimes(1);
1512+
expect(onAppointmentFormOpening).toHaveBeenCalled();
1513+
expect(onAppointmentFormOpening).toHaveBeenCalledTimes(1);
15101514
});
15111515

15121516
it('should call onHiding callback when popup is hidden', async () => {
@@ -1522,14 +1526,21 @@ describe('Appointment Popup Form', () => {
15221526
},
15231527
});
15241528

1529+
const focusSpy = jest.spyOn(scheduler, 'focus');
1530+
15251531
scheduler.showAppointmentPopup(commonAppointment);
15261532

15271533
expect(onHiding).not.toHaveBeenCalled();
1534+
expect(focusSpy).not.toHaveBeenCalled();
15281535

15291536
scheduler.hideAppointmentPopup();
15301537

15311538
expect(onHiding).toHaveBeenCalled();
15321539
expect(onHiding).toHaveBeenCalledTimes(1);
1540+
expect(focusSpy).toHaveBeenCalled();
1541+
expect(focusSpy).toHaveBeenCalledTimes(1);
1542+
1543+
focusSpy.mockRestore();
15331544
});
15341545
});
15351546
});

0 commit comments

Comments
 (0)