mirror of https://github.com/sveltejs/svelte
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.
22 lines
373 B
22 lines
373 B
4 years ago
|
export default {
|
||
|
html: `
|
||
|
<h1>hi</h1>
|
||
|
<button>Change</button>
|
||
|
`,
|
||
|
|
||
|
async test({ assert, component, target, window }) {
|
||
|
const btn = target.querySelector("button");
|
||
|
const clickEvent = new window.MouseEvent("click");
|
||
|
|
||
|
await btn.dispatchEvent(clickEvent);
|
||
|
|
||
|
assert.htmlEqual(
|
||
|
target.innerHTML,
|
||
|
`
|
||
|
<h1>changed</h1>
|
||
|
<button>Change</button>
|
||
|
`
|
||
|
);
|
||
|
},
|
||
|
};
|