Add SettingsTab component tests for jobs settings - #908
Merged
Conversation
Pin the jobs SettingsTab contract that had no direct coverage: the full save payload (unit conversions, schedule trim-to-null, worktree branch gating, the keepAgent -> autoArchive inversion), canSave gating, the enabled toggle's minimal payload with optimistic set and revert on error, the job-switch reset vs same-job refetch no-clobber behavior, CLI-only agent types with model reset on type change, webhook URL branches, and the confirm-gated remove flow. Renders the real field components (jobs-form-fields, BranchSelect, AgentModelSelect) with only the HTTP seam mocked; an 11-mutant battery against the component all fail the suite. 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
apps/web/src/components/app/jobs-settings-tab.test.tsx— 21 jsdom tests pinning the jobs SettingsTab contract, which had no direct component coverage (onlyjobs-helpersunit tests existed). This closes the Extract shared JobScheduleField and JobAgentTypeField #880 jobs-form-fields follow-up from the recurring test-enforcer job: the extractedJobScheduleField/JobAgentTypeField/option components are now exercised through their real consumer.What the tests pin
baseBranch/branchNamenulled when unchecked), thekeepAgent→autoArchiveinversion, and every advanced toggle passthrough.{name, directory, enabled}), revert + error banner on failure, single-fire while in flight.Test design
jobs-form-fields,BranchSelect,AgentModelSelect) and real react-query model-catalog query; only@/lib/apiis mocked.jobs-settings-tab.tsx/jobs-form-fields.tsx— all killed (payload gating, inversion, model reset, CLI filter,showEnabled, reset-effect deps, revert-on-error, enabled reset).gcTime: 0, single-call assertion,clickSavestale-banner guard).Validation
pnpm run check✓pnpm --filter @dispatch/web test✓ (55 files, 697 tests)pnpm run finalize:web✓🤖 Generated with Claude Code