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

14 lines
403 B

export default {
test({ assert, component, window }) {
assert.deepEqual(component.events, []);
const event1 = new window.Event('mouseenter');
window.document.body.dispatchEvent(event1);
assert.deepEqual(component.events, ['enter']);
const event2 = new window.Event('mouseleave');
window.document.body.dispatchEvent(event2);
assert.deepEqual(component.events, ['enter', 'leave']);
}
};