File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
packages/svelte/tests/runtime-runes/samples/if-nested-template Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 1+ <script >
2+ let { value } = $props ()
3+
4+ const text = $derived (value .toString ())
5+
6+ $effect (() => console .log (text))
7+ </script >
Original file line number Diff line number Diff line change @@ -2,15 +2,16 @@ import { flushSync } from 'svelte';
22import { test } from '../../test' ;
33
44export default test ( {
5- async test ( { assert, target } ) {
5+ async test ( { assert, target, logs } ) {
66 const [ btn1 , btn2 ] = target . querySelectorAll ( 'button' ) ;
77 const [ div ] = target . querySelectorAll ( 'div' ) ;
88
99 flushSync ( ( ) => btn1 ?. click ( ) ) ;
10- assert . htmlEqual ( div . innerHTML , '123 <br> 123' ) ;
10+ assert . htmlEqual ( div . innerHTML , '123 123' ) ;
1111 assert . equal ( div . inert , true ) ;
1212
1313 flushSync ( ( ) => btn2 ?. click ( ) ) ;
1414 assert . htmlEqual ( div . innerHTML , '' ) ;
15+ assert . deepEqual ( logs , [ '123' ] ) ;
1516 }
1617} ) ;
Original file line number Diff line number Diff line change 11<script >
2+ import Component from ' ./Component.svelte' ;
3+
24 let outer = $state (true );
35 let inner = $state (123 );
46
1113 <div out:outro >
1214 {#if inner }
1315 {@const text = inner .toString ()}
14- {text }
15- <br >
16- {inner .toString ()}
16+ {text } {inner .toString ()}
17+ <Component value ={inner } />
1718 {/if }
1819 </div >
1920{/if }
You can’t perform that action at this time.
0 commit comments