Files

141 lines
6.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
phase: 07-validation-ux-polish
plan: "00"
type: tdd
wave: 1
depends_on: []
files_modified:
- src/components/wizard/RemoteConfigStep.test.tsx
autonomous: true
requirements:
- VALID-01
- UX-01
must_haves:
truths:
- "VALID-01 failing tests exist for Azure account name regex rejection and acceptance"
- "VALID-01 failing tests exist for S3 region regex rejection and acceptance"
- "VALID-01 failing tests exist for GCS project_number regex rejection and acceptance"
- "UX-01 failing tests exist for ⓘ button presence on sas_url, azureblob key, onedrive token, and SFTP auth method"
- "UX-01 failing tests exist for tooltip toggle behavior (click shows, click again hides)"
- "All existing 147 tests still pass after stub additions"
artifacts:
- path: "src/components/wizard/RemoteConfigStep.test.tsx"
provides: "Failing test stubs for VALID-01 and UX-01"
contains: "describe.*VALID-01|describe.*UX-01"
key_links:
- from: "RemoteConfigStep.test.tsx VALID-01 block"
to: "azureblob account field validation"
via: "userEvent.type + form submit + screen.getByText(error message)"
- from: "RemoteConfigStep.test.tsx UX-01 block"
to: "ⓘ button toggle"
via: "getByRole('button', { name: /more info/i }) + userEvent.click"
---
<objective>
Write failing test stubs for VALID-01 (format validation) and UX-01 (tooltip toggle) in the existing RemoteConfigStep test file.
Purpose: Establish the RED state before implementation — tests fail because the validate property and tooltipText property don't exist yet.
Output: Augmented RemoteConfigStep.test.tsx with 11 new failing its; all 147 existing tests still pass.
</objective>
<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>
<context>
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/07-validation-ux-polish/07-CONTEXT.md
@.planning/phases/07-validation-ux-polish/07-RESEARCH.md
<interfaces>
<!-- Key types and contracts extracted from codebase. Executor uses these directly. -->
From src/schemas/registry.ts (current — no validate or tooltipText yet):
```typescript
export type BackendType = 'azureblob' | 's3' | 's3-compatible' | 'onedrive' | 'sftp' | 'gcs' | 'b2';
export interface FieldDef {
key: string;
label: string;
inputType: 'text' | 'password' | 'select' | 'toggle';
required: boolean;
placeholder?: string;
helpText?: string;
options?: { value: string; label: string }[];
// NOTE: validate? and tooltipText? do NOT exist yet — that's why tests will fail
}
```
From src/schemas/index.ts (current — no regex chaining yet):
```typescript
function buildZodSchema(backendType: BackendType): z.ZodObject<Record<string, z.ZodTypeAny>>
// Current loop: z.string().min(1, ...) OR z.string().optional()
// No .regex() chaining yet — that's why VALID-01 tests fail
```
Test file patterns already established (from Phase 5/6):
- userEvent.setup() per test body
- vi.useFakeTimers() in beforeEach + vi.useRealTimers() in afterEach
- WizardConsumerSetup pattern: in-test React component dispatches SET_DEPLOYMENT via useEffect
- Label text used for assertions, not filename text
</interfaces>
</context>
<feature>
<name>Wave 0 TDD stubs — VALID-01 and UX-01</name>
<files>src/components/wizard/RemoteConfigStep.test.tsx</files>
<behavior>
VALID-01 — Azure account name:
- it('rejects account name with uppercase letters') → submit form with account='MyStorage' → expect error 'Must be 324 lowercase alphanumeric characters'
- it('rejects account name shorter than 3 characters') → submit form with account='ab' → expect same error
- it('accepts valid account name') → submit form with account='mystorageaccount' → expect NO format error
VALID-01 — S3 region:
- it('rejects S3 region with invalid format (spaces)') → submit with region='us east 1' → expect error text (e.g. 'valid AWS region format')
- it('accepts valid S3 region') → submit with region='us-east-1' → expect no error
VALID-01 — GCS project_number:
- it('rejects GCS project_number with non-digits') → submit with project_number='abc' → expect error (e.g. 'digits only')
- it('accepts valid GCS project_number') → submit with project_number='123456789' → expect no error
UX-01 — Tooltip toggle:
- it('renders ⓘ button on azureblob sas_url field') → render azureblob step → expect button with aria-label matching /more info about SAS URL/i
- it('shows tooltip panel when ⓘ is clicked on sas_url') → click ⓘ → expect tooltip text visible
- it('hides tooltip panel when ⓘ is clicked again') → click twice → expect tooltip text not visible
- it('renders ⓘ button on SFTP auth method section') → render sftp step → expect button with aria-label matching /more info about authentication/i
- it('renders ⓘ button on OneDrive token field') → render onedrive step → expect button with aria-label matching /more info about/i on token field
All new tests: write them to FAIL now (the ⓘ button doesn't exist, regex validation doesn't exist).
Existing 147 tests: MUST still pass after adding these stubs.
</behavior>
<implementation>
Add two new describe blocks to the existing RemoteConfigStep.test.tsx:
1. `describe('VALID-01 — format validation')` with 7 its (3 backends × ~2-3 tests each)
2. `describe('UX-01 — contextual tooltips')` with 4 its (button presence + toggle behavior)
Use the existing test setup patterns already in the file (WizardConsumerSetup, userEvent.setup(), vi.useFakeTimers in beforeEach).
Confirm all tests run by running the suite — expect 11 new failures + 147 existing passes.
</implementation>
</feature>
<verification>
Run after writing stubs:
1. `npx vitest run src/components/wizard/RemoteConfigStep.test.tsx` — expect 11 new FAILs (RED state confirmed), 0 regressions on existing tests
2. `npx vitest run` — expect all 147 pre-existing tests still pass (no collateral breakage)
</verification>
<success_criteria>
- 11 new failing tests added (RED state for VALID-01 and UX-01)
- 0 pre-existing test regressions
- Test file committed with message: `test(07-00): add failing stubs for VALID-01 and UX-01`
</success_criteria>
<output>
After completion, create `.planning/phases/07-validation-ux-polish/07-00-SUMMARY.md`
</output>