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

44 lines
663 B

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