File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
packages/svelte/tests/runtime-runes/samples/boundary-array-binding Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ export default {
2+ // 🔴 THIS IS THE KEY: Force production mode to trigger the bug
3+ compileOptions : {
4+ dev : false ,
5+ immutable : true // strict mode
6+ } ,
7+ async test ( { assert, target, window } ) {
8+ // 1. Wait for the async await block to resolve
9+ await Promise . resolve ( ) ;
10+ await Promise . resolve ( ) ;
11+
12+ const input = target . querySelector ( 'input' ) ;
13+ const p = target . querySelector ( 'p' ) ;
14+
15+ // 2. Simulate user typing "updated"
16+ input . value = 'updated' ;
17+ input . dispatchEvent ( new window . Event ( 'input' ) ) ;
18+
19+ // 3. Wait for reactivity
20+ await Promise . resolve ( ) ;
21+
22+ // 4. Assert
23+ assert . equal ( p . innerHTML , 'Value: updated' ) ;
24+ }
25+ } ;
Original file line number Diff line number Diff line change 1+ <script >
2+ let items = $state ([' initial' ]);
3+ </script >
4+
5+ <svelte:boundary onerror ={() => {}}>
6+ {#await Promise .resolve ()}
7+ {:then }
8+ <input bind:value ={items [0 ]} />
9+ {/await }
10+ </svelte:boundary >
11+
12+ <p >Value: {items [0 ]}</p >
You can’t perform that action at this time.
0 commit comments