Skip to content

Commit

Permalink
- fix Drawer.spec.js
Browse files Browse the repository at this point in the history
  • Loading branch information
avramz committed Aug 1, 2024
1 parent 75e8ee4 commit 42e25c5
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions packages/primevue/src/drawer/Drawer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,19 @@ describe('Drawer.vue', () => {
expect(enableDocumentSettingsSpy).toHaveBeenCalled();
});

// it('When keydown is triggered , hide method should be triggered', async () => {
// const hideSpy = vi.spyOn(wrapper.vm, 'hide');
//
// await wrapper.vm.onKeydown({ code: 'Escape' });
//
// expect(hideSpy).toHaveBeenCalled();
// });
//
// it('When keydown is triggered , hide method should be triggered', async () => {
// const hideSpy = vi.spyOn(wrapper.vm, 'hide');
//
// await wrapper.find('.p-drawer-close').trigger('click');
//
// expect(hideSpy).toHaveBeenCalled();
// });
it('When keydown is triggered , hide method should be triggered', async () => {
await wrapper.vm.onKeydown({ code: 'Escape' });

expect(wrapper.emitted()['update:visible'].length).toBe(1);
});

it('When keydown is triggered , hide method should be triggered', async () => {
const closeBtn = wrapper.find('.p-drawer-close-button');

await closeBtn.trigger('click');

expect(wrapper.emitted()['update:visible'].length).toBe(1);
});

it('When component is unmount , unbindOutsideClickListenerSpy method should be triggered', async () => {
const unbindOutsideClickListenerSpy = vi.spyOn(wrapper.vm, 'unbindOutsideClickListener');
Expand Down

0 comments on commit 42e25c5

Please sign in to comment.