Appearance
Testing
AdminVora is tested in a real browser. There is no unit-test layer: every check below opens the built pages with Playwright and asserts what a person would see or do.
What runs
| Command | What it does |
|---|---|
npm run lint | Static gates: SCSS rules (tokens only, logical properties, specificity ceiling), every data-av-* hook has a reader, docs samples use real classes, scripts and package.json agree. |
npm test | Every browser suite, in sequence. Needs npm run build:html-dist first. |
npm run test:pages | Every page in light and dark: no console errors, one <h1>, no horizontal overflow (down to 320px), nothing fetched from outside the origin. |
npm run test:a11y | axe-core, WCAG 2.1 AA, every page in both modes, against a ratchet baseline. The remaining violations are all Tabulator's grouped-grid ARIA; see Known limitations. |
npm run test:contrast | Every preset in both modes, 4.5:1 on titles, body text, buttons and sidebar roles, measured from computed styles. |
npm run test:rtl | Every page with dir="rtl": no overflow, sidebar on the right. |
npm run test:visual | Pixel comparison of a representative page set in both modes, plus the component QA page under every preset. |
The other suites cover one component or flow each (test:charts, test:dropdowns, test:editor, test:pagination, test:crm, …). package.json is the full list.
Running one suite
bash
npm run build
npm run test:pagesThe suites launch Microsoft Edge by default. Without Edge, set AV_BROWSER=chromium to use Playwright's own Chromium, or name another channel (AV_BROWSER=chrome):
bash
AV_BROWSER=chromium npm run test:pagesThe visual baselines were recorded in Edge on Windows; text renders differently on Linux and macOS, so run test:visual on Windows.
Before merging: run them on Windows
GitHub runs only the static gates (build, lint, audits, docs links). The browser suites run on a Windows PC before a merge. From WSL, one command copies the working tree to %USERPROFILE%\adminvora-test, installs when package-lock.json changed, builds, and runs every suite with the Windows Node and Edge:
bash
tools/test-windows.sh # every suite (tools/run-suites.mjs: all run, one retry each)
tools/test-windows.sh test:pages # one suiteOn failure it prints where the visual diffs and test output are. They used to run on GitHub's Windows runners, but a run took about 55 minutes at double-rate minutes, and the runners' slowness was what made the suites flaky.
Updating a visual baseline
Look at the diff in tests/visual/__diff__/ first. If the change is intended:
bash
npm run test:visual -- --page=/html/pages/dashboards/analytics.html --updateNever re-record a baseline only to make a failing run pass.
Adding a page
Add its path to PAGES in tests/lib/server.mjs. A page that is not listed there is invisible to every suite.