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-select-initial-valu.../_config.js

24 lines
486 B

export default {
skip_if_ssr: true, // TODO would be nice to fix this in SSR as well
html: `
<p>selected: a</p>
<select>
<option value='a'>a</option>
<option value='b'>b</option>
<option value='c'>c</option>
</select>
<p>selected: a</p>
`,
test({ assert, component, target }) {
const select = target.querySelector('select');
const options = [...target.querySelectorAll('option')];
assert.equal(select.value, 'a');
assert.ok(options[0].selected);
}
};