test: add Vitest test suite and CI workflow - #3
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
test/setup.ts) and config (vitest.config.ts)..github/workflows/ci.yml— runstype-check,build, andteston PRs and pushes tomain(Node 20,npm ci).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.dirresolution: explicitdir="rtl",dir="auto"reading<html dir>, and live updates via the MutationObserver path.>99→99+, accessible name"<label>, <count>", visual badgearia-hidden, omitted at zero.aria-current="page"; action tab →aria-pressed.useHideTabBarref-count store: hide/hold/release across multiple consumers.Verification
npm run type-check,npm run build,npm testall green locally (9/9).🤖 Generated with Claude Code
https://claude.ai/code/session_01WCE1RpZpzupe5kvo5aGGvV
Generated by Claude Code