mirror of https://github.com/sveltejs/svelte
parent
62d5480687
commit
f98b082150
@ -0,0 +1,11 @@
|
|||||||
|
export default {
|
||||||
|
async test({ assert, component, window }) {
|
||||||
|
const event = new window.MouseEvent('click');
|
||||||
|
|
||||||
|
await window.document.body.dispatchEvent(event);
|
||||||
|
assert.equal(component.count, 1);
|
||||||
|
|
||||||
|
await window.document.body.dispatchEvent(event);
|
||||||
|
assert.equal(component.count, 1);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
export let count = 0;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<svelte:body on:click|once="{() => count += 1}"/>
|
Loading…
Reference in new issue