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

Workaround for :has CSS selector that nwsapi/jest can't parse #7981

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

cee-chen
Copy link
Member

@cee-chen cee-chen commented Aug 26, 2024

Summary

This PR is needed for Cloud's latest Kibana upgrade: https://github.com/elastic/cloud/pull/130938

The error output is something like +label isn't a valid selector. This test failure afects Cloud's RTL tests and does not affect browsers, only jsdom's test environment, due to nwsapi's spotty :has() selector support.

This was reproducible in local EUI as well (first commit will fail tests without the second commit), and appears to primarily affect the getByRole API with the name option parameter (although in Cloud it affects getByLabelText as well).

This PR can and should be reverted when dperini/nwsapi#123 is fixed and a new version of nwsapi is available.

QA

  • CI/tests pass
  • CSS works as before (margin-top is not present if a label is not present)

@cee-chen cee-chen added testing Issues or PRs that only affect tests - will not need changelog entries skip-changelog labels Aug 26, 2024
@cee-chen cee-chen marked this pull request as ready for review August 26, 2024 17:20
@cee-chen cee-chen requested a review from a team as a code owner August 26, 2024 17:20
Copy link
Member

@tkajtoch tkajtoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good

@cee-chen cee-chen changed the title [tests] Fix Emotion selector that nwsapi/jest can't parse Workaround for :has CSS selector that nwsapi/jest can't parse Aug 26, 2024
@cee-chen cee-chen enabled auto-merge (squash) August 26, 2024 22:50
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@cee-chen cee-chen merged commit 0ae8fc8 into elastic:main Aug 26, 2024
5 checks passed
@cee-chen cee-chen deleted the rtl-selector-fix branch August 26, 2024 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog testing Issues or PRs that only affect tests - will not need changelog entries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants