mirror of https://github.com/sveltejs/svelte
parent
cf732809d6
commit
2408443372
@ -0,0 +1,11 @@
|
||||
<svelte:options tag="custom-element" shadowdom="none" />
|
||||
|
||||
<div>
|
||||
<slot>
|
||||
<p>default fallback content</p>
|
||||
</slot>
|
||||
|
||||
<slot name='foo'>
|
||||
<p>foo fallback content</p>
|
||||
</slot>
|
||||
</div>
|
@ -0,0 +1,17 @@
|
||||
import * as assert from 'assert';
|
||||
import './main.svelte';
|
||||
|
||||
export default function (target) {
|
||||
target.innerHTML = `
|
||||
<custom-element>
|
||||
<strong>slotted</strong>
|
||||
</custom-element>`;
|
||||
|
||||
const el = target.querySelector('custom-element');
|
||||
|
||||
const div = el.children[0];
|
||||
const [slot0] = div.children;
|
||||
|
||||
assert.equal(slot0.children[1], target.querySelector('strong'));
|
||||
//assert.equal(slot1.assignedNodes().length, 0);
|
||||
}
|
Loading…
Reference in new issue