@@ -241,8 +241,7 @@ describe('Vapor Mode hydration', () => {
241
241
242
242
test ( 'component with anchor insertion' , async ( ) => {
243
243
const { container, data } = await testHydration (
244
- `
245
- <template>
244
+ `<template>
246
245
<div>
247
246
<span/>
248
247
<components.Child/>
@@ -255,13 +254,13 @@ describe('Vapor Mode hydration', () => {
255
254
} ,
256
255
)
257
256
expect ( container . innerHTML ) . toMatchInlineSnapshot (
258
- `"<div><span></span><!--[[--> foo<!--]]--> <span></span></div>"` ,
257
+ `"<div><span></span>foo<span></span></div>"` ,
259
258
)
260
259
261
260
data . value = 'bar'
262
261
await nextTick ( )
263
262
expect ( container . innerHTML ) . toMatchInlineSnapshot (
264
- `"<div><span></span><!--[[--> bar<!--]]--> <span></span></div>"` ,
263
+ `"<div><span></span>bar<span></span></div>"` ,
265
264
)
266
265
} )
267
266
@@ -291,6 +290,56 @@ describe('Vapor Mode hydration', () => {
291
290
)
292
291
} )
293
292
293
+ test ( 'mixed component and element with anchor insertion' , async ( ) => {
294
+ const { container, data } = await testHydration (
295
+ `<template>
296
+ <div>
297
+ <span/>
298
+ <components.Child/>
299
+ <span/>
300
+ <components.Child/>
301
+ <span/>
302
+ </div>
303
+ </template>
304
+ ` ,
305
+ {
306
+ Child : `<template>{{ data }}</template>` ,
307
+ } ,
308
+ )
309
+ expect ( container . innerHTML ) . toMatchInlineSnapshot (
310
+ `"<div><span></span>foo<span></span>foo<span></span></div>"` ,
311
+ )
312
+
313
+ data . value = 'bar'
314
+ await nextTick ( )
315
+ expect ( container . innerHTML ) . toMatchInlineSnapshot (
316
+ `"<div><span></span>bar<span></span>bar<span></span></div>"` ,
317
+ )
318
+ } )
319
+
320
+ test . todo ( 'mixed component and text with anchor insertion' , async ( ) => {
321
+ const { container, data } = await testHydration (
322
+ `<template>
323
+ <div>
324
+ <span/>
325
+ <components.Child/>
326
+ {{ data }}
327
+ <components.Child/>
328
+ <span/>
329
+ </div>
330
+ </template>
331
+ ` ,
332
+ {
333
+ Child : `<template>{{ data }}</template>` ,
334
+ } ,
335
+ )
336
+ expect ( container . innerHTML ) . toMatchInlineSnapshot ( `` )
337
+
338
+ data . value = 'bar'
339
+ await nextTick ( )
340
+ expect ( container . innerHTML ) . toMatchInlineSnapshot ( `` )
341
+ } )
342
+
294
343
test . todo ( 'if' )
295
344
296
345
test . todo ( 'for' )
0 commit comments