From 90c8f972492f3eea4aa826a929228e4105d30868 Mon Sep 17 00:00:00 2001 From: rster20002 Date: Tue, 10 Aug 2021 15:25:22 +0200 Subject: [PATCH] Add keyed each tests --- .../_config.js | 10 ++++++++ .../main.svelte | 25 +++++++++++++++++++ .../_config.js | 5 ++++ .../main.svelte | 14 +++++++++++ 4 files changed, 54 insertions(+) create mode 100644 test/runtime/samples/error-handling-keyed-each-block-reactive/_config.js create mode 100644 test/runtime/samples/error-handling-keyed-each-block-reactive/main.svelte create mode 100644 test/runtime/samples/error-handling-keyed-each-block/_config.js create mode 100644 test/runtime/samples/error-handling-keyed-each-block/main.svelte diff --git a/test/runtime/samples/error-handling-keyed-each-block-reactive/_config.js b/test/runtime/samples/error-handling-keyed-each-block-reactive/_config.js new file mode 100644 index 0000000000..773299e415 --- /dev/null +++ b/test/runtime/samples/error-handling-keyed-each-block-reactive/_config.js @@ -0,0 +1,10 @@ +export default { + async test({ assert, component, target, window }) { + const button = target.querySelector('button'); + const event = new window.MouseEvent('click'); + + await button.dispatchEvent(event); + + assert.equal(component.error, true); + } +}; diff --git a/test/runtime/samples/error-handling-keyed-each-block-reactive/main.svelte b/test/runtime/samples/error-handling-keyed-each-block-reactive/main.svelte new file mode 100644 index 0000000000..567c8273bd --- /dev/null +++ b/test/runtime/samples/error-handling-keyed-each-block-reactive/main.svelte @@ -0,0 +1,25 @@ + + + + +{#each a as item (item.a.b)} + {item} +{/each} \ No newline at end of file diff --git a/test/runtime/samples/error-handling-keyed-each-block/_config.js b/test/runtime/samples/error-handling-keyed-each-block/_config.js new file mode 100644 index 0000000000..fab5d76ee6 --- /dev/null +++ b/test/runtime/samples/error-handling-keyed-each-block/_config.js @@ -0,0 +1,5 @@ +export default { + test({ assert, component }) { + assert.equal(component.error, true); + } +}; diff --git a/test/runtime/samples/error-handling-keyed-each-block/main.svelte b/test/runtime/samples/error-handling-keyed-each-block/main.svelte new file mode 100644 index 0000000000..98c79c454b --- /dev/null +++ b/test/runtime/samples/error-handling-keyed-each-block/main.svelte @@ -0,0 +1,14 @@ + + +{#each a as item (item.a.b)} + {item} +{/each} \ No newline at end of file