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

fix(react18): unmount component with react18 API #23204

Merged
merged 3 commits into from
Aug 10, 2022

Conversation

rockindahizzy
Copy link
Contributor

@rockindahizzy rockindahizzy commented Aug 8, 2022

User facing changelog

  • Fixes issue in component testing when using React 18 mount

Additional details

Steps to test

  • Build npm/react and npm/react18 projects
  • Copy the dist folders from the projects and place them in a React project under their respective React folders in node_modules/cypress
  • Run cypress in the React project

How has the user experience changed?

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [na] Has a PR for user-facing changes been opened in cypress-documentation?
  • [na] Have API changes been updated in the type definitions?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Aug 8, 2022

Thanks for taking the time to open a PR!

npm/react/src/createMount.ts Outdated Show resolved Hide resolved
npm/react/src/mount.ts Outdated Show resolved Hide resolved
},
}

return makeUnmountFn(options, internalOptions)
Copy link
Contributor

Choose a reason for hiding this comment

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

The file below this (_snapshots__) has a surprisingly huge diff with a lot of red. Is this right? It seems to be missing the "summary" part of the CLI output.

@lmiller1990
Copy link
Contributor

I tried it out (build the new react modules and stuck them in an existing project's node_modules/cypress) and it's working great, nice job 💯

@cypress
Copy link

cypress bot commented Aug 9, 2022



Test summary

37846 0 469 0Flakiness 8


Run details

Project cypress
Status Passed
Commit b500714
Started Aug 9, 2022 10:01 PM
Ended Aug 9, 2022 10:22 PM
Duration 20:17 💡
OS Linux Debian - 11.3
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

commands/xhr.cy.js Flakiness
1 ... > logs request + response headers
2 ... > logs Method, Status, URL, and XHR
3 ... > logs response
cypress/proxy-logging.cy.ts Flakiness
1 Proxy Logging > request logging > xhr log has response body/status code when xhr response is logged first
2 ... > intercept log has consoleProps with intercept info
This comment includes only the first 5 flaky tests. See all 8 flaky tests in the Cypress Dashboard.

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@lmiller1990 lmiller1990 marked this pull request as ready for review August 9, 2022 21:55
@lmiller1990 lmiller1990 requested review from a team as code owners August 9, 2022 21:55
@lmiller1990
Copy link
Contributor

Nice, second latest job went all green: https://app.circleci.com/pipelines/github/cypress-io/cypress?branch=zachw%2Ffix-react18-unmount

Not sure why the info in the checkbox is showing red, maybe because I canceled the later build (due to the previous one passing). Let's ship it.

@lmiller1990 lmiller1990 removed the request for review from a team August 10, 2022 00:21
@lmiller1990 lmiller1990 merged commit eab950b into develop Aug 10, 2022
@lmiller1990 lmiller1990 deleted the zachw/fix-react18-unmount branch August 10, 2022 11:50
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Aug 15, 2022

Released in 10.5.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v10.5.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Aug 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The React18 support in Component Testing doesn't work
3 participants