export default {
html: `
1
2
3
`,
async test({ assert, component, target, window }) {
let [incrementBtn, ...buttons] = target.querySelectorAll('button');
const clickEvent = new window.MouseEvent('click');
await buttons[0].dispatchEvent(clickEvent);
assert.htmlEqual(
target.innerHTML,
`
2
2
3
`
);
await buttons[0].dispatchEvent(clickEvent);
assert.htmlEqual(
target.innerHTML,
`
4
2
3
`
);
await buttons[2].dispatchEvent(clickEvent);
await buttons[2].dispatchEvent(clickEvent);
assert.htmlEqual(
target.innerHTML,
`
4
2
12
`
);
await incrementBtn.dispatchEvent(clickEvent);
assert.htmlEqual(
target.innerHTML,
`
4
2
12
4
`
);
[incrementBtn, ...buttons] = target.querySelectorAll('button');
await buttons[3].dispatchEvent(clickEvent);
assert.htmlEqual(
target.innerHTML,
`
4
2
12
8
`
);
}
};