|
|
|
@ -6,11 +6,10 @@ export default test({
|
|
|
|
|
<button>mutate: 0</button>
|
|
|
|
|
<button>reassign: 0</button>
|
|
|
|
|
<button>mutate: 0</button>
|
|
|
|
|
<button>reassign: 0</button>
|
|
|
|
|
`,
|
|
|
|
|
|
|
|
|
|
async test({ assert, target }) {
|
|
|
|
|
const [btn1, btn2, btn3, btn4] = target.querySelectorAll('button');
|
|
|
|
|
const [btn1, btn2, btn3] = target.querySelectorAll('button');
|
|
|
|
|
|
|
|
|
|
flushSync(() => {
|
|
|
|
|
btn1?.click();
|
|
|
|
@ -22,7 +21,6 @@ export default test({
|
|
|
|
|
<button>mutate: 1</button>
|
|
|
|
|
<button>reassign: 1</button>
|
|
|
|
|
<button>mutate: 0</button>
|
|
|
|
|
<button>reassign: 0</button>
|
|
|
|
|
`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
@ -36,7 +34,6 @@ export default test({
|
|
|
|
|
<button>mutate: 2</button>
|
|
|
|
|
<button>reassign: 2</button>
|
|
|
|
|
<button>mutate: 0</button>
|
|
|
|
|
<button>reassign: 0</button>
|
|
|
|
|
`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
@ -50,7 +47,6 @@ export default test({
|
|
|
|
|
<button>mutate: 3</button>
|
|
|
|
|
<button>reassign: 3</button>
|
|
|
|
|
<button>mutate: 0</button>
|
|
|
|
|
<button>reassign: 0</button>
|
|
|
|
|
`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
@ -64,35 +60,6 @@ export default test({
|
|
|
|
|
<button>mutate: 3</button>
|
|
|
|
|
<button>reassign: 3</button>
|
|
|
|
|
<button>mutate: 0</button>
|
|
|
|
|
<button>reassign: 0</button>
|
|
|
|
|
`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
flushSync(() => {
|
|
|
|
|
btn4?.click();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
assert.htmlEqual(
|
|
|
|
|
target.innerHTML,
|
|
|
|
|
`
|
|
|
|
|
<button>mutate: 3</button>
|
|
|
|
|
<button>reassign: 3</button>
|
|
|
|
|
<button>mutate: 2</button>
|
|
|
|
|
<button>reassign: 2</button>
|
|
|
|
|
`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
flushSync(() => {
|
|
|
|
|
btn3?.click();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
assert.htmlEqual(
|
|
|
|
|
target.innerHTML,
|
|
|
|
|
`
|
|
|
|
|
<button>mutate: 3</button>
|
|
|
|
|
<button>reassign: 3</button>
|
|
|
|
|
<button>mutate: 2</button>
|
|
|
|
|
<button>reassign: 2</button>
|
|
|
|
|
`
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|