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

13 lines
412 B

export default {
test({ assert, component, target, window }) {
const allow = target.querySelector('.allow-propagation');
const stop = target.querySelector('.stop-propagation');
allow.dispatchEvent(new window.MouseEvent('click', { bubbles: true }));
stop.dispatchEvent(new window.MouseEvent('click', { bubbles: true }));
assert.equal(component.foo, true);
assert.equal(component.bar, false);
}
};