Skip to content

Conversation

@japinderofficial-hub
Copy link

Description

Add Jest configuration, Babel preset, and test-only mocks/shims so frontend UI tests run reliably in this repo.
Add beginner-friendly component tests and convert several fragile tests to React Testing Library where practical.
Keep production code unchanged; all edits are test-only (configs, mocks, and tests).

Changes

• Added and updated test configuration:

  • .babelrc with preset-react (runtime: automatic)
  • Jest config and setup (jest.config.cjs, jest/setupTests.js)
  • Jest mocks/shims for react-dom, queryString, and file/style imports
  • UI stabilization via styledComponentsMock.js and jest/ui-mocks/*

• Added test coverage for:

  • index, footer, tree
  • Widget components (Alert, Button, Input, TextIcon)
  • UI inputs (input, textarea)

• Migrated index.test.jsx to React Testing Library (RTL)

How to test

Install dependencies:
yarn install

Run the test suite:
yarn test --runInBand

Expected result:
All frontend tests execute; on my run the suite passed (12 suites, 18 tests).

Quick checks:
Confirm no production files were modified (only test/config files and new tests).
Run single suites while iterating, for example:
yarn test button.test.jsx

close #159

Copilot AI review requested due to automatic review settings January 24, 2026 15:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@japinderofficial-hub
Copy link
Author

Screenshot 2026-01-24 at 11 03 47 PM

All the tests passed successfully

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Testing: Improve test coverage

1 participant