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

one

two

three

1 completed

`, 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; inputs[1].dispatchEvent( event ); assert.equal( component.get( 'numCompleted' ), 2 ); assert.htmlEqual( target.innerHTML, `

one

two

three

2 completed

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

one

two

three

3 completed

` ); } };