From e1cea16050dbc80d666143c74565c1f301a64854 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 12 Nov 2024 08:42:13 -0500 Subject: [PATCH] add failing test for #14268 --- .../_config.js | 16 ++++++++++++++++ .../main.svelte | 7 +++++++ 2 files changed, 23 insertions(+) create mode 100644 packages/svelte/tests/runtime-runes/samples/proxy-nullish-coalescing-assignment/_config.js create mode 100644 packages/svelte/tests/runtime-runes/samples/proxy-nullish-coalescing-assignment/main.svelte diff --git a/packages/svelte/tests/runtime-runes/samples/proxy-nullish-coalescing-assignment/_config.js b/packages/svelte/tests/runtime-runes/samples/proxy-nullish-coalescing-assignment/_config.js new file mode 100644 index 000000000000..4edeec858d40 --- /dev/null +++ b/packages/svelte/tests/runtime-runes/samples/proxy-nullish-coalescing-assignment/_config.js @@ -0,0 +1,16 @@ +import { flushSync } from 'svelte'; +import { test } from '../../test'; + +export default test({ + html: ``, + + test({ assert, target }) { + const btn = target.querySelector('button'); + + flushSync(() => btn?.click()); + assert.htmlEqual(target.innerHTML, ``); + + flushSync(() => btn?.click()); + assert.htmlEqual(target.innerHTML, ``); + } +}); diff --git a/packages/svelte/tests/runtime-runes/samples/proxy-nullish-coalescing-assignment/main.svelte b/packages/svelte/tests/runtime-runes/samples/proxy-nullish-coalescing-assignment/main.svelte new file mode 100644 index 000000000000..84c1c32c5cc8 --- /dev/null +++ b/packages/svelte/tests/runtime-runes/samples/proxy-nullish-coalescing-assignment/main.svelte @@ -0,0 +1,7 @@ + + +