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/component-binding-self-dest.../_config.js

28 lines
533 B

export default {
props: {
show: true
},
html: `
<button>Hide</button>
`,
async test({ assert, component, target, window }) {
const click = new window.MouseEvent('click');
await target.querySelector('button').dispatchEvent(click);
assert.equal(component.show, false);
assert.htmlEqual(target.innerHTML, `
<button>Show</button>
`);
await target.querySelector('button').dispatchEvent(click);
assert.equal(component.show, true);
assert.htmlEqual(target.innerHTML, `
<button>Hide</button>
`);
}
};