Skip to content

Add tests for the CreateCommitment wizard step components and WizardStepper navigation #593

@1nonlypiece

Description

@1nonlypiece

📌 Description

Only tests/components/CreateCommitmentStepReview.test.tsx exists for the
creation wizard. CreateCommitmentStepSelectType.tsx,
CreateCommitmentStepConfigure.tsx, and WizardStepper.tsx are untested, even
though they carry the wizard's branching and validation behavior.

This issue adds tests for the remaining step components and stepper navigation.

Goal: verify each wizard step renders, validates input, and that the
stepper advances/retreats correctly with state preserved.

🎯 Requirements and Context

  • Test CreateCommitmentStepSelectType (type selection: Safe / Balanced /
    Aggressive) emits the chosen profile.
  • Test CreateCommitmentStepConfigure input validation (amount, duration)
    against protocol bounds.
  • Test WizardStepper step indicator, forward/back navigation, and disabled
    states.
  • Assert keyboard operability of the stepper.

🛠️ Suggested Execution

1. Create a branch

git checkout -b feature/wizard-step-tests

2. Implement changes

  • Add tests/components/CreateCommitmentStepSelectType.test.tsx,
    tests/components/CreateCommitmentStepConfigure.test.tsx, and
    tests/components/WizardStepper.test.tsx.

3. Test and commit

  • Run npm test.
  • Edge cases: invalid amount/duration, back navigation preserving state,
    disabled next when invalid.

Example commit message

test: cover create wizard steps and WizardStepper navigation

✅ Guidelines

  • Minimum 95% test coverage on the targeted components.
  • Clear, descriptive test names.
  • Timeframe: 96 hours.

🏷️ Labels

type-testing · area-frontend · MAYBE REWARDED · GRANTFOX OSS · OFFICIAL CAMPAIGN

💬 Community & Support

  • Join the CommitLabs contributor Discord: https://discord.gg/WV7tdYkJk
  • Introduce yourself before starting to avoid duplicate work.
  • Maintainers triage actively and review fast.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions