From 82b8267689db3cb1fa0d643536dbf23c46e1f73b Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Fri, 24 Apr 2020 06:57:42 +0800 Subject: [PATCH] fix slot fallback update parent --- .../component-slot-fallback-5/IconA.svelte | 1 + .../component-slot-fallback-5/IconB.svelte | 1 + .../component-slot-fallback-5/Inner.svelte | 13 ++++++++ .../component-slot-fallback-5/_config.js | 31 +++++++++++++++++++ .../component-slot-fallback-5/main.svelte | 5 +++ 5 files changed, 51 insertions(+) create mode 100644 test/runtime/samples/component-slot-fallback-5/IconA.svelte create mode 100644 test/runtime/samples/component-slot-fallback-5/IconB.svelte create mode 100644 test/runtime/samples/component-slot-fallback-5/Inner.svelte create mode 100644 test/runtime/samples/component-slot-fallback-5/_config.js create mode 100644 test/runtime/samples/component-slot-fallback-5/main.svelte diff --git a/test/runtime/samples/component-slot-fallback-5/IconA.svelte b/test/runtime/samples/component-slot-fallback-5/IconA.svelte new file mode 100644 index 0000000000..8921b6c531 --- /dev/null +++ b/test/runtime/samples/component-slot-fallback-5/IconA.svelte @@ -0,0 +1 @@ +Icon A \ No newline at end of file diff --git a/test/runtime/samples/component-slot-fallback-5/IconB.svelte b/test/runtime/samples/component-slot-fallback-5/IconB.svelte new file mode 100644 index 0000000000..8a1a95ead3 --- /dev/null +++ b/test/runtime/samples/component-slot-fallback-5/IconB.svelte @@ -0,0 +1 @@ +Icon B \ No newline at end of file diff --git a/test/runtime/samples/component-slot-fallback-5/Inner.svelte b/test/runtime/samples/component-slot-fallback-5/Inner.svelte new file mode 100644 index 0000000000..afd45a35ca --- /dev/null +++ b/test/runtime/samples/component-slot-fallback-5/Inner.svelte @@ -0,0 +1,13 @@ + + + +
+ + + +
diff --git a/test/runtime/samples/component-slot-fallback-5/_config.js b/test/runtime/samples/component-slot-fallback-5/_config.js new file mode 100644 index 0000000000..fa374f3519 --- /dev/null +++ b/test/runtime/samples/component-slot-fallback-5/_config.js @@ -0,0 +1,31 @@ +export default { + html: ` + +
Icon B
+ `, + + async test({ assert, target, window }) { + const btn = target.querySelector("button"); + const clickEvent = new window.MouseEvent("click"); + + await btn.dispatchEvent(clickEvent); + + assert.htmlEqual( + target.innerHTML, + ` + +
Icon A
+ ` + ); + + await btn.dispatchEvent(clickEvent); + + assert.htmlEqual( + target.innerHTML, + ` + +
Icon B
+ ` + ); + } +}; diff --git a/test/runtime/samples/component-slot-fallback-5/main.svelte b/test/runtime/samples/component-slot-fallback-5/main.svelte new file mode 100644 index 0000000000..206ce21def --- /dev/null +++ b/test/runtime/samples/component-slot-fallback-5/main.svelte @@ -0,0 +1,5 @@ + + +