Skip to content

Commit acc7bb3

Browse files
committed
add test
1 parent 2048f5d commit acc7bb3

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script>
2+
let { children } = $props();
3+
4+
let inited = $state(false);
5+
6+
$effect(() => {
7+
inited = true;
8+
});
9+
</script>
10+
11+
<span>{@render children()}</span>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { flushSync } from 'svelte';
2+
import { test } from '../../test';
3+
4+
export default test({
5+
async test({ assert, target }) {
6+
const [button] = target.querySelectorAll('button');
7+
8+
assert.doesNotThrow(() => {
9+
flushSync(() => button.click());
10+
});
11+
}
12+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script>
2+
import Child from './Child.svelte';
3+
4+
let show = $state(false);
5+
</script>
6+
7+
<button onclick={() => show = !show}>
8+
toggle
9+
</button>
10+
11+
{#if show}
12+
{#each { length: 1234 } as i}
13+
<Child>{i}</Child>
14+
{/each}
15+
{/if}

0 commit comments

Comments
 (0)