5 plans across 5 waves: Wave 0 TDD stubs, utilities + OutputBlock, ReviewStep implementation, App.tsx wiring, human verify checkpoint. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9.2 KiB
9.2 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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 04-review-download-security | 01 | tdd | 1 |
|
true |
|
|
Purpose: Establish the RED baseline before any implementation. Tests define the contract that implementation plans must satisfy. Following the established project pattern from Phases 1–3. Output: ReviewStep.test.tsx (stub file, RED tests for all 11 req IDs) + SECU-03 assertion in reducer.test.ts.
<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/phases/04-review-download-security/04-RESEARCH.md @.planning/phases/04-review-download-security/04-VALIDATION.md@src/store/types.ts @src/store/context.tsx @src/store/reducer.test.ts @src/generators/index.ts
From 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')[];
};
}
From src/store/context.tsx:
export function useWizard(): { state: WizardState; dispatch: React.Dispatch<WizardAction> }
export function WizardProvider({ children }: { children: React.ReactNode }): JSX.Element
From src/generators/index.ts:
export { buildRcloneConf } from './rclone-conf';
export { buildIntuneInstall } from './intune-install';
export { buildIntuneDetection } from './intune-detection';
export { buildRmmScript } from './rmm-script';
// All accept (state: WizardState): string
// buildRcloneConf throws when backendType is null or name is empty
File-level mock setup (before describe block):
```typescript
vi.mock('../../utils/downloadFile', () => ({ downloadFile: vi.fn() }));
vi.mock('../../utils/downloadZip', () => ({ downloadZip: vi.fn() }));
```
In a beforeEach, stub global APIs:
```typescript
beforeEach(() => {
vi.stubGlobal('navigator', {
clipboard: { writeText: vi.fn().mockResolvedValue(undefined) },
});
vi.stubGlobal('URL', {
createObjectURL: vi.fn(() => 'blob:mock'),
revokeObjectURL: vi.fn(),
});
vi.clearAllMocks();
});
```
Helper: create a WizardProvider wrapper with a fully populated state (azureblob backend, name='my-remote', params={account:'acct',key:'k'}, deployment defaults) for rendering ReviewStep in tests.
Write one `describe` block per requirement ID (embed ID in describe name for traceability, e.g. `describe('CONF-02: live rclone.conf preview', ...)`). Each describe contains an `it` that calls `expect.fail('not yet implemented')`.
Do NOT write real assertions yet — the whole file should be stubs that fail with 'not yet implemented' (except the import/mock wiring which must work).
Run: `npm test -- src/components/wizard/ReviewStep.test.tsx` — expect FAIL (RED) because ReviewStep does not exist yet. That is the correct Wave 0 state.
```typescript
it('SECU-03: never writes to localStorage or sessionStorage', () => {
const setItemSpy = vi.spyOn(Storage.prototype, 'setItem');
// Dispatch every action type to cover all reducer branches
wizardReducer(INITIAL_STATE, { type: 'SET_STEP', payload: 1 });
wizardReducer(INITIAL_STATE, { type: 'SET_BACKEND_TYPE', payload: 'azureblob' });
wizardReducer(INITIAL_STATE, { type: 'SET_REMOTE_NAME', payload: 'test' });
wizardReducer(INITIAL_STATE, { type: 'SET_REMOTE_PARAMS', payload: { key: 'val' } });
wizardReducer(INITIAL_STATE, { type: 'SET_DEPLOYMENT', payload: { includeInstall: true } });
wizardReducer(INITIAL_STATE, { type: 'RESET' });
expect(setItemSpy).not.toHaveBeenCalled();
setItemSpy.mockRestore();
});
```
Also add `vi` to the import line: change `import { describe, it, expect }` to `import { describe, it, expect, vi }`.
Run: `npm test -- src/store/reducer.test.ts` — expect GREEN (reducer already does not touch storage).
<success_criteria>
- src/components/wizard/ReviewStep.test.tsx exists with 10 named describe/it blocks (one per requirement behavior)
- src/store/reducer.test.ts has SECU-03 assertion and passes fully GREEN
- No new TypeScript compilation errors anywhere in the test files
- Wave 0 baseline established: RED for ReviewStep, GREEN for SECU-03 </success_criteria>