mirror of https://github.com/sveltejs/svelte
22 lines
439 B
22 lines
439 B
export default {
|
|
html: `
|
|
<button>toggle</button>
|
|
`,
|
|
|
|
async test({ assert, target, window }) {
|
|
const button = target.querySelector('button');
|
|
const event = new window.MouseEvent('click');
|
|
|
|
await button.dispatchEvent(event);
|
|
assert.htmlEqual(target.innerHTML, `
|
|
<button>toggle</button>
|
|
<p>hello!</p>
|
|
`);
|
|
|
|
await button.dispatchEvent(event);
|
|
assert.htmlEqual(target.innerHTML, `
|
|
<button>toggle</button>
|
|
`);
|
|
}
|
|
};
|