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

Tailwind css group-hover:visible dosn't work properly #510

Open
kajurek opened this issue Aug 11, 2023 · 0 comments
Open

Tailwind css group-hover:visible dosn't work properly #510

kajurek opened this issue Aug 11, 2023 · 0 comments

Comments

@kajurek
Copy link

kajurek commented Aug 11, 2023

Following the example from tailwindcss: https://tailwindcss.com/docs/hover-focus-and-other-states#differentiating-nested-groups. Item that should be invisible is still visible.

just to be sure the config of the tailwind is ok I followed https://stackoverflow.com/questions/71010317/react-testing-library-cant-read-styles-using-tailwind-css-classes

"jsdom": "22.1.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "14.0.0",
"tailwindcss": "^3.3.3",

Relevant code or config:

  it.only('example', () => {
    render(
      <div>
        <div data-testid="root" className="group/item">
          <div data-testid="test1" className="invisible group-hover/item:visible">
            test
          </div>
        </div>
      </div>,
    );

    let el = screen.getByTestId('root');
    expect(el).toBeVisible();
    expect(screen.getByTestId('test1')).not.toBeVisible();
  });

it gives:

Error: expect(element).not.toBeVisible()
Received element is visible:
  <div
  class="invisible group-hover/item:visible"
  data-testid="test1"
/>
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