mirror of https://github.com/sveltejs/svelte
sanitize names of automatically-bubbled events - fixes #2923
parent
35001b36cc
commit
d10d491579
@ -0,0 +1,18 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<button>click me now</button>
|
||||||
|
`,
|
||||||
|
|
||||||
|
test({ assert, component, target, window }) {
|
||||||
|
const button = target.querySelector('button');
|
||||||
|
const event = new window.Event('click-now');
|
||||||
|
|
||||||
|
let clicked;
|
||||||
|
component.$on('click-now', () => {
|
||||||
|
clicked = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
button.dispatchEvent(event);
|
||||||
|
assert.ok(clicked);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1 @@
|
|||||||
|
<button on:click-now>click me now</button>
|
Loading…
Reference in new issue