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/instrumentation-template-mu.../_config.js

28 lines
496 B

export default {
props: {
foo: 0,
bar: 0
},
html: `
<button>click me</button>
<p>foo: 0</p>
<p>bar: 0</p>
`,
async test({ assert, component, target, window }) {
const button = target.querySelector('button');
const click = new window.MouseEvent('click');
await button.dispatchEvent(click);
assert.equal(component.foo, 4);
assert.equal(component.bar, 2);
assert.htmlEqual(target.innerHTML, `
<button>click me</button>
<p>foo: 4</p>
<p>bar: 2</p>
`);
}
};