// https://github.com/sveltejs/svelte/issues/6112 export default { async test({ assert, target, component, window }) { let inputs = target.querySelectorAll('input'); const check = (set) => { for (let i = 0; i < inputs.length; i++) { assert.equal(inputs[i].checked, set.has(i)); } }; assert.htmlEqual( target.innerHTML, `
1
2
3
` ); check(new Set([0, 2, 5, 6])); const event = new window.Event('change'); // dom to value inputs[3].checked = true; await inputs[3].dispatchEvent(event); check(new Set([0, 3, 5, 6])); assert.equal(component.pipelineOperations[1].operation.args[1].value, 'd'); // remove item component.pipelineOperations = component.pipelineOperations.slice(1); await Promise.resolve(); assert.htmlEqual( target.innerHTML, `
2
3
` ); inputs = target.querySelectorAll('input'); check(new Set([0, 3, 5, 6])); inputs[2].checked = true; await inputs[2].dispatchEvent(event); check(new Set([0, 2, 5, 6])); } };