export default { props: { items: [ { description: 'one', completed: true }, { description: 'two', completed: false }, { description: 'three', completed: false } ] }, html: `

one

two

three

1 completed

`, ssrHtml: `

one

two

three

1 completed

`, async test({ assert, component, target, window }) { const inputs = [ ...target.querySelectorAll('input') ]; assert.ok(inputs[0].checked); assert.ok(!inputs[1].checked); assert.ok(!inputs[2].checked); const event = new window.Event('change'); inputs[1].checked = true; await inputs[1].dispatchEvent(event); assert.equal(component.numCompleted, 2); assert.htmlEqual(target.innerHTML, `

one

two

three

2 completed

`); const items = component.items; items[2].completed = true; component.items = items; assert.ok(inputs[2].checked); assert.htmlEqual(target.innerHTML, `

one

two

three

3 completed

`); } };