File tree 3 files changed +7
-3
lines changed
runtime-runes/samples/props-id
3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -252,6 +252,10 @@ export function append(anchor, dom) {
252
252
253
253
let uid = 1 ;
254
254
255
+ export function reset_props_id ( ) {
256
+ uid = 1 ;
257
+ }
258
+
255
259
/**
256
260
* Create (or hydrate) an unique UID for the component instance.
257
261
*/
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { setup_html_equal } from '../html_equal.js';
11
11
import { raf } from '../animation-helpers.js' ;
12
12
import type { CompileOptions } from '#compiler' ;
13
13
import { suite_with_variants , type BaseTest } from '../suite.js' ;
14
+ import { reset_props_id } from '../../src/internal/client/dom/template.js' ;
14
15
15
16
type Assert = typeof import ( 'vitest' ) . assert & {
16
17
htmlEqual ( a : string , b : string , description ?: string ) : void ;
@@ -345,6 +346,7 @@ async function run_test_variant(
345
346
346
347
if ( runes ) {
347
348
props = proxy ( { ...( config . props || { } ) } ) ;
349
+ reset_props_id ( ) ;
348
350
if ( manual_hydrate ) {
349
351
hydrate_fn = ( ) => {
350
352
instance = hydrate ( mod . default , {
Original file line number Diff line number Diff line change @@ -43,8 +43,6 @@ export default test({
43
43
`
44
44
) ;
45
45
} else {
46
- // `c6` because this runs after the `dom` tests
47
- // (slightly brittle but good enough for now)
48
46
assert . htmlEqual (
49
47
target . innerHTML ,
50
48
`
@@ -53,7 +51,7 @@ export default test({
53
51
<p>s2</p>
54
52
<p>s3</p>
55
53
<p>s4</p>
56
- <p>c6 </p>
54
+ <p>c1 </p>
57
55
`
58
56
) ;
59
57
}
You can’t perform that action at this time.
0 commit comments