-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
React Testing Library render() not working with embla-carousel-react v8.0.0-rc7 #516
Comments
Hi @MWhiteFearless, Thank you for your complete bug report. I will look into this when possible. Beat, |
Hi @MWhiteFearless, I haven't investigated this fully but I can think of three things that have changed internally in Embla from v7 --> v8 that can potentially cause problems with React Testing Library:
So let's say you mock Best, |
It works by mocking matchMedia! Tests are passing now, thank you! The stackoverflow suggestion worked perfectly for me. |
@MWhiteFearless I'm glad it solved the problem. So I'm closing this issue then? Best, |
Yeah works for me! It could be nice to add a note to the documentation in case others run in to this issue. Really appreciate your help! |
@MWhiteFearless thanks for the suggestion. I will add it to the breaking changes section in the release notes for the stable v8 release which is coming soon. |
@raphaelApard see my comment. |
Thanks a lot @MWhiteFearless for completing this issue and @davidjerleke for your responsiveness ! |
Bug is related to
Embla Carousel version
Describe the bug
When upgrading from
embla-carousel-react
v6.2.0 to v8.0.0-rc7, the tests in my repo for components using embla-carousel-react started failing with the errorTypeError: undefined is not a function at Array.map (<anonymous>)
when callingrender()
from react testing libraryCodeSandbox
- The link to a CodeSandbox that demonstrates the bug clearly.
Steps to reproduce
renders EmblaCarousel
test fails with the errorembla-carousel-react
version to v7.1.0 and refresh the page, see that therenders EmblaCarousel
test passesExpected behavior
The test should pass and the component should render properly.
The text was updated successfully, but these errors were encountered: