-
Notifications
You must be signed in to change notification settings - Fork 86
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
Select: React Testing Library doesn't render options on opening #6749
Labels
Comments
Investigated further and it looks like we need to mock the bounding rectangle in the test setup. See below for an example of how to test Select in RTL, we should use this ticket to update our docs and consider whether we should export some form of setup function for this.
|
FE-6646 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When running unit tests with React Testing Library,
Select
components no longer render their childOption
values when clicking, either throughfireEvent
or throughuserEvent
. The list container is rendered, but it has no option entries.Reproduction
https://carbon.sage.com/?path=/docs/select--docs
Steps to reproduce
Create the following test file:
Running it will produce HTML output, in amongst which is the following which demonstrates that there are no options rendered:
JIRA ticket numbers (Sage only)
No response
Suggested solution
No response
Carbon version
135.1.2
Design tokens version
No response
Relevant browsers
Chrome
Relevant OSs
MacOS
Additional context
No response
Confidentiality
The text was updated successfully, but these errors were encountered: