ui/goose2/ui_improvements/state_management/phase-8-test-reset-coverage.md
Phase 8: Standardize Test Reset Patterns And Close Coverage Gaps
Status
Goal
Scope
Out Of Scope
Execution Steps
Add full initial-state reset helpers.
Replace partial resets in existing tests.
agentStore.test.tsusePersonas.test.tschatStore.test.tssetState directly.Add project store coverage.
Add provider inventory store coverage if still missing.
setEntries replaces inventory.mergeEntries preserves existing providers and updates overlapping providers.Add session mutation orchestration coverage.
Remove stale assumptions from tests.
useStore() to useStore((state) => ...), so mocks should accept an optional selector and invoke it with the mocked state shape.agentStore.isLoading. If Phase 4 removes or narrows those fields, reset helpers should not preserve stale state shape.Validation
cd ui/goose2 && pnpm testrg "setState\\(\\{" ui/goose2/src/features ui/goose2/src/sharedSuccess Criteria