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

feat(component-testing): breaking: Add React rerender functionality #16038

Merged
merged 7 commits into from
Apr 20, 2021

Conversation

agg23
Copy link
Contributor

@agg23 agg23 commented Apr 16, 2021

User facing changelog

Breaking change: Introduces rerender functionality in @cypress/react. This is exposed through the thenable chain from mount:

mount(<Component prop="first value" />).then({ component, rerender, unmount } => {
  rerender(<Component prop="second value" />
})

This is breaking as mount previously returned a thenable with the rendered component, rather than an object.

Additional details

React has several mechanisms for internally preserving and updating state between rerenders/remounts. Exposing rerender offers a mechanism to take an existing rendered component and update its props in the same way that a parent component changes the props of its children.

How has the user experience changed?

rerender now appears in the CommandLog.

Screen Shot 2021-04-16 at 10 40 39 AM

PR Tasks

  • Have tests been added/updated?
  • Has the original issue or this PR been tagged with a release in ZenHub?
  • Has a PR for user-facing changes been opened in cypress-documentation?

@agg23 agg23 requested a review from a team as a code owner April 16, 2021 17:58
@agg23 agg23 requested review from chrisbreiding and kuceb and removed request for a team April 16, 2021 17:58
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 16, 2021

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Apr 16, 2021



Test summary

9493 0 111 3Flakiness 0


Run details

Project cypress
Status Passed
Commit ff620da
Started Apr 20, 2021 3:07 PM
Ended Apr 20, 2021 3:20 PM
Duration 12:35 💡
OS Linux Debian - 10.8
Browser Multiple

View run in 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 previously approved these changes Apr 19, 2021
Copy link
Contributor

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

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

Cool, looks good. Merge on CI ✅

I think we should also update the docs repo to include more information about this. I think we should have some pages about the specific CT integrations in the docs repo - just having a README in the npm package directory is not very discoverable.

We should work with the docs team on this.

@agg23 agg23 merged commit ee8b918 into develop Apr 20, 2021
tgriesser added a commit that referenced this pull request Apr 21, 2021
…press into tgriesser/chore/improve-ci

* 'tgriesser/chore/improve-ci' of github.com:cypress-io/cypress:
  fix(deps): update dependency systeminformation to version 5.6.4 🌟 (#15819)
  docs: fix a typo of package name [skip ci] (#15783)
  chore: deduplicate yarn.lock (#15988)
  fix(webpack): allow load custom asset on windows (#16099)
  fix: Properly display unmount as a command (#16041)
  fix(component-testing): correct imports for relative paths in cypress.json  (#16056)
  Fixed missing SearchInput and improved SpecList scrolling (#16090)
  docs: update react docs (#16055)
  chore: Design System Cleanup (#16077)
  feat(component-testing): breaking: Add React rerender functionality (#16038)
  fix(component-testing): Increased timeout to allow  useEffect to trigger (#16091)
  chore: release @cypress/webpack-batteries-included-preprocessor-v2.2.1
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.

Offer re-render functionality in Cypress Component testing
3 participants