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

query selector fails with jsdom 26.0.0 to find for button#react-aria-:r22:.css-ofddhz svg #1349

Closed
kolorfilm opened this issue Jan 19, 2025 · 1 comment

Comments

@kolorfilm
Copy link

  • @testing-library/jest-dom version: ^6.6.3
  • Testing Framework and version: Vitest (3.0.1)
  • DOM Environment: jsdom 26.0.0

Relevant code or config:

HTML looks like that:

<button
        aria-label="Delete"
        class="css-18cu5b5"
        data-rac=""
        data-testid="delete-button-0"
        id="react-aria-:r6:"
        type="button"
      >
        <svg
          fill="none"
          height="24"
          viewBox="0 0 24 24"
          width="24"
          xmlns="http://www.w3.org/2000/svg"
        >
         ...
        </svg>
      </button>

What you did:

await userEvent.click(screen.getByTestId('delete-button-0'));

What happened:

Since I updated jsdom to 26.0.0 I get SyntaxError: 'button#react-aria-:r22:.css-ofddhz svg' is not a valid selector.

The id seems to be valid and is generated by react-aria.

Reproduction:

Problem description:

According to react-aria this is a valid id.

adobe/react-spectrum#7624 (reply in thread)

Suggested solution:

@kolorfilm kolorfilm changed the title query selector fails with 26.0.0 to find for button#react-aria-:r22:.css-ofddhz svg query selector fails with jsdom 26.0.0 to find for button#react-aria-:r22:.css-ofddhz svg Jan 19, 2025
@kolorfilm
Copy link
Author

Wrong package. Created here: testing-library/jest-dom#661

@kolorfilm kolorfilm closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant