Skip to content

fix(ui): per-assertion pass/fail breakdown on API monitor detail#86

Merged
samir1498 merged 1 commit into
mainfrom
fix/api-assertion-breakdown
May 26, 2026
Merged

fix(ui): per-assertion pass/fail breakdown on API monitor detail#86
samir1498 merged 1 commit into
mainfrom
fix/api-assertion-breakdown

Conversation

@samir1498
Copy link
Copy Markdown
Collaborator

Summary

Friction #21 from the 2026-05-26 walkthrough. The API check processor already stores assertion_results jsonb per execution row (every assertion's pass/fail + actual vs expected + message). The detail UI was rendering a generic "One or more assertions failed" — operators had to drop to psql to know which assertion failed.

Now: each API monitor run renders its assertion_results inline as a small list with one line per result — pass/fail dot + the evaluator's message (which includes "Expected status code to equal 200, but got 500" / "Header 'Content-Type' contains 'application/json' but got 'text/html'" / etc).

Test plan

  • bun run tsc --noEmit, format:check clean
  • New e2e: tests/ui/api-assertion-detail.e2e.spec.ts creates an API monitor with one passing and one failing assertion, waits for the run, asserts the breakdown renders with one .dot.up and one .dot.down
  • Manual: open any FAILED API monitor's detail page — each row's Detail column now shows the per-assertion list, not the generic message

🤖 Generated with Claude Code

The processor already stores assertion_results (jsonb) per api_executions
row — every assertion's pass/fail + actual + expected + message. The UI
was throwing it away and rendering a generic "One or more assertions
failed" in the Detail column. Operators had to drop to psql to find
which assertion actually failed.

Now: each API monitor run renders its assertion_results inline as a
small ul.assertion-results with one li per result — pass/fail dot +
the message from evaluator (which already includes the actual vs
expected delta, e.g. "Expected status code to equal 200, but got 500"
or "Header 'Content-Type' contains 'application/json' but got 'text/html'").

Non-assertion failures (fetch errors, timeouts) where the row has no
assertion_results keep the existing errorMessage truncated view.

Also widens RunLite.assertionResults so detail.ts isn't reaching
through an unsafe cast.

Test: tests/ui/api-assertion-detail.e2e.spec.ts creates an API monitor
with one passing and one failing assertion against example.com, waits
for the run, and asserts the breakdown renders with one .dot.up and
one .dot.down.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@samir1498 samir1498 merged commit 3fef026 into main May 26, 2026
5 checks passed
@samir1498 samir1498 deleted the fix/api-assertion-breakdown branch May 26, 2026 15:45
@samir1498 samir1498 mentioned this pull request May 26, 2026
samir1498 added a commit that referenced this pull request May 26, 2026
…sh (#89)

Three PRs merged after v1.25.1: #86 (per-assertion failure breakdown
on API monitor detail), #87 (session-expired error wording +
auto-redirect to login), #88 (I've-copied-it dismiss + back-link
wording + domain consistency).

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant