Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/runtime-vapor/__tests__/directives/vModel.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { reactive, ref } from '@vue/reactivity'
import {
delegate,
delegateEvents,
on,
setClass,
setDOMProp,
Expand All @@ -15,7 +16,7 @@ import { nextTick } from '@vue/runtime-dom'
const define = makeRender()

const triggerEvent = (type: string, el: Element) => {
const event = new Event(type)
const event = new Event(type, { bubbles: true })
el.dispatchEvent(event)
}

Expand All @@ -33,10 +34,11 @@ describe('directive: v-model', () => {
const data = ref<string | null | undefined>('')
const { host } = define(() => {
const t0 = template('<input />')
delegateEvents('input')
const n0 = t0() as HTMLInputElement
withDirectives(n0, [[vModelDynamic, () => data.value]])
delegate(n0, 'update:modelValue', () => val => (data.value = val))
on(n0, 'input', () => () => spy(data.value))
delegate(n0, 'input', () => () => spy(data.value))
return n0
}).render()

Expand Down