Repository navigation
test(frontend): cover the overseer decision -> run refresh flow - #40
Merged
Merged
Conversation
decide() in page.jsx posted the overseer decision and then re-read the displayed run, but no test exercised it: the frontend tests only rendered ResultView. The handler now lives in app/decision.js (decideAndRefresh), which page.jsx calls with its state setters, and test/decision.test.js drives it against a fake API modelled on server/api.py and checks the resulting page state: - approve / reject of the displayed run posts the decision, drops the queue row, re-reads the run, and ResultView then shows the released result / the rejection - a decision on another spec, or without a run id, re-reads nothing - a failed decision is shown and changes nothing else - a failed re-read still reports the recorded decision User-visible fixes found on the way: - a rejection announced "Result rejectd."; it now reads "Result rejected." - a rejected run still said "Output withheld pending release."; it now says "Output rejected by the overseer." - a failed re-read replaced the success notice with the bare error; the notice now keeps the decision and appends the error Only the button -> decide() binding in page.jsx stays untested; a component-level test would need a DOM test environment, a new dev dependency.
RunStatus.reasons carries bare codes (server/schemas.py PublicReason; server/analysis_service.py _public_reasons keeps only the part before ':'), but heldReason() matched "k_anon:"-style prefixes, so every real flagged or rejected run showed the generic "Disclosure review required." It now matches on the code before any ':', which covers both forms; the existing prefixed-reason test still holds and a new test uses the codes the API actually sends. AGENTS.md: CI runs on pushes to main and on every pull request, not on every push.
vbabenko97
changed the base branch from
babenko/disclosure-governance
to
main
September 25, 2026 09:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #39, which is now merged; this PR targets
main. CI ran while it was stacked on #39's branch, whose tree matchesmainafter that merge.Summary
#39 made the UI reload the displayed run after an overseer decision, but no automated test covered that flow. This PR adds tests for approve/reject → result refresh and fixes three user-visible problems found along the way.
Changes
Decision flow, now tested (
frontend/app/decision.js,frontend/test/decision.test.js)page.jsxintodecideAndRefresh(api, request, { setPending, setNotice, setRun }).page.jsxcalls it with its own state setters, so the tests exercise the same state updates the page makes.server/api.py(overseer_decide,_decision_update, theRunStatusshape):ResultViewshows the released result or the rejection.Fixes found on the way
heldReason()expectedk_anon:-style prefixes, but the API sends bare codes (PublicReason,_public_reasons). Every real flagged or rejected run therefore showed the generic "Disclosure review required." It now matches the code before any:, so both forms work. A new test uses the bare codes.mainand on every pull request, not "on every push".Verification
nodeandnpmin the environment where this was written.result-view.jsx,decision.jsand the installedreact-domstatic renderer. It found no failing assertion. The gaps it raised (untested state wiring, therunIdguard, the POST body, fixture shapes) are addressed in this PR.git diff --check: clean.Not covered
onClick→decide()binding inpage.jsx. A component-level test needs a DOM environment (jsdom and Testing Library), which would be a new dev dependency.