diff --git a/packages/svelte/tests/runtime-runes/samples/async-boundary-coordination/_config.js b/packages/svelte/tests/runtime-runes/samples/async-boundary-coordination/_config.js new file mode 100644 index 0000000000..f3e60e7b32 --- /dev/null +++ b/packages/svelte/tests/runtime-runes/samples/async-boundary-coordination/_config.js @@ -0,0 +1,46 @@ +import { tick } from 'svelte'; +import { test } from '../../test'; + +export default test({ + async test({ assert, target }) { + await tick(); + + assert.htmlEqual( + target.innerHTML, + ` +

hello from server

+

hello from server

+

hello from server

+

hello from server

+ ` + ); + + const [button1, button2] = target.querySelectorAll('button'); + + button1.click(); + await tick(); + + assert.htmlEqual( + target.innerHTML, + ` +

hello from browser

+

hello from browser

+

hello from server

+

hello from server

+ ` + ); + + button2.click(); + await tick(); + + assert.htmlEqual( + target.innerHTML, + ` +

hello from browser

+

hello from browser

+

hello from browser

+

hello from browser

+ ` + ); + } +}); diff --git a/packages/svelte/tests/runtime-runes/samples/async-boundary-coordination/main.svelte b/packages/svelte/tests/runtime-runes/samples/async-boundary-coordination/main.svelte new file mode 100644 index 0000000000..3986c45046 --- /dev/null +++ b/packages/svelte/tests/runtime-runes/samples/async-boundary-coordination/main.svelte @@ -0,0 +1,35 @@ + + + + + + + + {#if await a.promise} +

hello from {browser ? 'browser' : 'server'}

+ {/if} + +

hello from {browser ? 'browser' : 'server'}

+
+ + + {#if await b.promise} +

hello from {browser ? 'browser' : 'server'}

+ {/if} + +

hello from {browser ? 'browser' : 'server'}

+