mirror of https://github.com/sveltejs/svelte
add test for #3569 and similar situations
parent
d8fb0bb62c
commit
6397588e50
@ -0,0 +1,30 @@
|
||||
export default {
|
||||
html: `
|
||||
<input>
|
||||
`,
|
||||
|
||||
ssrHtml: `
|
||||
<input>
|
||||
`,
|
||||
|
||||
async test({ assert, component, target, window }) {
|
||||
const input = target.querySelector('input');
|
||||
assert.equal(input.value, '');
|
||||
|
||||
component.x = null;
|
||||
assert.equal(input.value, '');
|
||||
|
||||
component.x = undefined;
|
||||
assert.equal(input.value, '');
|
||||
|
||||
component.x = 'string';
|
||||
component.x = undefined;
|
||||
assert.equal(input.value, '');
|
||||
|
||||
component.x = 0;
|
||||
assert.equal(input.value, '0');
|
||||
|
||||
component.x = undefined;
|
||||
assert.equal(input.value, '');
|
||||
},
|
||||
};
|
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
export let x;
|
||||
</script>
|
||||
|
||||
<input bind:value={x}>
|
Loading…
Reference in new issue