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

Issue with @testing-library after adding Select component from gluestack-ui v.2 #2520

Open
2 of 6 tasks
SiloSas opened this issue Oct 18, 2024 · 0 comments
Open
2 of 6 tasks
Assignees
Labels
bug Something isn't working

Comments

@SiloSas
Copy link

SiloSas commented Oct 18, 2024

Description

I'm facing an issue where my test fails to find an element by text after I added the Select UI component from gluestack-ui to my React Native component. Before adding the Select, my test works fine.

CodeSandbox/Snack link

https://gitlab.com/Loann/jam-sessions-frontend.git

Steps to reproduce

  1. npm run test
  2. see test failed error
  3. open file components/JamSessionsBanner/JamSessionsBanner.tsx
  4. comment or remove Select component (ligne 88 to 104)
  5. npm run test
  6. see test working

gluestack-ui Version

2

Platform

  • Expo
  • React Native CLI
  • Next
  • Web
  • Android
  • iOS

Other Platform

No response

Additional Information

What I’ve tried:

Ensured that @testing-library/react-native is configured correctly and that the custom render includes the necessary context providers.
I've tried to add waitFor in my test.
The issue seems to arise only after adding the Select component. Without it, everything works as expected.
I've checked the Select rendering and functionality in the app, and it works correctly when manually tested and when render with storybook.

Does anyone know why @testing-library/react-native might not be able to find the text after adding Select?

If you have any insights into why adding Select could cause this issue, or if I'm missing something in the testing setup, I’d appreciate the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants