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/select-change-handler/_config.js

21 lines
461 B

export default {
props: {
options: [ { id: 'a' }, { id: 'b' }, { id: 'c' } ],
selected: 'b'
},
test({ assert, component, target, window }) {
const select = target.querySelector('select');
assert.equal(select.value, 'b');
const event = new window.Event('change');
select.value = 'c';
select.dispatchEvent(event);
assert.equal(select.value, 'c');
assert.equal(component.lastChangedTo, 'c');
assert.equal(component.selected, 'c');
}
};