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-undefined/_config.js

31 lines
518 B

export default {
html: `
<input>
`,
ssrHtml: `
<input>
`,
async test({ assert, component, target }) {
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, '');
}
};