Wave 0 TDD stubs, Wave 1 parallel (registry + ReviewStep), Wave 2 act() fix. Covers TECH-01 through TECH-05. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8.9 KiB
8.9 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 05-tech-debt | 00 | tdd | 0 |
|
true |
|
|
Purpose: Establish RED state before implementation plans run — per project TDD pattern (Wave 0 stubs before implementation). Output: Modified ReviewStep.test.tsx with 4 new failing describe blocks, modified registry.test.ts with .fields access.
<execution_context> @C:/Users/SebastienQUEROL/.claude/get-shit-done/workflows/execute-plan.md @C:/Users/SebastienQUEROL/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/05-tech-debt/05-CONTEXT.md @.planning/phases/05-tech-debt/05-RESEARCH.mdFrom src/store/types.ts:
export interface WizardState {
currentStep: number;
remote: { name: string; backendType: BackendType | null; params: Record<string, string> };
deployment: {
includeInstall: boolean;
configPath: 'machine-wide' | 'user-profile';
scriptTargets: ('intune' | 'rmm')[];
};
}
export type WizardAction =
| { type: 'SET_STEP'; payload: number }
| { type: 'SET_DEPLOYMENT'; payload: Partial<WizardState['deployment']> }
// ... other actions
export const INITIAL_STATE: WizardState = {
deployment: { scriptTargets: ['intune', 'rmm'], ... },
};
From src/store/context.tsx:
// WizardProvider does NOT accept initialState — uses INITIAL_STATE hardcoded
export function WizardProvider({ children }: { children: React.ReactNode })
From src/schemas/registry.ts (CURRENT shape — will change in Plan 01):
export const BACKEND_REGISTRY: Record<BackendType, FieldDef[]> = { ... }
// After TECH-03 it becomes: Record<BackendType, { displayName, description, fields: FieldDef[] }>
Preferred approach (no code changes to production): create a `WizardConsumerSetup` React component inside the test file that calls `dispatch(SET_DEPLOYMENT)` in a `useEffect` on mount, then renders children. Wrap ReviewStep with it in renderWithDeployment.
Add these new describe blocks (append to existing file — do NOT remove any existing tests):
- describe('TECH-01: scriptTargets filtering', ...) with 4 it() cases covering intune-only, rmm-only, neither, and ZIP-neither
- describe('TECH-02: Back button navigation', ...) with 1 it() case verifying button labeled 'Back' renders
These tests MUST FAIL (RED state) because ReviewStep not yet modified. Confirm by running the test suite and seeing failures on the new cases.
Note: ZIP-neither test — mock downloadZip is already set up in beforeEach. The test clicks the ZIP button with scriptTargets=[] and asserts files array has length 1.
Note: TECH-02 Back button test — check `screen.getByRole('button', { name: /back/i })` renders. The navigation itself (SET_STEP dispatch) is trivially verifiable by asserting the button exists and is not disabled (dispatch correctness verified by ReviewStep implementation, not mocked here).
Changes needed (per RESEARCH.md pitfall 2):
- Line 15: `BACKEND_REGISTRY[backend].length` → `BACKEND_REGISTRY[backend].fields.length`
- Line 21: `for (const field of BACKEND_REGISTRY[backend])` → `for (const field of BACKEND_REGISTRY[backend].fields)`
- Line 38: `BACKEND_REGISTRY.azureblob.find(f => f.key === 'account')` → `BACKEND_REGISTRY.azureblob.fields.find(f => f.key === 'account')`
- Line 44: `BACKEND_REGISTRY.s3.map(f => f.key)` → `BACKEND_REGISTRY.s3.fields.map(f => f.key)`
- Line 51: `BACKEND_REGISTRY['s3-compatible'].find(f => f.key === 'endpoint')` → `BACKEND_REGISTRY['s3-compatible'].fields.find(f => f.key === 'endpoint')`
These changes will make registry.test.ts FAIL (RED state) because registry.ts still has the old `FieldDef[]` shape. That's expected — Plan 01 fixes the production code to green.
Also add a new test case verifying the enriched shape structure (will also be RED until Plan 01):
```
it('each backend entry has displayName and description metadata', () => {
for (const backend of EXPECTED_BACKENDS) {
expect(BACKEND_REGISTRY[backend].displayName).toBeTruthy();
expect(BACKEND_REGISTRY[backend].description).toBeTruthy();
}
});
```
<success_criteria>
- ReviewStep.test.tsx has new failing test cases for TECH-01 (intune-only, rmm-only, neither, ZIP-neither) and TECH-02 (Back button present)
- registry.test.ts uses .fields access throughout and has a new displayName/description test case
- All pre-existing tests (CONF-02, CONF-03, DOWN-01–DOWN-06, SECU-01, SECU-02, WIZD-01, WIZD-04, all registry tests that existed) remain green or show the expected RED only on the new .fields lines </success_criteria>