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

33 lines
574 B

export default {
data: {
7 years ago
name: 'world',
},
7 years ago
html: `
<input>
<p>hello world</p>
`,
test(assert, component, target, window) {
const input = target.querySelector('input');
assert.equal(input.value, 'world');
const event = new window.Event('input');
input.value = 'everybody';
7 years ago
input.dispatchEvent(event);
7 years ago
assert.htmlEqual(target.innerHTML, `
<input>
<p>hello everybody</p>
`);
component.set({ name: 'goodbye' });
7 years ago
assert.equal(input.value, 'goodbye');
assert.htmlEqual(target.innerHTML, `
<input>
<p>hello goodbye</p>
`);
},
};