Skip to content

test(coverage): Cover the shell, map and task-queue components - #315

Merged
yahyafakhroji merged 7 commits into
mainfrom
test/shell-map-task-queue-coverage
Nov 19, 2026
Merged

yahyafakhroji merged 7 commits into
mainfrom
test/shell-map-task-queue-coverage

Conversation

@yahyafakhroji

Copy link
Copy Markdown
Contributor

Problem
About 3,700 lines of shipped UI had little or no test coverage. The coverage gate never checked Map or PlaceAutocomplete, because datum-ui re-exports them through src/exports/map.ts, and the baseline exempted Sidebar and Stepper. TaskQueue's hooks had no tests either.

Solution
The coverage gate now follows src/exports/ re-exports, so it checks Map and PlaceAutocomplete like any other component. New tests cover PlaceAutocomplete search and selection, Map rendering and its controls, Sidebar toggling and its shortcut, Stepper navigation and step states, and TaskQueue's queue and scope hooks. Sidebar and Stepper leave the coverage baseline. No component code changes.

Closes #314

…rted components

The coverage gate only read exports whose source sits under
src/components, so Map and PlaceAutocomplete, re-exported through
src/exports/map.ts, were never checked and PlaceAutocomplete had no
tests. The gate now follows src/exports re-exports, and new tests cover
searching, keyboard selection, Escape, the empty and error states, and
cancelling a stale search.
Map's only test covered the theme-aware tile layer. A smoke test now
mounts the real lazy-loaded Leaflet map, and the zoom, locate and
fullscreen controls are tested against a fake Leaflet map: zooming,
disabling at the zoom limits, locating and reporting the result or the
error, and following the map's fullscreen events.
Sidebar had no tests and the coverage baseline exempted it. New tests
cover the trigger, defaultOpen and controlled open, the Cmd+B and
Ctrl+B shortcut (a bare b, including one typed in the sidebar input,
does nothing), the state cookie, the mobile sheet, and active and
disabled menu items. Sidebar leaves the coverage baseline.
Stepper had no tests and the coverage baseline exempted it. New tests
cover moving next and back, staying on the first and last steps, the
current, completed and upcoming step states, disabled steps that
cannot be clicked, and the helpers for step state, DOM ids and
arrow-key focus. Stepper leaves the coverage baseline.
useTaskQueue and the scope helpers had no tests. New tests cover the
error outside a provider, listing, cancelling, filtering and
dismissing tasks, picking the project, org or global scope, matching
tasks to the current scope, the context labels, and when the task list
shows those labels.
Typing starts a search per letter, so the error-state test could hold
an element an earlier search rendered just before the component
replaced it, and failed now and then in the full run. It now waits
for a fresh match.
The bare-b sidebar test pressed b twice, so with the Cmd/Ctrl check
removed the two toggles cancelled out and it still passed. The task
status-filter test had one task, so it passed without the filter. The
search test read the last request URL before the final keystroke's
search could run. Each now fails with its behaviour removed: separate
bare-b tests, a never-finishing task beside the completed one, and a
wait for the full query.
@yahyafakhroji
yahyafakhroji merged commit bf4db1e into main Nov 19, 2026
9 checks passed
@yahyafakhroji
yahyafakhroji deleted the test/shell-map-task-queue-coverage branch November 19, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for untested shell, map and task-queue components

2 participants