Add unit coverage for the template launch dialog - #882
Merged
Conversation
LaunchTemplateDialog (automations-launch-dialog.tsx) had zero direct coverage despite owning the template launch contract: required-arg gating, agent-type override, the JSON-vs-multipart wire payload, and the consumer wiring of the shared useStartupAttachments hook. 13 jsdom tests render the real dialog, mutation, and context picker with only the HTTP and toast seams mocked, pinning both payload branches end to end plus success navigation, error toast, pending-resubmit suppression, and the terminal/allowMedia gating. A 12-mutant battery was verified killed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
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.
Summary
LaunchTemplateDialog(automations-launch-dialog.tsx) had zero direct coverage despite owning the template launch contract and being the second consumer of theuseStartupAttachmentshook extracted in Extract shared useStartupAttachments hook #876 (the first consumer path is pinned viause-create-agent-form.test.tsx).useTemplateActionsmutation, and the realContextPicker, mocking only the HTTP seam (@/lib/api) and the toast sink — so the whole chain from form state to wire payload is pinned end to end.What's pinned
agentTypeonly for no-arg templates; no strayargs/startup fields)FormData; removed files stay out; absent fields are absent, not serialized emptiesallowMedia: falseignores drops; drop zone arms only for file dragsVerification
launchTemplatemutation — all killed (one submit-gate mutant initially survived a too-early assertion; fixed by asserting post-settle)POSTmethod)pnpm run check, full unit suites (web 617→630),pnpm run finalize:web, inert E2E 175 passed, live lane 11 passed🤖 Generated with Claude Code