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

Test error: Cannot find the Select's role #10926

Closed
dlabrecq opened this issue Aug 28, 2024 · 2 comments
Closed

Test error: Cannot find the Select's role #10926

dlabrecq opened this issue Aug 28, 2024 · 2 comments
Assignees
Labels
P1 ⭐ top priority issues v6 Beta bug

Comments

@dlabrecq
Copy link
Member

dlabrecq commented Aug 28, 2024

Please describe the issue

Test fails due to Unable to find role="option" error, related to Select. This test worked with v5, but no longer works with v6.

Are there visuals for this issue? Please provide screenshots

Error
Screenshot 2024-08-28 at 12 03 45 PM

Screenshot 2024-08-28 at 12 03 59 PM

Could you point to a branch or draft PR where this issue exists? Please provide a link to the code

Test
https://github.com/dlabrecq/koku-ui/blob/pf-v6/src/routes/settings/costModels/costModel/updateRateModel.test.tsx#L300

Tested component
https://github.com/dlabrecq/koku-ui/blob/pf-v6/src/routes/settings/costModels/components/rateForm/rateForm.tsx#L130

The tested component drills down to this Select
https://github.com/dlabrecq/koku-ui/blob/pf-v6/src/routes/components/selectWrapper/selectWrapper.tsx#L100

@dlabrecq dlabrecq changed the title Test error: Unable to find role="option" Test error: Cannot find the Select's role Aug 28, 2024
@tlabaj tlabaj transferred this issue from patternfly/patternfly Sep 6, 2024
@tlabaj tlabaj added this to the Penta final release milestone Sep 9, 2024
@kmcfaul kmcfaul added the P1 ⭐ top priority issues label Sep 11, 2024
@wise-king-sullyman
Copy link
Contributor

This failure appears to be caused because the Popper menu is being set to aria-disabled after a selection is made, causing the RTL query to not be able to find the menu options without the {hidden: true} option being passed. This behavior started occurring with our change to Poppers default appendTo value and can be resolved by either passing that hidden option to the RTL queries or changing the Select's appendTo back to inline.

Also it seems to be a strange interaction between the internals of Popper and Jest/JSDOM as I haven't been able to reproduce this in a real browser, if anyone is though please let me know.

@kmcfaul
Copy link
Contributor

kmcfaul commented Sep 24, 2024

#4277 will track the work to improve documentation.

@kmcfaul kmcfaul closed this as completed Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 ⭐ top priority issues v6 Beta bug
Projects
Archived in project
Development

No branches or pull requests

4 participants