wip: tests for compiler compat
This commit is contained in:
@@ -87,43 +87,6 @@ test('PROPS_DEFAULT_THIS', () => {
|
||||
).toHaveBeenWarned()
|
||||
})
|
||||
|
||||
test('V_FOR_REF', async () => {
|
||||
const vm = new Vue({
|
||||
data() {
|
||||
return {
|
||||
ok: true,
|
||||
list: [1, 2, 3]
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<template v-if="ok">
|
||||
<li v-for="i in list" ref="list">{{ i }}</li>
|
||||
</template>
|
||||
`
|
||||
}).$mount() as any
|
||||
|
||||
const mapRefs = () => vm.$refs.list.map((el: HTMLElement) => el.textContent)
|
||||
expect(mapRefs()).toMatchObject(['1', '2', '3'])
|
||||
|
||||
expect(deprecationData[DeprecationTypes.V_FOR_REF].message).toHaveBeenWarned()
|
||||
|
||||
vm.list.push(4)
|
||||
await nextTick()
|
||||
expect(mapRefs()).toMatchObject(['1', '2', '3', '4'])
|
||||
|
||||
vm.list.shift()
|
||||
await nextTick()
|
||||
expect(mapRefs()).toMatchObject(['2', '3', '4'])
|
||||
|
||||
vm.ok = !vm.ok
|
||||
await nextTick()
|
||||
expect(mapRefs()).toMatchObject([])
|
||||
|
||||
vm.ok = !vm.ok
|
||||
await nextTick()
|
||||
expect(mapRefs()).toMatchObject(['2', '3', '4'])
|
||||
})
|
||||
|
||||
test('V_ON_KEYCODE_MODIFIER', () => {
|
||||
const spy = jest.fn()
|
||||
const vm = new Vue({
|
||||
|
||||
Reference in New Issue
Block a user