You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/custom-elements/samples/$$slot-dynamic-content/test.js

29 lines
523 B

import * as assert from 'assert.js';
import { tick } from 'svelte';
import Component from './main.svelte';
export default async function (target) {
const component = new Component({ target, props: { name: 'slot' } });
await tick();
await tick();
const ce = target.querySelector('my-widget');
assert.htmlEqual(
ce.shadowRoot.innerHTML,
`
<slot></slot>
<p>named fallback</p>
`
);
component.name = 'slot2';
assert.htmlEqual(
ce.shadowRoot.innerHTML,
`
<slot></slot>
<p>named fallback</p>
`
);
}