Skip to content

Commit 2800da4

Browse files
committed
chore: update test
1 parent cb9631f commit 2800da4

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

packages/compiler-vapor/__tests__/__snapshots__/compile.spec.ts.snap

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export function render(_ctx) {
213213
`;
214214
215215
exports[`compile > execution order > with v-once 1`] = `
216-
"import { child as _child, next as _next, nthChild as _nthChild, toDisplayString as _toDisplayString, setText as _setText, setProp as _setProp, renderEffect as _renderEffect, template as _template } from 'vue';
216+
"import { child as _child, next as _next, nthChild as _nthChild, toDisplayString as _toDisplayString, setText as _setText, renderEffect as _renderEffect, template as _template } from 'vue';
217217
const t0 = _template("<div><span> </span> <br> </div>", true)
218218
219219
export function render(_ctx) {
@@ -224,7 +224,6 @@ export function render(_ctx) {
224224
const x0 = _child(n0)
225225
_setText(x0, _toDisplayString(_ctx.foo))
226226
_renderEffect(() => {
227-
_setProp(n3, "id", _ctx.foo)
228227
_setText(n1, " " + _toDisplayString(_ctx.bar))
229228
_setText(n2, " " + _toDisplayString(_ctx.baz))
230229
})

packages/compiler-vapor/__tests__/compile.spec.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,16 +225,24 @@ describe('compile', () => {
225225
test('basic', () => {
226226
const code = compile(`<div :id="foo">{{ bar }}</div>`)
227227
expect(code).matchSnapshot()
228+
expect(code).contains(
229+
`_setProp(n0, "id", _ctx.foo)
230+
_setText(x0, _toDisplayString(_ctx.bar))`,
231+
)
228232
})
229233
test('with v-once', () => {
230234
const code = compile(
231-
`<div :id="foo">
235+
`<div>
232236
<span v-once>{{ foo }}</span>
233237
{{ bar }}<br>
234238
{{ baz }}
235239
</div>`,
236240
)
237241
expect(code).matchSnapshot()
242+
expect(code).contains(
243+
`_setText(n1, " " + _toDisplayString(_ctx.bar))
244+
_setText(n2, " " + _toDisplayString(_ctx.baz))`,
245+
)
238246
})
239247
})
240248
})

0 commit comments

Comments
 (0)