|
|
|
|
@ -6,24 +6,12 @@ import { test } from '../../test';
|
|
|
|
|
// before destroy_effects walks pending keys.
|
|
|
|
|
export default test({
|
|
|
|
|
mode: ['client'],
|
|
|
|
|
|
|
|
|
|
async test({ assert, target }) {
|
|
|
|
|
await tick();
|
|
|
|
|
|
|
|
|
|
assert.htmlEqual(
|
|
|
|
|
target.innerHTML,
|
|
|
|
|
`
|
|
|
|
|
<button>startA</button>
|
|
|
|
|
<button>startB</button>
|
|
|
|
|
<button>settleB</button>
|
|
|
|
|
<p>A0/B0</p>
|
|
|
|
|
<div><span>1</span><span>2</span></div>
|
|
|
|
|
`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const [startA, startB, settleB] = target.querySelectorAll('button');
|
|
|
|
|
const [startA, startB, settleB, settleA] = target.querySelectorAll('button');
|
|
|
|
|
|
|
|
|
|
// Batch A: add key 9, then block forever on gate A.
|
|
|
|
|
// Batch A: add key 9, then blocks on gate A.
|
|
|
|
|
startA.click();
|
|
|
|
|
await tick();
|
|
|
|
|
|
|
|
|
|
@ -32,17 +20,32 @@ export default test({
|
|
|
|
|
await tick();
|
|
|
|
|
|
|
|
|
|
// Settle B first so B commits while A is still pending.
|
|
|
|
|
// Without the fix this throws reading `.e` of undefined and leaves a/b stuck.
|
|
|
|
|
// Should not take the fast path in each block to clear state.items prematurely.
|
|
|
|
|
settleB.click();
|
|
|
|
|
await tick();
|
|
|
|
|
assert.htmlEqual(
|
|
|
|
|
target.innerHTML,
|
|
|
|
|
`
|
|
|
|
|
<button>startA</button>
|
|
|
|
|
<button>startB</button>
|
|
|
|
|
<button>settleB</button>
|
|
|
|
|
<button>settleA</button>
|
|
|
|
|
<p>A0/B0</p>
|
|
|
|
|
<div><span>1</span><span>2</span></div>
|
|
|
|
|
`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// Settle A so empty array of B can be committed
|
|
|
|
|
settleA.click();
|
|
|
|
|
await tick();
|
|
|
|
|
assert.htmlEqual(
|
|
|
|
|
target.innerHTML,
|
|
|
|
|
`
|
|
|
|
|
<button>startA</button>
|
|
|
|
|
<button>startB</button>
|
|
|
|
|
<button>settleB</button>
|
|
|
|
|
<p>A0/B1</p>
|
|
|
|
|
<button>settleA</button>
|
|
|
|
|
<p>A1/B1</p>
|
|
|
|
|
<div></div>
|
|
|
|
|
`
|
|
|
|
|
);
|
|
|
|
|
|