Cover the admin Releases page end to end - #990
Merged
Merged
Conversation
`release-admin.tsx` and the five modules #970 split out of it (`release-admin-banners`, `-create`, `-list`, `-unreleased`, and `use-release-admin-data`) had no tests at all. This adds one file that mounts the real `ReleasesAdmin` — a fake `EventSource` for the release stream and a URL-routed `fetch` — so the props wiring between the shell, the panes, and the data hook is exercised together rather than mocked apart. What it pins: - the `UnreleasedChanges` ternary ladder, in priority order: an unreleased-fetch error outranks a missing ref, which outranks the commit count; plus the commit list, the `+N more` overflow line, and the singular/plural wording - `useReleaseAdminData`: both mount fetches, the client-id header that lets the server push info-progress back over the stream, `refresh()` hitting both endpoints, and the promote mutation — request body, the row flipping to stable, and a failed promote surfacing a cleaned error while the confirmation collapses - the promote confirm flow scoped to the row the operator clicked - the create section's render gate, the bumped-tag previews (newest GitHub release wins over the deployed tag), the confirm dialog, the POST body, and the switch into the progress takeover - the banner set: in-flight, failed, and the `watchedRelease` guard that keeps a stale done snapshot from claiming a release just finished, plus the refresh-once-per-run behaviour when one really does Mutation battery: 45 mutants against the six modules, 45 killed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dqcng3rgYPEToKrksY3FZk
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 freeto 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.
What
release-admin.tsxand the five modules #970 split out of it —release-admin-banners.tsx,release-admin-create.tsx,release-admin-list.tsx,release-admin-unreleased.tsx, anduse-release-admin-data.ts— had no test coverage at all.release-utils.tsandOperationTakeoverwere already covered (release-utils.test.ts, PR #982), so this file is scoped to the admin-only surfaces.One test file mounts the real
ReleasesAdminwith a fakeEventSourcefor the release stream and a URL-routedfetch, so the props wiring between the shell, the four panes, and the data hook is exercised together rather than mocked apart.What it pins
+N moreoverflow line, and the singular/plural wording.useReleaseAdminData— both mount fetches, thex-dispatch-release-client-idheader that lets the server push info-progress back over the stream,refresh()hitting both endpoints, and the promote mutation: request body, the row flipping to stable on success, and a failed promote surfacing a cleaned error while the confirmation collapses so the operator gets the button back.watchedReleaseguard that stops a stale done snapshot from claiming a release just finished, plus the refresh-once-per-run behaviour when one really does.Validation
pnpm run check,pnpm run format,pnpm run lint:web(0 errors),pnpm run finalize:web— all cleanpnpm run test— server 164 files/2808 tests, web 72/1090 (1064 → 1090, +26), extension 9/60pnpm run test:e2e— 181 passed / 12 skippedpnpm run test:e2e:live— 11 passed in 20.8s, no straye2e-*tmux sessions or leaked containersA review pass over the diff found six items, all applied: the job fixture now uses the real
Extract<ReleaseJob, { jobType: "create" }>wire type (a typo'd phase previously type-checked and silently gutted a test), four structurally-unfailable negative assertions on sibling ternary branches were deleted, and the client-id lookup got a guard so a missing call fails readably.Test-only change; no product code touched.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Dqcng3rgYPEToKrksY3FZk