Files
SubMiner/backlog/tasks/task-2.2 - Add-tests-for-overlay-shortcut-handler-service.md

1.5 KiB

id, title, status, assignee, created_date, updated_date, labels, dependencies, references, parent_task_id, ordinal
id title status assignee created_date updated_date labels dependencies references parent_task_id ordinal
TASK-2.2 Add tests for overlay shortcut handler service Done
codex
2026-02-10 18:56 2026-02-18 04:11
TASK-2.1
investigation.md
src/core/services/overlay-shortcut-handler.ts
TASK-2 9000

Description

Add dedicated tests for overlay-shortcut-handler.ts, covering shortcut runtime handlers, fallback behavior, and key edge/error paths.

Acceptance Criteria

  • #1 Shortcut registration/unregistration handler behavior is covered.
  • #2 Fallback handling paths are covered for valid and invalid input.
  • #3 Error and guard behavior is covered for missing dependencies/state.
  • #4 pnpm run test:core remains green.

Implementation Notes

Added src/core/services/overlay-shortcut-handler.test.ts with coverage for:

  • runtime handler dispatch for sync and async actions
  • async error propagation to OSD/log handling
  • local fallback action matching, including timeout forwarding
  • allowWhenRegistered behavior for secondary subtitle toggle
  • no-match fallback return behavior

Updated package.json test:core to include dist/core/services/overlay-shortcut-handler.test.js.

Verification: pnpm run test:core passed (19/19 at completion of this ticket).