From 30afab81784d6fdd64acb4c3fc19f2218e9f35a4 Mon Sep 17 00:00:00 2001 From: uros Date: Thu, 1 Aug 2024 19:14:29 +0200 Subject: [PATCH] - fix OrderList.spec.js, OrganizationChart.spec.js --- packages/primevue/src/orderlist/OrderList.spec.js | 14 +++++++------- .../organizationchart/OrganizationChart.spec.js | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/primevue/src/orderlist/OrderList.spec.js b/packages/primevue/src/orderlist/OrderList.spec.js index 46f57f0c5..4ec863b0c 100644 --- a/packages/primevue/src/orderlist/OrderList.spec.js +++ b/packages/primevue/src/orderlist/OrderList.spec.js @@ -113,21 +113,21 @@ describe('OrderList.vue', () => { it('should exist', () => { expect(wrapper.find('.p-orderlist.p-component').exists()).toBe(true); expect(wrapper.find('.p-orderlist-controls').exists()).toBe(true); - expect(wrapper.findAll('li.p-orderlist-item').length).toBe(6); + expect(wrapper.findAll('li.p-listbox-option').length).toBe(6); }); it('should select item', async () => { - await wrapper.vm.onItemClick({}, wrapper.vm.modelValue[0], 0); + const listBoxOption = wrapper.find('li.p-listbox-option'); - expect(wrapper.emitted()['update:selection'][0]).toEqual([[wrapper.vm.modelValue[0]]]); + expect(listBoxOption.classes()).not.toContain('p-listbox-option-selected'); - await wrapper.setProps({ selection: [wrapper.vm.modelValue[0]] }); + await listBoxOption.trigger('click'); - expect(wrapper.findAll('li.p-orderlist-item')[0].classes()).toContain('p-highlight'); + expect(wrapper.findAll('li.p-listbox-option')[0].classes()).toContain('p-listbox-option-selected'); }); it('should slot works', () => { - expect(wrapper.find('.p-orderlist-header').text()).toBe('List of Products'); + expect(wrapper.find('.p-listbox-header').text()).toBe('List of Products'); expect(wrapper.findAll('.product-item').length).toBe(6); }); @@ -135,7 +135,7 @@ describe('OrderList.vue', () => { await wrapper.setProps({ selection: [wrapper.vm.modelValue[2]] }); await wrapper.setData({ d_selection: [wrapper.vm.modelValue[2]] }); - expect(wrapper.findAll('li.p-orderlist-item')[2].classes()).toContain('p-highlight'); + expect(wrapper.findAll('li.p-listbox-option')[2].classes()).toContain('p-listbox-option-selected'); await wrapper.vm.moveUp({}); diff --git a/packages/primevue/src/organizationchart/OrganizationChart.spec.js b/packages/primevue/src/organizationchart/OrganizationChart.spec.js index 077b25edc..0ecaaa7bb 100644 --- a/packages/primevue/src/organizationchart/OrganizationChart.spec.js +++ b/packages/primevue/src/organizationchart/OrganizationChart.spec.js @@ -123,7 +123,7 @@ describe('OrganizationChart.vue', () => { it('should exist', () => { expect(wrapper.find('.p-organizationchart.p-component').exists()).toBe(true); expect(wrapper.find('table.p-organizationchart-table').exists()).toBe(true); - expect(wrapper.findAll('.p-node-toggler-icon').length).toBe(5); + expect(wrapper.findAll('.p-organizationchart-node-toggle-button').length).toBe(5); }); it('should collapsed and expand', async () => { @@ -141,7 +141,7 @@ describe('OrganizationChart.vue', () => { }); it('should item select and unselect', async () => { - const contents = wrapper.findAll('.p-organizationchart-node-content'); + const contents = wrapper.findAll('.p-organizationchart-node.p-organizationchart-node-selectable'); await wrapper.vm.onNodeClick(wrapper.vm.value); @@ -150,7 +150,7 @@ describe('OrganizationChart.vue', () => { await wrapper.setProps({ selectionKeys: { 0: true } }); - expect(contents[0].classes()).toContain('p-highlight'); + expect(contents[0].classes()).toContain('p-organizationchart-node-selected'); await wrapper.vm.onNodeClick(wrapper.vm.value);