From ad3e43d3b192664429281aac7273dd712ef8575d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 31 Jul 2021 18:19:17 +0200 Subject: [PATCH] Test for issue https://github.com/sveltejs/svelte/issues/6481 --- .../custom-elements/samples/child-slot/main.svelte | 9 +++++++++ .../samples/child-slot/screen.svelte | 4 ++++ test/custom-elements/samples/child-slot/test.js | 14 ++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 test/custom-elements/samples/child-slot/main.svelte create mode 100644 test/custom-elements/samples/child-slot/screen.svelte create mode 100644 test/custom-elements/samples/child-slot/test.js diff --git a/test/custom-elements/samples/child-slot/main.svelte b/test/custom-elements/samples/child-slot/main.svelte new file mode 100644 index 000000000000..83012211e830 --- /dev/null +++ b/test/custom-elements/samples/child-slot/main.svelte @@ -0,0 +1,9 @@ + + + + + + screen1 + diff --git a/test/custom-elements/samples/child-slot/screen.svelte b/test/custom-elements/samples/child-slot/screen.svelte new file mode 100644 index 000000000000..bce9a37c9ac4 --- /dev/null +++ b/test/custom-elements/samples/child-slot/screen.svelte @@ -0,0 +1,4 @@ + + +

not slotted

+default diff --git a/test/custom-elements/samples/child-slot/test.js b/test/custom-elements/samples/child-slot/test.js new file mode 100644 index 000000000000..2debefa78d3c --- /dev/null +++ b/test/custom-elements/samples/child-slot/test.js @@ -0,0 +1,14 @@ +import * as assert from 'assert'; +import './main.svelte'; +import './screen.svelte'; + +export default function (target) { + target.innerHTML = ``; + + const [a] = target.querySelectorAll('custom-element'); + + assert.htmlEqual(a.shadowRoot.innerHTML, ` +

not slotted

+ screen1 + `); +}