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

31 lines
778 B

export default {
async test({ assert, target, window }) {
const [input1, input2] = target.querySelectorAll('input[type=text]');
const radio = target.querySelector('input[type=radio]');
assert.equal(radio.checked, false);
const event = new window.Event('input');
input1.value = 'world';
await input1.dispatchEvent(event);
assert.equal(radio.checked, true);
input2.value = 'foo';
await input2.dispatchEvent(event);
assert.equal(radio.checked, false);
input1.value = 'foo';
await input1.dispatchEvent(event);
assert.equal(radio.checked, true);
input1.value = 'bar';
await input1.dispatchEvent(event);
assert.equal(radio.checked, false);
input2.value = 'bar';
await input2.dispatchEvent(event);
assert.equal(radio.checked, true);
}
};