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/event-handler-sanitize/_config.js

22 lines
414 B

export default {
html: `
<div>toggle</div>
`,
async test({ assert, target, window }) {
const div = target.querySelector('div');
const event = new window.MouseEvent('some-event');
await div.dispatchEvent(event);
assert.htmlEqual(target.innerHTML, `
<div>toggle</div>
<p>hello!</p>
`);
await div.dispatchEvent(event);
assert.htmlEqual(target.innerHTML, `
<div>toggle</div>
`);
}
};