Skip to content

Commit d93af12

Browse files
committed
chore: add better test
1 parent 46daad3 commit d93af12

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

packages/svelte/tests/runtime-runes/samples/const-tag-boundary/_config.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@ import { flushSync } from 'svelte';
22
import { test } from '../../test';
33

44
export default test({
5-
html: '<button></button> 2',
6-
mode: ['client']
7-
// TODO fix reactivity lost in failed snippet and add a test here
5+
html: '<button></button><p>2</p>',
6+
mode: ['client'],
7+
test({ target, assert }) {
8+
const btn = target.querySelector('button');
9+
const p = target.querySelector('p');
10+
11+
flushSync(() => {
12+
btn?.click();
13+
});
14+
15+
assert.equal(p?.innerHTML, '4');
16+
}
817
});

packages/svelte/tests/runtime-runes/samples/const-tag-boundary/main.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<svelte:boundary>
99
{@const double = test * 2}
1010
{#snippet failed()}
11-
{double}
11+
<p>{double}</p>
1212
{/snippet}
1313
<FlakyComponent />
1414
</svelte:boundary>

0 commit comments

Comments
 (0)