Skip to content

Commit 23befe9

Browse files
committed
fix(NcCheckboxRadioSwitch): adapt backport tests for Vue Test Utils v1
stable8 uses Vue Test Utils v1 which requires propsData instead of props and wrapper.destroy() instead of wrapper.unmount(). Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
1 parent 6c08c8a commit 23befe9

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

tests/unit/components/NcCheckboxRadioSwitch/checkbox.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ describe('NcCheckboxRadioSwitch', () => {
8787

8888
it('emits correct value on keyboard toggle for boolean checkbox', async () => {
8989
const wrapper = mount(NcCheckboxRadioSwitch, {
90-
props: {
90+
propsData: {
9191
modelValue: false,
9292
},
9393
slots: {
@@ -96,12 +96,12 @@ describe('NcCheckboxRadioSwitch', () => {
9696
})
9797

9898
await wrapper.find('input').trigger('change')
99-
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual([true])
99+
expect(wrapper.emitted('update:modelValue')[0]).toEqual([true])
100100
})
101101

102102
it('emits correct value on keyboard toggle for checkbox group', async () => {
103103
const wrapper = mount(NcCheckboxRadioSwitch, {
104-
props: {
104+
propsData: {
105105
modelValue: ['a'],
106106
value: 'b',
107107
name: 'test-group',
@@ -118,14 +118,14 @@ describe('NcCheckboxRadioSwitch', () => {
118118
inputEl.checked = true // Browser would do this before firing change
119119
await input.trigger('change')
120120

121-
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual([['a', 'b']])
121+
expect(wrapper.emitted('update:modelValue')[0]).toEqual([['a', 'b']])
122122

123-
wrapper.unmount()
123+
wrapper.destroy()
124124
})
125125

126126
it('emits correct value on keyboard un-toggle for checkbox group', async () => {
127127
const wrapper = mount(NcCheckboxRadioSwitch, {
128-
props: {
128+
propsData: {
129129
modelValue: ['a', 'b'],
130130
value: 'b',
131131
name: 'test-group',
@@ -142,8 +142,8 @@ describe('NcCheckboxRadioSwitch', () => {
142142
inputEl.checked = false
143143
await input.trigger('change')
144144

145-
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual([['a']])
145+
expect(wrapper.emitted('update:modelValue')[0]).toEqual([['a']])
146146

147-
wrapper.unmount()
147+
wrapper.destroy()
148148
})
149149
})

0 commit comments

Comments
 (0)