test(compiler-core): add test case for v-on event case conversion

This commit is contained in:
Evan You 2020-10-06 18:31:04 -04:00
parent 62f26173ba
commit f9566f00df

View File

@ -406,6 +406,22 @@ describe('compiler: transform v-on', () => {
expect(onError).not.toHaveBeenCalled()
})
test('case conversion for kebab-case events', () => {
const { node } = parseWithVOn(`<div v-on:foo-bar="onMount"/>`)
expect((node.codegenNode as VNodeCall).props).toMatchObject({
properties: [
{
key: {
content: `onFooBar`
},
value: {
content: `onMount`
}
}
]
})
})
test('case conversion for vnode hooks', () => {
const { node } = parseWithVOn(`<div v-on:vnode-mounted="onMount"/>`)
expect((node.codegenNode as VNodeCall).props).toMatchObject({