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/packages/svelte/test/runtime/samples/binding-select-from-let/_config.js

22 lines
586 B

export default {
html: `
<select>
<option value='do laundry'>do laundry</option>
<option value='do taxes'>do taxes</option>
<option value='cook food'>cook food</option>
<option value='watch the kids'>watch the kids</option>
</select>
`,
async test({ assert, component, target, window }) {
const select = target.querySelector('select');
const options = target.querySelectorAll('option');
const change = new window.Event('change');
options[1].selected = true;
await select.dispatchEvent(change);
assert.equal(component.selected, options[1].value);
}
};