Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: upgrade @testing-library/react #445

Merged
merged 1 commit into from
Mar 2, 2025

Conversation

adamstankiewicz
Copy link
Member

@adamstankiewicz adamstankiewicz commented Mar 2, 2025

@testing-library/react was not upgraded alongside the react and react-dom upgrades to v18 in devDependencies for the catalog-search package. As a result, @testing-library/react was still using React 17 while the package was using React 18, contributing to the error previously seen when running tests for the catalog-search locally.

Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
    1. You might have mismatching versions of React and the renderer (such as React DOM)
    2. You might be breaking the Rules of Hooks
    3. You might have more than one copy of React in the same app
    See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.

Merge checklist:

  • Evaluate how your changes will impact existing consumers (e.g., frontend-app-learner-portal-enterprise, frontend-app-admin-portal, and frontend-app-enterprise-public-catalog). Will consumers safely be able to upgrade to this change without any breaking changes?
  • Ensure your commit message follows the semantic-release conventional commit message format. If your changes include a breaking change, ensure your commit message is explicitly marked as a BREAKING CHANGE so the NPM package is released as such.
  • Once CI is passing, verify the package versions that Lerna will increment to in the Github Action CI workflow logs.
    • Note: This may be found in the "Preview Updated Versions (dry run)" step in the Github Action CI workflow logs.

Post merge:

  • Follow the release steps in the README documentation. Verify Lerna's release commit (e.g., chore(release): publish new versions) that incremented versions in relevant package.json and CHANGELOG files, and created Git tags for those versions is on master (Important: ensure the Git tags are for the correct commit SHA).
  • Run the Publish from package.json Github Action workflow to publish these new package versions to NPM.
    • This may be triggered by clicking the "Run workflow" option for the master branch.
  • Verify the new package versions were published to NPM (i.e., npm view <package_name> versions --json).
    • Note: There may be a slight delay between when the workflow finished and when NPM reports the package version as being published. If it doesn't appear right away in the above command, try again in a few minutes.

@adamstankiewicz adamstankiewicz force-pushed the ags/catalog-search-react-overrides branch from d899cee to a01e6a5 Compare March 2, 2025 14:00
@adamstankiewicz adamstankiewicz changed the title fix: add npm overrides for react and react-dom in catalog-search test: upgrade @testing-library/react Mar 2, 2025
Copy link

codecov bot commented Mar 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.94%. Comparing base (3326669) to head (a01e6a5).
Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #445   +/-   ##
=======================================
  Coverage   78.94%   78.94%           
=======================================
  Files          37       37           
  Lines         755      755           
  Branches      191      191           
=======================================
  Hits          596      596           
  Misses        146      146           
  Partials       13       13           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update efdb796...a01e6a5. Read the comment docs.

@adamstankiewicz adamstankiewicz merged commit f35bd36 into master Mar 2, 2025
9 checks passed
@adamstankiewicz adamstankiewicz deleted the ags/catalog-search-react-overrides branch March 2, 2025 14:05
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.

1 participant