Files

6.4 KiB
Raw Permalink Blame History

phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
phase plan type wave depends_on files_modified autonomous requirements must_haves
07-validation-ux-polish 00 tdd 1
src/components/wizard/RemoteConfigStep.test.tsx
true
VALID-01
UX-01
truths artifacts key_links
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
path provides contains
src/components/wizard/RemoteConfigStep.test.tsx Failing test stubs for VALID-01 and UX-01 describe.*VALID-01|describe.*UX-01
from to via
RemoteConfigStep.test.tsx VALID-01 block azureblob account field validation userEvent.type + form submit + screen.getByText(error message)
from to via
RemoteConfigStep.test.tsx UX-01 block ⓘ button toggle getByRole('button', { name: /more info/i }) + userEvent.click
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.

<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/07-validation-ux-polish/07-CONTEXT.md @.planning/phases/07-validation-ux-polish/07-RESEARCH.md

From src/schemas/registry.ts (current — no validate or tooltipText yet):

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):

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
Wave 0 TDD stubs — VALID-01 and UX-01 src/components/wizard/RemoteConfigStep.test.tsx 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.
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.
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)

<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>
After completion, create `.planning/phases/07-validation-ux-polish/07-00-SUMMARY.md`