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/runtime/samples/component-slot-fallback-5/_config.js

32 lines
518 B

export default {
html: `
<button>Click Me</button>
<div>Icon B</div>
`,
async test({ assert, target, window }) {
const btn = target.querySelector('button');
const clickEvent = new window.MouseEvent('click');
await btn.dispatchEvent(clickEvent);
assert.htmlEqual(
target.innerHTML,
`
<button>Click Me</button>
<div>Icon A</div>
`
);
await btn.dispatchEvent(clickEvent);
assert.htmlEqual(
target.innerHTML,
`
<button>Click Me</button>
<div>Icon B</div>
`
);
}
};