Skip to content

Commit e5e4d29

Browse files
committed
wip(vapor): test cases
1 parent 2a76b52 commit e5e4d29

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

packages/runtime-vapor/__tests__/hydration.spec.ts

+30-6
Original file line numberDiff line numberDiff line change
@@ -243,21 +243,45 @@ describe('Vapor Mode hydration', () => {
243243
test.todo('component with anchor insertion', async () => {
244244
const { container, data } = await testHydration(
245245
`
246-
<template><div><span/><components.Child/><span/></div></template>
246+
<template>
247+
<div>
248+
<span/>
249+
<components.Child/>
250+
<span/>
251+
</div>
252+
</template>
247253
`,
248254
{
249255
Child: `<template>{{ data }}</template>`,
250256
},
251257
)
252-
expect(container.innerHTML).toMatchInlineSnapshot(
253-
`"<div><span></span>foo<span></span></div>"`,
254-
)
258+
expect(container.innerHTML).toMatchInlineSnapshot()
255259

256260
data.value = 'bar'
257261
await nextTick()
258-
expect(container.innerHTML).toMatchInlineSnapshot(
259-
`"<div><span></span>foo<span></span></div>"`,
262+
expect(container.innerHTML).toMatchInlineSnapshot()
263+
})
264+
265+
test.todo('consecutive component with anchor insertion', async () => {
266+
const { container, data } = await testHydration(
267+
`<template>
268+
<div>
269+
<span/>
270+
<components.Child/>
271+
<components.Child/>
272+
<span/>
273+
</div>
274+
</template>
275+
`,
276+
{
277+
Child: `<template>{{ data }}</template>`,
278+
},
260279
)
280+
expect(container.innerHTML).toMatchInlineSnapshot()
281+
282+
data.value = 'bar'
283+
await nextTick()
284+
expect(container.innerHTML).toMatchInlineSnapshot()
261285
})
262286

263287
test.todo('if')

0 commit comments

Comments
 (0)