Kanshō/Test result card

Test result card

Suite-level test results with expandable failures and per-test timing.

Included in the single kansho full pack. Components are not offered as separate installs.

Suite with one failure (expandable)

tests/auth.test.ts2 passed1 failed68ms
  • createSessionreturns a signed JWT48msPass
  • verifySessionvalidates a good token12msPass

Suite with skipped test

tests/migration.test.ts2 passed1 skipped215ms
  • 0042_sessionssessions table created120msPass
  • 0042_sessionsforeign key to users95msPass
  • 0042_sessionsindex on expires_at0msSkip

Error & recovery

Static preview: suite and per-test Re-run require host callbacks
tests/auth.test.ts — with onRerun2 passed1 failed68ms
  • createSessionreturns a signed JWT48msPass
  • verifySessionvalidates a good token12msPass
tests/auth.test.ts — without onRerun2 passed1 failed68ms
  • createSessionreturns a signed JWT48msPass
  • verifySessionvalidates a good token12msPass

All pass

tests/login-form.test.tsx3 passed74ms
  • LoginFormrenders without errors32msPass
  • LoginFormshows validation error on empty email18msPass
  • LoginFormcalls onSubmit with trimmed values24msPass

Component documentation

Test Result Card

components/sandbox/test-result-card.tsx

Purpose

Summarises a test suite and reveals individual failure details with optional rerun actions.

Appropriate use

Use for read-only test evidence when the host owns execution and recovery.

Example

components/sandbox/test-result-card.tsx has a representative live example in the "Suite with one failure (expandable)" section on /components/test-result-card.

States

Test statuses are pass, fail, and skip; suites may be collapsed or expanded when failures exist, and rerun may target a suite or test.

API and props

TestResultCard accepts suiteName, tests, duration, onRerun, and className; each TestCase supplies name, status, optional duration, optional failureDetail, and optional suite.

Dependencies

Direct imports are React, Lucide icons, StatusPill, duration formatting, and cn.

Accessibility

Failure headers are native disclosure buttons with expanded and controls state; failure details are labelled regions and status is explicit text.

Limitations

It does not run tests, parse output, persist disclosure state, or show pending and failed rerun feedback.

Source

Source: components/sandbox/test-result-card.tsx.

Full pack

components/sandbox/test-result-card.tsx is documented at /components/test-result-card and installs only through the single Kansho full pack; no individual component install is offered.