Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Remove react-test-renderer #1917

Merged
merged 16 commits into from
Aug 29, 2019
Merged

Remove react-test-renderer #1917

merged 16 commits into from
Aug 29, 2019

Conversation

ghost
Copy link

@ghost ghost commented Aug 27, 2019

Contributes to #774

Overall change: Remove react-test-renderer and shallow rendering for psammead-test-helpers

Code changes:

  • Remove shallowRender and shouldShallowMatchSnapshot.
  • Update isNull and shouldMatchSnapshot
  • Use render from @testing-library/react

  • I have assigned myself to this PR and the corresponding issues
  • Automated (jest and/or cypress) tests added (for new features) or updated (for existing features)
  • This PR requires manual testing

@ghost ghost added ws-home Tasks for the WS Home Team simorgh-core-stream Heracles labels Aug 27, 2019
@ghost ghost self-assigned this Aug 27, 2019
@ghost ghost marked this pull request as ready for review August 27, 2019 09:09
@thekp
Copy link
Contributor

thekp commented Aug 27, 2019

Hi @sadickisaac

I see you are removing the shallowRendering functionality. We currently have an on-going issue to make use of the psammead-test-helper in Simorgh, however the shallow rendering is heavily used in Simorgh for the page body tests (i.e simorgh/src/app/containers/ArticleMain: https://github.com/bbc/simorgh/blob/latest/src/app/containers/ArticleMain/index.test.jsx#L35-L54)

Do you know if @testing-library/react package has an equivalent "shallow rendering functionality" we can use ?

@thekp
Copy link
Contributor

thekp commented Aug 27, 2019

@ghost
Copy link
Author

ghost commented Aug 27, 2019

Do you know if @testing-library/react package has an equivalent "shallow rendering functionality" we can use ?

@testing-library/react does not support shallow rendering. We are trying to move from using shallow rendering. What will happen is, the test depending on shallowRendering will be refactored.

@thekp
Copy link
Contributor

thekp commented Aug 27, 2019

@testing-library/react does not support shallow rendering. We are trying to move from using shallow rendering. What will happen is, the test depending on shallowRendering will be refactored.

possibly major refactors to our Simorgh tests 👀(but I suppose it is inevitable since we want to move away from shallowRendering) I'm going to put my running issue on blocked until you get this one done: bbc/simorgh#3264 👍

@ghost ghost mentioned this pull request Aug 27, 2019
3 tasks
Co-Authored-By: Khoa Phan <30599794+thekp@users.noreply.github.com>
Copy link
Contributor

@thekp thekp left a comment

Choose a reason for hiding this comment

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

This is ok for psammead, as we don't use shallowRender anywhere here.

This issue is for using test-helper in Simorgh: bbc/simorgh#3264

@jamesbhobbs jamesbhobbs merged commit c64581b into latest Aug 29, 2019
@jamesbhobbs jamesbhobbs deleted the remove-react-test-renderer branch August 29, 2019 13:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
simorgh-core-stream ws-home Tasks for the WS Home Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants