From 6ddad99ddd2cbbaf40a9617825b5bf81961cc8a0 Mon Sep 17 00:00:00 2001 From: Zephraph Date: Tue, 23 Apr 2019 23:33:33 -0400 Subject: [PATCH] Add slots test... currently failing. --- .../no-shadow-dom-with-slots.solo/_config.js | 4 ++++ .../no-shadow-dom-with-slots.solo/main.svelte | 7 +++++++ .../no-shadow-dom-with-slots.solo/other.svelte | 3 +++ .../no-shadow-dom-with-slots.solo/test.js | 17 +++++++++++++++++ 4 files changed, 31 insertions(+) create mode 100644 test/custom-elements/samples/no-shadow-dom-with-slots.solo/_config.js create mode 100644 test/custom-elements/samples/no-shadow-dom-with-slots.solo/main.svelte create mode 100644 test/custom-elements/samples/no-shadow-dom-with-slots.solo/other.svelte create mode 100644 test/custom-elements/samples/no-shadow-dom-with-slots.solo/test.js diff --git a/test/custom-elements/samples/no-shadow-dom-with-slots.solo/_config.js b/test/custom-elements/samples/no-shadow-dom-with-slots.solo/_config.js new file mode 100644 index 0000000000..ad44e196d7 --- /dev/null +++ b/test/custom-elements/samples/no-shadow-dom-with-slots.solo/_config.js @@ -0,0 +1,4 @@ +export default { + customElement: true, + shadowDom: false +}; \ No newline at end of file diff --git a/test/custom-elements/samples/no-shadow-dom-with-slots.solo/main.svelte b/test/custom-elements/samples/no-shadow-dom-with-slots.solo/main.svelte new file mode 100644 index 0000000000..3942b70e7a --- /dev/null +++ b/test/custom-elements/samples/no-shadow-dom-with-slots.solo/main.svelte @@ -0,0 +1,7 @@ + + + + +Hello world \ No newline at end of file diff --git a/test/custom-elements/samples/no-shadow-dom-with-slots.solo/other.svelte b/test/custom-elements/samples/no-shadow-dom-with-slots.solo/other.svelte new file mode 100644 index 0000000000..a9d62e355a --- /dev/null +++ b/test/custom-elements/samples/no-shadow-dom-with-slots.solo/other.svelte @@ -0,0 +1,3 @@ + + +

\ No newline at end of file diff --git a/test/custom-elements/samples/no-shadow-dom-with-slots.solo/test.js b/test/custom-elements/samples/no-shadow-dom-with-slots.solo/test.js new file mode 100644 index 0000000000..85d868af21 --- /dev/null +++ b/test/custom-elements/samples/no-shadow-dom-with-slots.solo/test.js @@ -0,0 +1,17 @@ +import * as assert from 'assert'; +import CustomElement from './main.svelte'; + +export default function (target) { + new CustomElement({ + target + }); + + assert.equal(target.innerHTML, '

Hello world!

'); + + const el = target.querySelector('custom-element'); + const h1 = el.querySelector('h1'); + const { color } = getComputedStyle(h1); + + assert.equal(h1.textContent, 'Hello world!'); + assert.equal(color, 'rgb(0, 0, 255)'); +} \ No newline at end of file