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/hydration/samples/binding-input/_config.js

28 lines
491 B

export default {
props: {
name: 'world'
},
snapshot(target) {
return {
input: target.querySelector('input'),
p: target.querySelector('p')
};
},
async test(assert, target, _, component, window) {
const input = target.querySelector('input');
input.value = 'everybody';
await input.dispatchEvent(new window.Event('input'));
assert.equal(component.name, 'everybody');
assert.htmlEqual(
target.innerHTML,
`
<input>
<p>Hello everybody!</p>
`
);
}
};