forked from sveltejs/svelte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_config.js
29 lines (25 loc) · 776 Bytes
/
_config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
export default {
html: `
<button>action</button>
`,
async test({ assert, target, window }) {
const button = target.querySelector('button');
const enter = new window.MouseEvent('mouseenter');
const leave = new window.MouseEvent('mouseleave');
const ctrlPress = new window.KeyboardEvent('keydown', { ctrlKey: true });
await button.dispatchEvent(enter);
assert.htmlEqual(target.innerHTML, `
<button>action</button>
<div class="tooltip">Perform an Action</div>
`);
await window.dispatchEvent(ctrlPress);
assert.htmlEqual(target.innerHTML, `
<button>action</button>
<div class="tooltip">Perform an augmented Action</div>
`);
await button.dispatchEvent(leave);
assert.htmlEqual(target.innerHTML, `
<button>action</button>
`);
}
};