test(canvas): add ChannelsTab + ScheduleTab + TracesTab tests (125 cases) #523

Merged
core-lead merged 6 commits from test/channels-tab into main 2026-05-11 17:23:39 +00:00

6 Commits

Author SHA1 Message Date
fe21795dcc test(canvas): add TracesTab tests (36 cases)
Some checks failed
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 16s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 21s
sop-tier-check / tier-check (pull_request) Successful in 21s
Harness Replays / detect-changes (pull_request) Successful in 26s
CI / Detect changes (pull_request) Successful in 47s
Harness Replays / Harness Replays (pull_request) Successful in 5s
E2E API Smoke Test / detect-changes (pull_request) Successful in 44s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 39s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 40s
CI / Platform (Go) (pull_request) Successful in 7s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 44s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 5s
CI / Python Lint & Test (pull_request) Successful in 6s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 8s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 6s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 5s
audit-force-merge / audit (pull_request) Successful in 8s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 7m20s
CI / Canvas (Next.js) (pull_request) Failing after 7m56s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
Cover loading/error/empty states, trace list rendering, expand/collapse
with aria-expanded/aria-controls, status dot colors (bg-bad/bg-good),
latency formatting (ms vs seconds), token count, cost display,
input/output rendering (object and string), refresh, and formatTime
relative timestamps.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 17:20:41 +00:00
369360bc99 test(canvas): add ScheduleTab tests (49 cases)
Add 49 test cases covering schedule list, status dot colors,
toggle/edit/delete/run-now, create/edit forms, form validation,
auto-refresh (10s interval), cronToHuman/relativeTime formatting,
and error states.

Also fix ScheduleTab: (1) set error state on GET failure so the
banner is visible, (2) move error banner outside the form block so
non-form errors are shown to the user.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 17:20:41 +00:00
8c61a1acba test(canvas): add ChannelsTab tests (40 cases)
Cover channel list, toggle, delete, discover, form validation,
schema-driven inputs (password/textarea/text), platform switching,
allowed_users, auto-refresh, and error states.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 17:20:41 +00:00
a58fa26f28 chore: retrigger CI after rebase to main 2026-05-11 17:20:41 +00:00
1f895ced2b test(canvas): add EventsTab tests (18 cases)
Covers: loading/empty/event-list states, event_type color mapping,
expand/collapse with aria-expanded/aria-controls, refresh button,
error state from API rejection, auto-refresh interval via setInterval mock,
and unmount cleanup.

Key patterns:
- vi.hoisted() for module-level api mock (vi.mock hoisting)
- vi.useRealTimers() for non-timing tests; spyOn(setInterval/clearInterval)
  for auto-refresh tests to avoid Vitest fake-timer infinite loops
- fireEvent.click + native .click() via act() for expand/collapse
- Re-query DOM after state flush to avoid stale element references

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 17:20:41 +00:00
dbc11023b7 test(ExternalConnectModal): 18 cases — modal render, tabs, token stamping, copy
Adds first test coverage for canvas/ExternalConnectModal. Tests: renders null
when info absent, dialog open/close, default tab selection (Universal MCP vs
Python), tab switching and visibility (Hermes/Codex conditional), auth token
stamping for Python/MCP/curl snippets, clipboard.writeText API call,
close button callback, security warning, Fields tab with (missing) fallback.

Radix Dialog tested by rendering with open=true. Clipboard API mocked via
Object.defineProperty in beforeEach. renderAndFlush uses act(()=>{}) to
synchronously flush Radix portal rendering so dialog queries work without
waitFor (which times out under vi.useFakeTimers).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 17:20:41 +00:00