Skip to content

Component tests for ContactForm #3774

Todo

Description

@Priyanshu-byte-coder

Summary

src/components/ContactForm.tsx (243 lines) has no component tests.

What to test

  • loading state while the request is pending
  • error state when /api/contact fails
  • empty state when the API returns no data
  • the main rendered content with realistic props / mocked data
  • the main interactions (clicks, inputs) and what they change

How

Use React Testing Library like the tests in test/components/ (e.g. PRMetrics.test.tsx, DiffTrendChart.test.tsx). Mock fetch with vi.fn(); no real network.

Acceptance criteria

  • New file test/components/ContactForm.test.tsx
  • Each case above covered; tests query by role/label, not CSS classes

Activity

  1. added
    good first issue
    level:beginner
    type:testing
    level 1
    on Nov 25, 2026
  2. priyanshiy1312-ui commented on Nov 25, 2026

    @priyanshiy1312-ui

    /assign

  3. github-actions commented on Nov 25, 2026

    @github-actions

    Assigned to @priyanshiy1312-ui! You have 7 days to open a PR. No PR after 7 days = auto-unassigned so others can pick it up. Good luck!

  4. Priyanshu-byte-coder commented on Nov 25, 2026

    @Priyanshu-byte-coder
    OwnerAuthor

    Releasing this one: @priyanshiy1312-ui was holding 37 issues with no PR open yet, and we now cap it at 5 open issues per contributor so everyone in Winter of Code Social gets a fair shot. @priyanshiy1312-ui, you've kept your first 5, and once one of those is done you're welcome to claim more. Anyone else can comment /assign here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issuelevel 1level:beginnertype:testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions