From 738811ee0af9220b5d628ad558b692db42cfaffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Wed, 19 Apr 2023 17:20:55 +0300 Subject: [PATCH] Chip & Inplace test fixes --- components/lib/chip/Chip.spec.js | 2 +- components/lib/inplace/Inplace.spec.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/components/lib/chip/Chip.spec.js b/components/lib/chip/Chip.spec.js index e09d6729e..55a7650bc 100644 --- a/components/lib/chip/Chip.spec.js +++ b/components/lib/chip/Chip.spec.js @@ -34,7 +34,7 @@ describe('Chip.vue', () => { it('When removable is true and keydown triggered OnKeydown method should be called', async () => { const closeSpy = vi.spyOn(wrapper.vm, 'onKeydown'); - await wrapper.find('.p-chip-remove-icon').trigger('keydown'); + wrapper.vm.onKeydown({ key: 'Enter' }); expect(closeSpy).toHaveBeenCalled(); }); diff --git a/components/lib/inplace/Inplace.spec.js b/components/lib/inplace/Inplace.spec.js index add7f5de4..26c1f884b 100644 --- a/components/lib/inplace/Inplace.spec.js +++ b/components/lib/inplace/Inplace.spec.js @@ -70,11 +70,12 @@ describe('Inplace.vue', () => { await wrapper.vm.open({}); expect(wrapper.find('.p-inputtext').exists()).toBe(true); - expect(wrapper.find('.pi.pi-times').exists()).toBe(true); + expect(wrapper.find('.p-inplace-content').exists()).toBe(true); await wrapper.vm.close({}); - expect(wrapper.find('.pi.pi-times').exists()).toBe(false); + expect(wrapper.find('.p-inplace-display').exists()).toBe(true); + expect(wrapper.find('.p-inplace-content').exists()).toBe(false); }); it('should have custom close icon', async () => {