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

How to get element is visible through css class? #652

Open
ko22009 opened this issue Nov 5, 2024 · 0 comments
Open

How to get element is visible through css class? #652

ko22009 opened this issue Nov 5, 2024 · 0 comments

Comments

@ko22009
Copy link

ko22009 commented Nov 5, 2024

I think that using toBeVisible is correctly when you want get to know element is visible or not for user.
But that method is using getComputedStyle, but my tailwind classes doesn't load to jest test.
So getComputedStyle return default style, but I have invisible or another classes.

What should I do for that situation?

I tried using this instruction: https://stackoverflow.com/questions/71010317/react-testing-library-cant-read-styles-using-tailwind-css-classes

But It is not suitable for me. For temporary solution I used toHaveClass('invisible')

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