Skip to content

Add test suite for React frontend using Jest and React Testing Library #286

Description

@vmuralictr

Problem

The react-frontend currently has no test suite. As the frontend
moves toward production (see #248, #249), there is no safety net
to catch regressions in core components or the search flow.

Proposed Solution

Set up Jest and React Testing Library as the testing foundation
for the React frontend, starting with the most critical components.

Suggested Test Coverage (Starting Point)

  • SearchBar.jsx — input handling, submission, empty state
  • SearchResults.jsx — renders results, handles no-results state
  • HeroSection.jsx — basic render test
  • Search API integration — mock the Flask/Node.js API response

Implementation Plan

  • Install @testing-library/react and @testing-library/jest-dom
  • Add test scripts to package.json
  • Write tests for the 3 core components listed above
  • Add npm test -- --watchAll=false as a CI step in
    .github/workflows/

Why This Matters

Without tests, every refactor or dependency update is a risk.
This is a prerequisite for the Vite migration and any future
component-level changes.

Happy to guide anyone who picks this up.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions