Skip to content

Commit c103473

Browse files
committed
test: fix test cases for vue3 test utils
1 parent 25b2afd commit c103473

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

tests/unit/tree-search.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('树搜索测试', () => {
5252
propsData: { data }
5353
})
5454
const vm = wrapper.vm
55-
const tree = wrapper.findComponent({ ref: 'tree' }).vm
55+
const tree = wrapper.findComponent({ ref: 'treeRef' }).vm
5656

5757
const input = wrapper.find('.ctree-tree-search__input')
5858
const inputElement = input.element as HTMLInputElement
@@ -115,14 +115,14 @@ describe('树远程搜索增强测试包', () => {
115115
checkable: true,
116116
modelValue: ['93', '124']
117117
},
118-
listeners: {
119-
input: (emitValue: Array<string | number>) => {
118+
attrs: {
119+
'onUpdate:modelValue': (emitValue: Array<string | number>) => {
120120
wrapper.setProps({ modelValue: emitValue })
121121
}
122122
}
123123
}) as any
124124
const vm = wrapper.vm
125-
const treeWrapper = wrapper.findComponent({ ref: 'tree' }) as any
125+
const treeWrapper = wrapper.findComponent({ ref: 'treeRef' }) as any
126126

127127
const input = wrapper.find('.ctree-tree-search__input')
128128
const inputElement = input.element as HTMLInputElement

tests/unit/tree.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ describe('树多选测试', () => {
273273
data,
274274
checkable: true
275275
},
276-
listeners: {
277-
input: (emitValue: Array<string | number>) => {
276+
attrs: {
277+
'onUpdate:modelValue': (emitValue: Array<string | number>) => {
278278
modelValue = emitValue
279279

280280
let expectedCheck = flatten(data[0])
@@ -301,8 +301,8 @@ describe('树多选测试', () => {
301301
data,
302302
checkable: true
303303
},
304-
listeners: {
305-
input: (emitValue: Array<string | number>) => {
304+
attrs: {
305+
'onUpdate:modelValue': (emitValue: Array<string | number>) => {
306306
modelValue = emitValue
307307

308308
let expectedCheck = flatten(data[0]).map(d => d.id)
@@ -328,8 +328,8 @@ describe('树多选测试', () => {
328328
data,
329329
checkable: true
330330
},
331-
listeners: {
332-
input: (emitValue: Array<string | number>) => {
331+
attrs: {
332+
'onUpdate:modelValue': (emitValue: Array<string | number>) => {
333333
modelValue = emitValue
334334

335335
let expectedCheck = flatten(data[0])

0 commit comments

Comments
 (0)