Appearance
Testing
Chat ships two test suites: a vitest-based set of standalone runtime tests and a vitest-based set of "connected" runtime tests, plus a Playwright config for browser-level e2e.
Test scripts
chat/package.json:
json
"test": "pnpm test:standalone && pnpm test:connected",
"test:standalone": "vitest run --root . src/runtime/__tests__/resolve-chat-config.spec.ts src/runtime/__tests__/bind-chat-services.spec.ts src/runtime/__tests__/create-host-managed-chat.spec.ts",
"test:connected": "vitest run --root . src/runtime/__tests__/chat-config-profiles.spec.ts",
"test:e2e": "npx playwright test",
"type-check": "tsc -p tsconfig.runtime.json --noEmit"What's tested
src/runtime/__tests__/:
| Spec | What it covers |
|---|---|
resolve-chat-config.spec.ts | Mode resolution, profile merging, config validation. |
bind-chat-services.spec.ts | Service binding (CHAT_CONFIG_SERVICE_KEY), root resolution from bootstrap, target relativization. |
create-host-managed-chat.spec.ts | Host-managed mounting flow with a mock MatrixRuntime. |
chat-config-profiles.spec.ts | Per-profile config overrides (standalone-local vs connected vs daemon-hosted). |
The split between standalone and connected runs corresponds to which transport assumptions the spec makes — standalone specs work with no transport, connected specs assume a remote-actor configuration.
What's not tested
Honest gaps:
- No DOM-component tests.
MatrixChatApp,ChatInput,ChatMessageListare not covered by automated specs in this package. (The element-level concerns are partly covered upstream in@open-matrix/coreforMatrixActorHtmlElementsemantics.) - No e2e in source.
playwright.config.tsexists, bute2e/directory holds legacy fixtures only. No committed Playwright spec exercises the full chat path. - No real
system.agentsintegration test. All adapter tests use mocks. The cognitive proof loop isWORKSTREAMS/loose-ends/items/P1.11-cognitive-product-proof.md— open as of 2026-05-05. - No accessibility audit automation.
- No streaming/cancel tests. The streaming path through
on$Activityis not exercised directly.
Running specs
bash
cd projects/matrix-3/packages/chat
pnpm test:standalone # runs three specs
pnpm test:connected # runs profile spec
pnpm test # bothFor a single spec:
bash
npx vitest run --root . src/runtime/__tests__/bind-chat-services.spec.tsRunning e2e
The Playwright config exists; the spec set is empty. To extend:
bash
cd projects/matrix-3/packages/chat
pnpm test:e2eToday this likely runs zero tests. Adding e2e is a known gap.
Manual verification
Until automated UI tests land, manual verification follows the standard CLAUDE.md "END TO END TESTING" recipe:
- Start a Host with both Chat and
@open-matrix/agentsruntimes registered. - Navigate to
http://127.0.0.1:3100/apps/chat/. - Check console for
system.agentsreachable,system.inferenceconfigured. - Send a prompt to a known target. Verify activity frames render.
- Reload the page; verify the session resumes via
session_state.read.
HTTP 200 is not proof; the console must show no NATS permission errors, no missing-service errors, and the prompt round-trip must complete.
Cross-package checks
Some bind-chat-services tests assert specific mount-rooting behavior that depends on @open-matrix/core resolving the same way Director does. If those tests fail, run pnpm install at the workspace root to refresh symlinks before debugging.
See also
Source:
projects/matrix-3/packages/chat/package.json,chat/src/runtime/__tests__/,chat/playwright.config.ts.