From af34fddf3d5a0d4231e2bcd4d03c4c078acf6e27 Mon Sep 17 00:00:00 2001 From: betavs Date: Fri, 1 Nov 2024 17:32:38 +0800 Subject: [PATCH 1/2] test(multi-select): update unit tests --- .../primevue/src/multiselect/MultiSelect.spec.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/primevue/src/multiselect/MultiSelect.spec.js b/packages/primevue/src/multiselect/MultiSelect.spec.js index 2c0d004cf..a4ba2926d 100644 --- a/packages/primevue/src/multiselect/MultiSelect.spec.js +++ b/packages/primevue/src/multiselect/MultiSelect.spec.js @@ -34,7 +34,7 @@ describe('MultiSelect.vue', () => { expect(wrapper.find('.p-multiselect-label.p-placeholder').text()).toBe('Select Cities'); expect(wrapper.find('.p-multiselect-panel').exists()).toBe(false); - await wrapper.vm.onContainerClick(); + await wrapper.vm.$refs.container.click(); expect(wrapper.findAll('li.p-multiselect-option').length).toBe(5); expect(wrapper.findAll('li.p-multiselect-option')[0].attributes()['aria-label']).toBe('New York'); @@ -47,7 +47,7 @@ describe('MultiSelect.vue', () => { expect(wrapper.emitted()['update:modelValue'][0]).toEqual([[wrapper.vm.options[0]]]); await wrapper.setProps({ modelValue: [wrapper.vm.options[0]] }); - await wrapper.vm.onContainerClick(); + await wrapper.vm.$refs.container.click(); expect(wrapper.findAll('li.p-multiselect-option')[0].attributes()['data-p-selected']).toBe('true'); expect(wrapper.find('.p-multiselect-label').text()).toBe('New York'); @@ -61,7 +61,7 @@ describe('MultiSelect.vue', () => { expect(wrapper.emitted()['update:modelValue'][0]).toEqual([[wrapper.vm.options[0], wrapper.vm.options[1]]]); await wrapper.setProps({ modelValue: [wrapper.vm.options[0], wrapper.vm.options[1]] }); - await wrapper.vm.onContainerClick(); + await wrapper.vm.$refs.container.click(); expect(wrapper.findAll('li.p-multiselect-option')[0].attributes()['data-p-selected']).toBe('true'); expect(wrapper.findAll('li.p-multiselect-option')[1].attributes()['data-p-selected']).toBe('true'); @@ -106,7 +106,7 @@ describe('MultiSelect.vue', () => { filterIcon: 'pi pi-discord' }); - await wrapper.vm.onContainerClick(); + await wrapper.vm.$refs.container.click(); const icon = wrapper.find('.p-multiselect-filter-container [data-pc-section="filtericon"]'); @@ -123,7 +123,7 @@ describe('MultiSelect.vue', () => { modelValue: wrapper.vm.options }); - await wrapper.vm.onContainerClick(); + await wrapper.vm.$refs.container.click(); wrapper.findAll('.p-checkbox-icon').forEach((icon) => { expect(icon.classes()).toContain('pi-discord'); @@ -172,7 +172,7 @@ describe('MultiSelect.vue', () => { optionGroupChildren: 'items' }); - await wrapper.vm.onContainerClick(); + await wrapper.vm.$refs.container.click(); expect(wrapper.find('.p-multiselect-option-group').exists()).toBe(true); }); @@ -185,7 +185,7 @@ describe('MultiSelect.vue', () => { autoFilterFocus: true }); - await wrapper.vm.onContainerClick(); + await wrapper.vm.$refs.container.click(); const input = await wrapper.find('input.p-multiselect-filter'); input.setValue('Ber'); @@ -203,7 +203,7 @@ describe('MultiSelect.vue', () => { autoFilterFocus: true }); - await wrapper.vm.onContainerClick(); + await wrapper.vm.$refs.container.click(); const input = await wrapper.find('input.p-multiselect-filter'); input.value = 'Ber'; From 10bd119ab69c3380a8c46fa1bb906d0abac614cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B4=D0=BE=D0=B2=D0=B8=D0=BD=20=D0=9D=D0=B8=D0=BA?= =?UTF-8?q?=D0=B8=D1=82=D0=B0=20=D0=90=D0=BD=D0=B0=D1=82=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=D0=B8=D1=87?= Date: Sat, 2 Nov 2024 11:19:14 +0300 Subject: [PATCH 2/2] fix(Checkbox): Added "update:indeterminate" emit. --- packages/primevue/src/checkbox/Checkbox.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/primevue/src/checkbox/Checkbox.d.ts b/packages/primevue/src/checkbox/Checkbox.d.ts index 430a71db3..d215755e5 100755 --- a/packages/primevue/src/checkbox/Checkbox.d.ts +++ b/packages/primevue/src/checkbox/Checkbox.d.ts @@ -262,6 +262,11 @@ export interface CheckboxEmitsOptions { * @param {*} value - New value. */ 'update:modelValue'(value: any): void; + /** + * Emitted when the "indeterminate" changes. + * @param {false} value - New value. + */ + 'update:indeterminate'(value: false): void; /** * Emitted when the value changes in uncontrolled mode. * @param {*} value - New value.