File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
packages/svelte/tests/runtime-runes/samples/async-attachment Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,15 @@ import { test } from '../../test';
44export default test ( {
55 async test ( { assert, target } ) {
66 await tick ( ) ;
7- assert . htmlEqual ( target . innerHTML , '<p>foo</p><div>foo</div>' ) ;
7+ assert . htmlEqual ( target . innerHTML , '<button>toggle</button> <p>foo</p><div>foo</div>' ) ;
8+
9+ const [ toggle ] = target . querySelectorAll ( 'button' ) ;
10+ toggle . click ( ) ;
11+ await tick ( ) ;
12+ assert . htmlEqual ( target . innerHTML , '<button>toggle</button>' ) ;
13+
14+ toggle . click ( ) ;
15+ await tick ( ) ;
16+ assert . htmlEqual ( target . innerHTML , '<button>toggle</button> <p>foo</p><div>foo</div>' ) ;
817 }
918} ) ;
Original file line number Diff line number Diff line change 11<script >
22 import Inner from ' ./Inner.svelte' ;
3+
4+ let show = $state (true );
35 </script >
46
57<svelte:boundary >
6- <Inner />
8+ <button onclick ={() => show = ! show }>toggle</button >
9+ {#if show }
10+ <Inner />
11+ {/if }
712
813 {#snippet pending ()}
914 <p >pending</p >
1015 {/ snippet }
11- </svelte:boundary >
16+ </svelte:boundary >
You can’t perform that action at this time.
0 commit comments