Skip to content

Commit

Permalink
Test for issue sveltejs#6481
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelvogt committed Jul 31, 2021
1 parent ff6ce72 commit ad3e43d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/custom-elements/samples/child-slot/main.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<svelte:options tag="custom-element"/>

<script>
import Screen from './screen.svelte';
</script>

<Screen>
screen1
</Screen>
4 changes: 4 additions & 0 deletions test/custom-elements/samples/child-slot/screen.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<svelte:options tag="bugslot-screen" />

<p>not slotted</p>
<slot>default</slot>
14 changes: 14 additions & 0 deletions test/custom-elements/samples/child-slot/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import * as assert from 'assert';
import './main.svelte';
import './screen.svelte';

export default function (target) {
target.innerHTML = `<custom-element></custom-element>`;

const [a] = target.querySelectorAll('custom-element');

assert.htmlEqual(a.shadowRoot.innerHTML, `
<p>not slotted</p>
<slot>screen1</slot>
`);
}

0 comments on commit ad3e43d

Please sign in to comment.