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

25 lines
731 B

export default {
async test({ assert, target, component, window }) {
const [input1, input2, input3] = target.querySelectorAll('input');
const event = new window.Event('change');
function validate_inputs(v1, v2, v3) {
assert.equal(input1.checked, v1);
assert.equal(input2.checked, v2);
assert.equal(input3.checked, v3);
}
assert.deepEqual(component.values.inner, []);
validate_inputs(false, false, false);
component.values = { inner: undefined };
assert.deepEqual(component.values.inner, undefined);
validate_inputs(false, false, false);
input1.checked = true;
await input1.dispatchEvent(event);
assert.deepEqual(component.values.inner, ['first']);
validate_inputs(true, false, false);
}
};