Add a jsdom test (dashboard/js/backward-compat.test.js) that loads the ambient Canvas 2D renderer for real and drives a render frame — the first test suite to actually exercise the renderer (ambient.test.js skips itself when SpaxelAmbientRenderer is undefined; viz3d cannot load under jsdom due to Three.js/WebGL). Covers parent bf-2gmx's core runtime acceptance criterion: - identity-LESS blob (no personName/assignedColor/identityResolved, e.g. sim without --ble): renders with no throw, sane fallback label '?' and neutral grey color, no 'undefined'/'NaN' in output. - identity-resolved blob: renders WITH the person name + per-person color. - mixed fleet: both paths together, no undefined/NaN. To make the identity-field read path reachable, fix a latent bug in the renderer's updateState(): it copied zones/portals/nodes/alerts but not blobs, so drawPeople() (which iterates currentState.blobs) never drew any people — ambient mode rendered no one. Add the missing `if (state.blobs) currentState.blobs = state.blobs;` mirroring the neighboring copies. getPersonColor()/getFirstName() already guard against undefined names (bf-gcotl). 9/9 pass; full suite shows no new regressions (proactive/sidebar-timeline failures are pre-existing, confirmed by stash baseline). Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| css | ||
| js | ||
| static | ||
| test-results | ||
| tests | ||
| types | ||
| ambient.html | ||
| fleet.html | ||
| help_articles.json | ||
| index.html | ||
| integrations.html | ||
| jest.config.js | ||
| live.html | ||
| package-lock.json | ||
| package.json | ||
| playwright.config.js | ||
| README.md | ||
| setup.html | ||
| simple.html | ||
| simulator.html | ||
| test-transformcontrols.html | ||
| tsconfig.json | ||
Spaxel Dashboard
Running Tests
Unit Tests (Jest)
npm test
Accessibility Tests (axe-core + Playwright)
# First-time setup: install browsers
npx playwright install --with-deps chromium
# Run accessibility gate
npm run test:a11y
The accessibility test loads each dashboard page (index, live, fleet, setup, integrations) via a local static server and asserts zero WCAG 2A/2AA violations using @axe-core/playwright. CI fails the build if any violation is introduced.
CI Integration (Argo Workflows)
Add the following step to the spaxel-build WorkflowTemplate before the container build:
- name: a11y-gate
container:
image: node:20-bookworm-slim
command: [sh, -c]
args:
- |
cd dashboard
npm ci
npx playwright install --with-deps chromium
npm run test:a11y
resources:
limits:
memory: 512Mi
cpu: "1"