Skip to content

Commit f87d6b5

Browse files
committed
test: fix runtime-dom v-on test
1 parent 2302dea commit f87d6b5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/runtime-dom/__tests__/directives/vOn.spec.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ describe('runtime-dom: v-on directive', () => {
2222
const child = document.createElement('input')
2323
parent.appendChild(child)
2424
const childNextValue = withModifiers(jest.fn(), ['prevent', 'stop'])
25-
patchEvent(child, 'click', null, childNextValue, null)
25+
patchEvent(child, 'onClick', null, childNextValue, null)
2626
const parentNextValue = jest.fn()
27-
patchEvent(parent, 'click', null, parentNextValue, null)
27+
patchEvent(parent, 'onClick', null, parentNextValue, null)
2828
expect(triggerEvent(child, 'click').defaultPrevented).toBe(true)
2929
expect(parentNextValue).not.toBeCalled()
3030
})
@@ -35,7 +35,7 @@ describe('runtime-dom: v-on directive', () => {
3535
parent.appendChild(child)
3636
const fn = jest.fn()
3737
const handler = withModifiers(fn, ['self'])
38-
patchEvent(parent, 'click', null, handler, null)
38+
patchEvent(parent, 'onClick', null, handler, null)
3939
triggerEvent(child, 'click')
4040
expect(fn).not.toBeCalled()
4141
})
@@ -48,7 +48,7 @@ describe('runtime-dom: v-on directive', () => {
4848
'esc',
4949
'arrow-left'
5050
])
51-
patchEvent(el, 'keyup', null, nextValue, null)
51+
patchEvent(el, 'onKeyup', null, nextValue, null)
5252

5353
triggerEvent(el, 'keyup', e => (e.key = 'a'))
5454
expect(fn).not.toBeCalled()
@@ -77,15 +77,15 @@ describe('runtime-dom: v-on directive', () => {
7777
// Case 1: <div @keyup.exact="test"/>
7878
const fn1 = jest.fn()
7979
const next1 = withModifiers(fn1, ['exact'])
80-
patchEvent(el, 'keyup', null, next1, null)
80+
patchEvent(el, 'onKeyup', null, next1, null)
8181
triggerEvent(el, 'keyup')
8282
expect(fn1.mock.calls.length).toBe(1)
8383
triggerEvent(el, 'keyup', e => (e.ctrlKey = true))
8484
expect(fn1.mock.calls.length).toBe(1)
8585
// Case 2: <div @keyup.ctrl.a.exact="test"/>
8686
const fn2 = jest.fn()
8787
const next2 = withKeys(withModifiers(fn2, ['ctrl', 'exact']), ['a'])
88-
patchEvent(el, 'keyup', null, next2, null)
88+
patchEvent(el, 'onKeyup', null, next2, null)
8989
triggerEvent(el, 'keyup', e => (e.key = 'a'))
9090
expect(fn2).not.toBeCalled()
9191
triggerEvent(el, 'keyup', e => {
@@ -109,7 +109,7 @@ describe('runtime-dom: v-on directive', () => {
109109
const el = document.createElement('div')
110110
const fn = jest.fn()
111111
const handler = withModifiers(fn, [button])
112-
patchEvent(el, 'mousedown', null, handler, null)
112+
patchEvent(el, 'onMousedown', null, handler, null)
113113
buttons.filter(b => b !== button).forEach(button => {
114114
triggerEvent(el, 'mousedown', e => (e.button = buttonCodes[button]))
115115
})

0 commit comments

Comments
 (0)