const tasks = [ { description: 'put your left leg in', done: false }, { description: 'your left leg out', done: false }, { description: 'in, out, in, out', done: false }, { description: 'shake it all about', done: false } ]; export default { 'skip-ssr': true, data: { tasks, selected: tasks[0] }, html: `

Pending tasks

put your left leg in

your left leg out

in, out, in, out

shake it all about

`, test(assert, component, target, window) { const input = target.querySelector('input'); const select = target.querySelector('select'); const options = target.querySelectorAll('option'); const change = new window.Event('change'); input.checked = true; input.dispatchEvent(change); assert.ok(component.get().tasks[0].done); assert.htmlEqual(target.innerHTML, `

Pending tasks

your left leg out

in, out, in, out

shake it all about

`); options[1].selected = true; select.dispatchEvent(change); assert.equal(component.get().selected, tasks[1]); assert.ok(!input.checked); input.checked = true; input.dispatchEvent(change); assert.ok(component.get().tasks[1].done); assert.htmlEqual(target.innerHTML, `

Pending tasks

in, out, in, out

shake it all about

`); } };