BackendSelectionStep implemented with TDD: remote name zod validation (onSubmit mode) and popularity-sorted backend card grid that validates name before dispatching three store actions on card click.
BackendSelectionStep — Step 0 of the wizard. Renders a remote name text field (top) with zod-powered react-hook-form validation, followed by three backend selection cards in popularity order (Azure Blob Storage, Amazon S3, S3-Compatible).
Clicking a card triggers handleSubmit internally — the form validates the remote name before dispatching actions. If the name is invalid, an inline error appears and navigation does not proceed. On valid submit, the component dispatches:
SET_REMOTE_NAME — stores the validated name
SET_BACKEND_TYPE — stores the selected backend
SET_REMOTE_PARAMS({}) — clears any stale backend-specific params
SET_STEP(1) — advances to step 1
The component never dispatches RESET — deployment options (includeInstall, configPath, scriptTargets) are preserved across back-navigation.
TDD Execution
RED commit:cf06d72 — 10 test stubs replaced with real assertions, failing because component did not exist
GREEN commit:b47f607 — Component implemented, all 10 tests pass
Verification
Test Files 1 passed (1)
Tests 10 passed (10)
All WIZD-01 and WIZD-04 cases GREEN. Full suite: 71 passing, 16 RED (expected expect.fail stubs from Plans 03-04 and 03-05).
Issue:handleSubmit is async — React state updates from zod validation don't flush synchronously. Tests using fireEvent.click without waitFor found no alert in DOM.
Fix: Imported waitFor from @testing-library/react; wrapped post-click assertions in await waitFor(...) for the three tests that assert on validation error presence/absence.