export default {
async test({ assert, component, target, window }) {
const [btn1, btn2] = target.querySelectorAll('button');
const clickEvent = new window.MouseEvent('click');
await btn2.dispatchEvent(clickEvent);
assert.htmlEqual(target.innerHTML, `
foo: false, bar: true
bar!
`);
await btn1.dispatchEvent(clickEvent);
assert.htmlEqual(target.innerHTML, `
foo: true, bar: true
foo!
`);
await btn2.dispatchEvent(clickEvent);
assert.htmlEqual(target.innerHTML, `
foo: true, bar: false
foo!
`);
await btn1.dispatchEvent(clickEvent);
assert.htmlEqual(target.innerHTML, `
foo: false, bar: false
`);
}
};