Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Update test renderer in few components, #7425

Merged
merged 1 commit into from
Jul 30, 2021
Merged

Update test renderer in few components, #7425

merged 1 commit into from
Jul 30, 2021

Conversation

tomalec
Copy link
Member

@tomalec tomalec commented Jul 27, 2021

from react-test-renderer to { render } from '@testing-library/react',
to avoid confision like #7378 (comment).

Update snapshots respectively.

This update is base on @louwie17's suggestion #7378 (comment)

the example you saw used an old test renderer, we usually use the render function from @testing-library/react

Accessibility

n/a - it updates only automated tests internals

Screenshots

Detailed test instructions:

  1. npm run test
  2. Review snapshot changes

Additional notes

  1. We could also assert only renderedComponent.container to make snapshots shorter. The current way, is a tad shorter from the test's code perspective.

no changelog needed, it's a code cleanup in tests

from `react-test-renderer` to `{ render } from '@testing-library/react'`,
to avoid confision like #7378 (comment).

Update snapshots respectively.
@tomalec tomalec added priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: technical debt This issue/PR represents/solves the technical debt of the project. labels Jul 27, 2021
@tomalec tomalec self-assigned this Jul 27, 2021
@tomalec tomalec marked this pull request as ready for review July 27, 2021 15:43
Copy link
Contributor

@samueljseay samueljseay left a comment

Choose a reason for hiding this comment

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

Nice quality of life improvement. Thank you!

@tomalec tomalec merged commit 391c99d into main Jul 30, 2021
@tomalec tomalec deleted the update/test-renderer branch July 30, 2021 10:16
ObliviousHarmony pushed a commit to woocommerce/woocommerce that referenced this pull request Mar 18, 2022
…n#7425)

from `react-test-renderer` to `{ render } from '@testing-library/react'`,
to avoid confision like woocommerce/woocommerce-admin#7378 (comment).

Update snapshots respectively.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: technical debt This issue/PR represents/solves the technical debt of the project. @woocommerce/components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants