|
|
|
@ -15,11 +15,11 @@ export default {
|
|
|
|
|
<p>baz x: initial</p>
|
|
|
|
|
`,
|
|
|
|
|
|
|
|
|
|
test ( assert, component, target, window ) {
|
|
|
|
|
async test(assert, component, target, window) {
|
|
|
|
|
const click = new window.MouseEvent('click');
|
|
|
|
|
const buttons = [...target.querySelectorAll('button')];
|
|
|
|
|
|
|
|
|
|
buttons[0].dispatchEvent( click );
|
|
|
|
|
await buttons[0].dispatchEvent(click);
|
|
|
|
|
|
|
|
|
|
assert.equal(component.x, 'p');
|
|
|
|
|
assert.htmlEqual(target.innerHTML, `
|
|
|
|
@ -32,7 +32,7 @@ export default {
|
|
|
|
|
<p>baz x: p</p>
|
|
|
|
|
`);
|
|
|
|
|
|
|
|
|
|
buttons[1].dispatchEvent( click );
|
|
|
|
|
await buttons[1].dispatchEvent(click);
|
|
|
|
|
|
|
|
|
|
assert.equal(component.x, 'q');
|
|
|
|
|
assert.htmlEqual(target.innerHTML, `
|
|
|
|
@ -45,7 +45,7 @@ export default {
|
|
|
|
|
<p>baz x: q</p>
|
|
|
|
|
`);
|
|
|
|
|
|
|
|
|
|
buttons[2].dispatchEvent( click );
|
|
|
|
|
await buttons[2].dispatchEvent(click);
|
|
|
|
|
|
|
|
|
|
assert.equal(component.x, 'r');
|
|
|
|
|
assert.htmlEqual(target.innerHTML, `
|
|
|
|
|