From cdcee4ca8af23c58877b795e10a01491e0b1b7b5 Mon Sep 17 00:00:00 2001 From: uros Date: Thu, 1 Aug 2024 21:20:37 +0200 Subject: [PATCH] - fix Image.spec.js, Inplace.spec.js, InputChips.spec.js --- packages/primevue/src/image/Image.spec.js | 6 +-- packages/primevue/src/inplace/Inplace.spec.js | 52 ------------------- .../src/inputchips/InputChips.spec.js | 14 ++--- 3 files changed, 10 insertions(+), 62 deletions(-) diff --git a/packages/primevue/src/image/Image.spec.js b/packages/primevue/src/image/Image.spec.js index 59c160562..a854f8ab2 100644 --- a/packages/primevue/src/image/Image.spec.js +++ b/packages/primevue/src/image/Image.spec.js @@ -34,9 +34,9 @@ describe('Image.vue', () => { } }); - expect(wrapper.find('.p-image-preview-container').exists()).toBe(true); - expect(wrapper.find('.p-image-preview-indicator').exists()).toBe(true); - expect(wrapper.find('.p-image-mask').exists()).toBe(false); + expect(wrapper.find('.p-image-preview').exists()).toBe(true); + expect(wrapper.find('.p-image-toolbar').exists()).toBe(false); + expect(wrapper.find('.p-image-preview-mask').exists()).toBe(true); await wrapper.setData({ maskVisible: true }); diff --git a/packages/primevue/src/inplace/Inplace.spec.js b/packages/primevue/src/inplace/Inplace.spec.js index a4adb3809..c06cdffcf 100644 --- a/packages/primevue/src/inplace/Inplace.spec.js +++ b/packages/primevue/src/inplace/Inplace.spec.js @@ -35,56 +35,4 @@ describe('Inplace.vue', () => { expect(wrapper.emitted()['update:active'][1]).toEqual([false]); }); - - it('closable inplace', async () => { - const wrapper = mount(Inplace, { - global: { - components: { - InputText - } - }, - props: { - closable: true - }, - slots: { - display: `{{'Click to Edit'}}`, - content: `` - } - }); - - expect(wrapper.find('.p-inplace-closable').exists()).toBe(true); - expect(wrapper.find('.p-inplace-display').text()).toBe('Click to Edit'); - - await wrapper.vm.open({}); - - expect(wrapper.find('.p-inputtext').exists()).toBe(true); - expect(wrapper.find('.p-inplace-content').exists()).toBe(true); - - await wrapper.vm.close({}); - - 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 () => { - const wrapper = mount(Inplace, { - global: { - components: { - InputText - } - }, - props: { - closable: true, - closeIcon: 'pi pi-discord' - }, - slots: { - display: `{{'Click to Edit'}}`, - content: `` - } - }); - - await wrapper.vm.open({}); - - expect(wrapper.find('.pi.pi-discord').exists()).toBe(true); - }); }); diff --git a/packages/primevue/src/inputchips/InputChips.spec.js b/packages/primevue/src/inputchips/InputChips.spec.js index 8d1a9483e..9000d6c3a 100644 --- a/packages/primevue/src/inputchips/InputChips.spec.js +++ b/packages/primevue/src/inputchips/InputChips.spec.js @@ -14,8 +14,8 @@ describe('InputChips.vue', () => { it('should exist', () => { expect(wrapper.find('.p-inputchips.p-component.p-inputwrapper').exists()).toBe(true); - expect(wrapper.find('ul.p-inputchips-multiple-container').exists()).toBe(true); - expect(wrapper.find('li.p-inputchips-input-token').exists()).toBe(true); + expect(wrapper.find('ul.p-inputwrapper-filled').exists()).toBe(false); + expect(wrapper.find('li.p-inputchips-input-item').exists()).toBe(true); }); it('should add item', async () => { @@ -26,18 +26,18 @@ describe('InputChips.vue', () => { await wrapper.setProps({ modelValue: ['PrimeVue'] }); expect(addItem).toHaveBeenCalled(); - expect(wrapper.findAll('.p-inputchips-token').length).toBe(1); - expect(wrapper.find('.p-inputchips-token-label').exists()).toBe(true); - expect(wrapper.find('.p-inputchips-token-label').text()).toBe('PrimeVue'); + expect(wrapper.findAll('.p-chip').length).toBe(1); + expect(wrapper.find('.p-chip-label').exists()).toBe(true); + expect(wrapper.find('.p-chip-label').text()).toBe('PrimeVue'); }); it('should have correct custom chip removal icon', async () => { await wrapper.setProps({ modelValue: ['foo', 'bar'], - removeTokenIcon: 'pi pi-discord' + chipIcon: 'pi pi-discord' }); - const icon = wrapper.find('.p-inputchips-token-icon'); + const icon = wrapper.find('[data-pc-section="removeicon"]'); expect(icon.classes()).toContain('pi-discord'); });