Skip to content

Commit c4a1657

Browse files
chore: add regression test for issue #17277
1 parent 866ae6c commit c4a1657

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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>

0 commit comments

Comments
 (0)