Open pablopalacios opened 2 years ago
@pablopalacios thanks, but opening an additional PR is hugely disruptive - now both PRs must stay open forever, manually kept in sync, until both can be landed. In the future, please post a link to your branch on the original PR, and I can pull in your changes.
I'll take a closer look at test failures when I have time to do so.
Patch coverage: 100.00
% and project coverage change: -24.46
:warning:
Comparison is base (
3a7701c
) 96.42% compared to head (092f6d4
) 71.97%.:exclamation: Current head 092f6d4 differs from pull request most recent head 658422b. Consider uploading reports for the commit 658422b to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@ljharb I can close this PR and post the branch in the other one, no problem. Regarding applying the changes in the 16.3 adapter: does it make sense? React just added support for contextType
in version 16.6 (see: https://reactjs.org/blog/2018/10/23/react-v-16-6.html) or am I missing something?
Please don't; once a PR is opened its a permanent ref on the repo, so it needs to stay open until it's merged.
hmm, if contextType is only added in 16.6 then you’re right, it should only go in the 16 adapter
@ljharb I finally had time to take a look a this one again. I was able to make the missing test to pass. Could you review it again?
@pablopalacios i rebased everything and made a few fixes; looks like tests are failing on react ^16.6.
@ljharb the tests are expected to fail since they use a version of react-shallow-renderer
that does not have support for contextType
. We need to merge this PR first.
gotcha, thanks, i'll take a look at that one.
@pablopalacios actually enzyme doesn't use react-shallow-renderer
at all. Is there no way to fix it prior to taking on that dependency?
@ljharb it depends on react-test-renderer
which depends on react-shallow-renderer
.
We use v16 of react-test-renderer which does not depend on that - only v17+ does.
@ljharb I've rebased #2507 , applied your suggestions and added test cases for dynamic context values. Unfortunately, the test which uses
wrappingComponent
does not pass, it keeps rendering the initial context value. The context is correctly updated in theRootFinder
though, but it's not propagated down the tree.I tried my best to understand what is happening but I don't understand yet how things work internally yet. If you have any hint to point me in the right direction, I'll gladly move this PR forward.
Thank you for all the great work :)