Govern task context and advance execution pointer
This commit is contained in:
@@ -25,3 +25,13 @@ test("M14-04F commits pen stroke once and ignores late up/cancel", () => {
|
||||
state = modal.commitPenStroke(state, 9);
|
||||
assert.deepEqual([state.kind, state.mainCommitCount, state.activePointerIds], ["NONE", 1, []]);
|
||||
});
|
||||
|
||||
test("M14-04F reduces production pointer events and rejects invalid IDs", () => {
|
||||
let state = modal.createInputModalState();
|
||||
state = modal.reduceInputModal(state, { type: "pointerdown", pointerType: "touch", pointerId: 2 });
|
||||
state = modal.reduceInputModal(state, { type: "pointerdown", pointerType: "touch", pointerId: 4 });
|
||||
assert.equal(state.navigationRevision, 1);
|
||||
state = modal.reduceInputModal(state, { type: "pointercancel", pointerType: "touch", pointerId: 2 });
|
||||
assert.deepEqual([state.kind, state.activePointerIds, state.cancelled], ["NONE", [], true]);
|
||||
assert.throws(() => modal.reduceInputModal(state, { type: "pointerdown", pointerType: "pen", pointerId: -1 }), /POINTER_ID_INVALID/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user