mirror of https://github.com/sveltejs/svelte
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.
38 lines
589 B
38 lines
589 B
5 years ago
|
export default {
|
||
|
props: {
|
||
|
value: ''
|
||
|
},
|
||
|
|
||
|
html: `
|
||
|
<input>
|
||
|
<p></p>
|
||
|
`,
|
||
|
|
||
|
ssrHtml: `
|
||
|
<input>
|
||
|
<p></p>
|
||
|
`,
|
||
|
|
||
|
async test({ assert, component, target, window }) {
|
||
|
const input = target.querySelector('input');
|
||
|
|
||
|
const event = new window.Event('input');
|
||
|
input.value = 'h';
|
||
|
await input.dispatchEvent(event);
|
||
|
|
||
|
assert.equal(input.value, 'H');
|
||
|
assert.htmlEqual(target.innerHTML, `
|
||
|
<input>
|
||
|
<p>H</p>
|
||
|
`);
|
||
|
|
||
|
input.value = 'he';
|
||
|
await input.dispatchEvent(event);
|
||
|
assert.equal(input.value, 'HE');
|
||
|
assert.htmlEqual(target.innerHTML, `
|
||
|
<input>
|
||
|
<p>HE</p>
|
||
|
`);
|
||
|
},
|
||
|
};
|