Skip to content

test: add Vitest test suite and CI workflow - #3

Merged
NagyVikt merged 1 commit into
mainfrom
claude/tests-ci
Jun 22, 2026
Merged

test: add Vitest test suite and CI workflow#3
NagyVikt merged 1 commit into
mainfrom
claude/tests-ci

Conversation

@NagyVikt

Copy link
Copy Markdown
Contributor

First of the follow-up PRs implementing the remaining improvement suggestions. This one establishes the test gate so the subsequent PRs are actually checked.

What

  • Vitest + Testing Library + jsdom with a setup file (test/setup.ts) and config (vitest.config.ts).
  • .github/workflows/ci.yml — runs type-check, build, and test on PRs and pushes to main (Node 20, npm ci).
  • npm scripts: test, test:watch.

Tests (9, behavior-only by design)

Assertions target roles / aria / dir / text / hidden state — never class names — so the suite survives the Tailwind-decoupling restyle coming in a later PR.

  • dir resolution: explicit dir="rtl", dir="auto" reading <html dir>, and live updates via the MutationObserver path.
  • Badge: count render, >9999+, accessible name "<label>, <count>", visual badge aria-hidden, omitted at zero.
  • Active semantics: active link → aria-current="page"; action tab → aria-pressed.
  • useHideTabBar ref-count store: hide/hold/release across multiple consumers.

Verification

npm run type-check, npm run build, npm test all green locally (9/9).

🤖 Generated with Claude Code

https://claude.ai/code/session_01WCE1RpZpzupe5kvo5aGGvV


Generated by Claude Code

There were no tests and no CI, so nothing actually gated changes on PRs.

- Add Vitest + Testing Library + jsdom with a setup file.
- Cover behavior/semantics (not class names, so the suite survives later
  restyling): dir resolution (explicit + auto + live <html dir> changes),
  badge rendering/threshold/accessible name, active aria-current/aria-pressed
  semantics, and the useHideTabBar ref-counted hide store.
- Add npm scripts (test, test:watch) and a GitHub Actions workflow running
  type-check, build, and test on PRs and pushes to main.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WCE1RpZpzupe5kvo5aGGvV
@NagyVikt
NagyVikt marked this pull request as ready for review June 22, 2026 10:29
@NagyVikt
NagyVikt merged commit eeeecef into main Jun 22, 2026
1 check passed
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.

2 participants