Skip to content

test(agent): pin the admin dashboard page contract - AdminDashboardPage - #2026

Merged
dmitrii-f-t27 merged 1 commit into
queenfrom
zcode/tests-1594-admin-dashboard
Oct 15, 2026
Merged

dmitrii-f-t27 merged 1 commit into
queenfrom
zcode/tests-1594-admin-dashboard

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Collaborator

Closes #1594

First suite for entrypoints/app/admin-dashboard/AdminDashboardPage.tsx (199 lines, unmodified). The history hook answers its initial empty map (it populates through effects a static render never runs), so the page's static answer is the EMPTY dashboard: three tests pin its header and approvals slots (stubbed with named markers - their own suites own their contracts), the Audit Trail section with its empty-state card (the shield icon, the note, and the run-count line pinned as ABSENT by its own shape - the delete dialog's fixed sentence also carries the words 'recorded run', measured), and the delete AlertDialog in its controlled-closed shape (title, description with the empty task name, Cancel and Delete). The storage seam is the repository's in-memory item shim. Not pinned: the populated audit trail (it rides the effect-populated hook), the delete flow and the toasts.

Verified: suite alone 3/3; the admin-dashboard directory one process green; broken copy (the empty-state title reworded, the section title reworded - valid syntax) 2 catcher tests fail, restored byte-identical; biome clean after one auto-format; tsgo with 0 mentions of this file.

Spec: the issue is the executable contract for a test-only change; the suite is the pin.

Dmitrii Fedorov (@dmitrii-f-t27)

@tri-claw

tri-claw Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Summary by t27-bees

This PR adds a contract test for AdminDashboardPage that pins its empty-state static render. The test stubs the history hook (which populates via effects that don't run in renderToStaticMarkup), the storage layer, and child components, then asserts on header/approvals slots, the Audit Trail empty-state card, and that the delete dialog renders nothing when closed.

Worth a look

  • trios/agent-server/apps/agent/entrypoints/app/admin-dashboard/AdminDashboardPage.test.ts:47–61 β€” The @wxt-dev/storage mock returns a hardcoded fallback only for local:tool-approval-config; if the component starts reading other keys without fallbacks, the test will silently pass with null instead of surfacing the missing configuration.
  • trios/agent-server/apps/agent/entrypoints/app/admin-dashboard/AdminDashboardPage.test.ts:62–66 β€” useExecutionHistoryByConversation is mocked to return {}, but the component may expect { data: [], isLoading: false } or similar shape; a shape mismatch would only appear as a runtime error in the component, not a test failure here.
  • trios/agent-server/apps/agent/entrypoints/app/admin-dashboard/AdminDashboardPage.test.ts:68–83 β€” The AlertDialog mock renders children only when open is true. This mirrors the "group's dialog stand-ins" per the comment, but diverges from the real Radix AlertDialog (which renders portal content regardless of open and controls visibility via CSS). If the real component ever relies on the dialog being in the DOM while closed, this test won't catch it.
  • trios/agent-server/apps/agent/entrypoints/app/admin-dashboard/AdminDashboardPage.test.ts:108 β€” expect(m).not.toContain('recorded runs across') pins the absence of the run-count line, but the comment notes the delete dialog's description also contains "recorded run". If the dialog ever renders while closed (e.g., a bug in the open prop), this assertion could flakily pass/fail for the wrong reason.
  • trios/agent-server/apps/agent/entrypoints/app/admin-dashboard/AdminDashboardPage.test.ts:95–97 β€” The test imports AdminDashboardPage after all mocks are registered. This works because mock.module hoists, but it couples test execution order to the mock setup; if another test file in the same process imports the component first (e.g., via a shared setup), the mocks may not apply.

Read: 1 files, +132 -0, the whole diff. Head db8044d. Model: openai-compatible/nvidia/nemotron-3-ultra-550b-a55b. Commands: @t27-bees review | summary | help | pause | resume. Free for every repository.

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

βœ… Tests passed β€” 3811/3881

Suite Passed Failed Skipped
βœ… agent 409/409 0 0
βœ… build 9/9 0 0
βœ… cdp-protocol 5/5 0 0
βœ… eval 93/93 0 0
βœ… server-agent 280/280 0 0
βœ… server-api 2189/2258 0 69
βœ… server-browser 6/6 0 0
βœ… server-integration 10/11 0 1
βœ… server-lib 279/279 0 0
βœ… server-pglive 166/166 0 0
βœ… server-root 68/68 0 0
βœ… server-sim 8/8 0 0
βœ… server-skills 31/31 0 0
βœ… server-tools 244/244 0 0
βœ… shared 14/14 0 0

View workflow run

Closes #1594

The alert stand-in's root honours the open flag (the first push passed
content through unconditionally and broke the sibling Skills and
ScheduledTasks closed-alert pins in the CI readdir order).
@dmitrii-f-t27
dmitrii-f-t27 force-pushed the zcode/tests-1594-admin-dashboard branch from 46b0e6c to db8044d Compare October 15, 2026 01:41
@dmitrii-f-t27

Copy link
Copy Markdown
Collaborator Author

Gate check before merge (the fixed head):

Tests: 19/19 green on this exact SHA - incl. Tests / agent (the first push broke the sibling Skills and ScheduledTasks suites: an unconditional alert-dialog passthrough rendered their CLOSED alerts' content and flipped their not.toContain pins; the stand-in's root now honours the open flag exactly like the group's dialog registrations, and the mixed order over admin-dashboard + skills is green 10/10 - measured locally) and Tests / server-pglive (no rerun needed).

runner / Typecheck - GREEN, 0 errors, 0 mentions of this PR's file.

runner / Biome - red from base, 0 mentions of this PR's file, 0 new findings.

Dmitrii Fedorov (@dmitrii-f-t27)

@dmitrii-f-t27
dmitrii-f-t27 merged commit 7c7ac79 into queen Oct 15, 2026
19 checks passed
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