// https://github.com/sveltejs/svelte/issues/7633 export default { async test({ assert, target, component }) { let inputs = target.querySelectorAll('input'); assert.equal(inputs[0].checked, true); assert.equal(inputs[1].checked, false); assert.equal(inputs[2].checked, false); await component.moveDown(0); await component.moveDown(1); assert.htmlEqual( target.innerHTML, `
b
c
a
` ); // after shifting order, should still keep the correct radio checked inputs = target.querySelectorAll('input'); assert.equal(inputs[0].checked, false); assert.equal(inputs[1].checked, false); assert.equal(inputs[2].checked, true); await (component.current = 'b'); inputs = target.querySelectorAll('input'); assert.equal(inputs[0].checked, true); assert.equal(inputs[1].checked, false); assert.equal(inputs[2].checked, false); await component.moveDown(1); // after shifting order, should still keep the correct radio checked inputs = target.querySelectorAll('input'); assert.equal(inputs[0].checked, true); assert.equal(inputs[1].checked, false); assert.equal(inputs[2].checked, false); } };