| ... | @@ -368,14 +368,14 @@ describe("makeQuitShortcutHandler", () => { | ... | @@ -368,14 +368,14 @@ describe("makeQuitShortcutHandler", () => { |
| 368 | expect(harness.notifications).toEqual([DOUBLE_CLICK_DOWN, UP, DOUBLE_CLICK_DOWN]); | 368 | expect(harness.notifications).toEqual([DOUBLE_CLICK_DOWN, UP, DOUBLE_CLICK_DOWN]); |
| 369 | }); | 369 | }); |
| 370 | | 370 | |
| 371 | it("does not treat two quick presses as a quit in hold mode", async () => { | 371 | it("quits on a quick second press in hold mode", async () => { |
| 372 | const harness = makeHarness(); | 372 | const harness = makeHarness(); |
| 373 | await harness.send(makeInput({})); | 373 | await harness.send(makeInput({})); |
| 374 | await harness.send(makeInput({ type: "keyUp" })); | 374 | await harness.send(makeInput({ type: "keyUp" })); |
| 375 | vi.advanceTimersByTime(QUIT_DOUBLE_PRESS_MS - 100); | 375 | vi.advanceTimersByTime(QUIT_DOUBLE_PRESS_MS - 100); |
| 376 | await harness.send(makeInput({})); | 376 | await harness.send(makeInput({})); |
| 377 | expect(harness.quit).not.toHaveBeenCalled(); | 377 | expect(harness.quit).toHaveBeenCalledTimes(1); |
| 378 | expect(harness.notifications).toEqual([HOLD_DOWN, UP, HOLD_DOWN]); | 378 | expect(harness.notifications).toEqual([HOLD_DOWN, UP]); |
| 379 | }); | 379 | }); |
| 380 | | 380 | |
| 381 | it("cancels the hold when another key interrupts it", async () => { | 381 | it("cancels the hold when another key interrupts it", async () => { |