Skip to content

Commit ee324fb

Browse files
committed
chore: update test
1 parent f070560 commit ee324fb

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+
exports[`compiler-dom: transform v-on > should wrap both for dynamic key event w/ once modifiers 1`] = `
4+
"const _Vue = Vue
5+
6+
return function render(_ctx, _cache) {
7+
with (_ctx) {
8+
const { toHandlerKey: _toHandlerKey, checkDynamicEvent: _checkDynamicEvent, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
9+
10+
return (_openBlock(), _createElementBlock("div", { [_checkDynamicEvent(_toHandlerKey(e),"Once")]: test }, null, 16 /* FULL_PROPS */))
11+
}
12+
}"
13+
`;

packages/compiler-dom/__tests__/transforms/vOn.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
type ObjectExpression,
77
TO_HANDLER_KEY,
88
type VNodeCall,
9+
generate,
910
helperNameMap,
1011
baseParse as parse,
1112
transform,
@@ -168,6 +169,12 @@ describe('compiler-dom: transform v-on', () => {
168169
})
169170
})
170171

172+
it('should wrap both for dynamic key event w/ once modifiers', () => {
173+
const { root: ast } = parseWithVOn(`<div @[e].once="test"/>`)
174+
175+
expect(generate(ast).code).toMatchSnapshot()
176+
})
177+
171178
it('should not wrap normal guard if there is only keys guard', () => {
172179
const {
173180
props: [prop],

0 commit comments

Comments
 (0)