Skip to content

Add specs for experimental aria abstract base classes - #654

Open
fpigeonjr wants to merge 1 commit into
masterfrom
gh-635-add-specs-for-experimental-aria-abstract-base-clas
Open

Add specs for experimental aria abstract base classes#654
fpigeonjr wants to merge 1 commit into
masterfrom
gh-635-add-specs-for-experimental-aria-abstract-base-clas

Conversation

@fpigeonjr

Copy link
Copy Markdown
Contributor

Description

Adds unit-test specs for the experimental ARIA grid/combobox abstract base classes in src/ui-kit/experimental/aria/, which previously had little to no coverage. Each class is exercised through its public interface using minimal DOM fixtures (or, for AbstractCombobox, a hand-rolled FakePopup stub matching AbstractGrid's public surface) rather than reaching into private state.

New spec files:

  • utils/events.spec.tsEventDispatcher: on/dispatch/disconnect/disconnectAll, invalid-event guards, duplicate-callback dedup
  • abstract-grid/abstract-cell.spec.tsAbstractCell: role/key/value parsing, focus-target resolution, tab-order toggling, click/keydown dispatch
  • abstract-grid/abstract-row.spec.tsAbstractRow: cell discovery by role, addCell
  • abstract-grid/abstract-grid.spec.tsAbstractGrid: grid discovery, initial focus, arrow-key navigation with edge clamping, click delegation, config flags (disableFocus, useDefaultKeydownEvents, useDefaultClickEvents)
  • abstract-combobox/abstract-combobox.spec.tsAbstractCombobox: value proxy, search/change dispatch, arrow-key delegation to a popup, Enter-to-commit, popup-click-to-commit

No production source files were changed — this is spec-only, per the parent issue's scope.

Motivation and Context

Closes #635

Part of the coverage-improvement work tracked under #576 (angular-upgrade epic).

Type of Change (Select One and Apply Label)

  • Bug fix (non-breaking change which fixes an issue) → Apply bugfix label
  • New feature (non-breaking change which adds functionality) → Apply enhancement label
  • Breaking change (fix or feature that would cause existing functionality to change) → Apply breaking label
  • Documentation / configuration update → Apply maintenance label

How to Test

  1. npm ci && npm ci --prefix test-app
  2. npm --prefix test-app test — all 707 specs pass (was 667); coverage summary printed at the end
  3. npm run coverage:check — confirms the ratcheting coverage floor still passes (overall statements moved 53.56% → 56.97%)
  4. npm run lint:baseline — confirms no new ESLint warnings beyond the recorded baseline
  5. npm run format:check — confirms Prettier formatting
  6. cd test-app && npm run build — confirms the app still builds

Expected result: all specs pass, coverage for the five target files rises from 0%/2.08% baselines to 89.6% (abstract-grid.ts), 69.49% (abstract-combobox.ts), 100% (abstract-row.ts), 92% (abstract-cell.ts), and 94.28% (utils/events.ts); no lint/format regressions.

Screenshots (if appropriate)

N/A — test-only changes, no UI impact.

Checklist

  • Branch name follows convention (e.g. gh-<number>-<slug>)
  • PR title starts with a verb in the imperative mood
  • I have self-reviewed my own code
  • format:check passes (npm run format:check)
  • lint passes (npm run lint)
  • build passes (cd test-app && npm run build)
  • Tests pass and coverage is reported (cd test-app && npm test)
  • If this change requires a documentation update, I have updated it accordingly
  • If there are dependent changes, they have been merged and published in downstream modules

Raises unit-test coverage for src/ui-kit/experimental/aria/ from 0%
(abstract-grid, abstract-combobox, abstract-row, utils/events) and
2.08% (abstract-cell) via minimal DOM fixtures / a hand-rolled popup
stub exercising each class's public keyboard/focus-management
contract.

Coverage: abstract-grid.ts 0% -> 89.6%, abstract-combobox.ts 0% ->
69.49%, abstract-row.ts 0% -> 100%, abstract-cell.ts 2.08% -> 92%,
utils/events.ts 0% -> 94.28%. Overall statements 53.56% -> 56.97%.

Closes #635
@fpigeonjr fpigeonjr added the maintenance Repo maintenance / tooling label Aug 28, 2026
@fpigeonjr fpigeonjr self-assigned this Aug 28, 2026
@fpigeonjr
fpigeonjr requested a lite review from Copilot August 28, 2026 16:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Vitest/JSDOM unit specs to significantly increase coverage for the experimental ARIA abstract base classes under src/ui-kit/experimental/aria/, exercising behavior via minimal DOM fixtures and a lightweight popup stub for the combobox path.

Changes:

  • Added unit tests for EventDispatcher (registration, dispatch, disconnect behavior, invalid-event guards).
  • Added unit tests for AbstractCell, AbstractRow, and AbstractGrid (role parsing, focus/tab-order management, click/keydown handling, navigation and config flags).
  • Added unit tests for AbstractCombobox (value proxying, search/change dispatch, arrow-key selection and commit behavior via a fake popup).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/ui-kit/experimental/aria/utils/events.spec.ts Adds coverage for the event dispatcher utility used by the ARIA base classes.
src/ui-kit/experimental/aria/abstract-grid/abstract-cell.spec.ts Adds focused tests around cell parsing, focus target selection, and event dispatch wiring.
src/ui-kit/experimental/aria/abstract-grid/abstract-row.spec.ts Adds tests for row cell discovery and addCell behavior.
src/ui-kit/experimental/aria/abstract-grid/abstract-grid.spec.ts Adds tests for grid discovery, initial focus, navigation, and default click/keydown behaviors.
src/ui-kit/experimental/aria/abstract-combobox/abstract-combobox.spec.ts Adds tests for combobox value/search/change behavior and popup-driven selection/commit flows.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/ui-kit/experimental/aria/abstract-grid/abstract-row.spec.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Repo maintenance / tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add specs for experimental aria abstract base classes

3 participants