jest-dom icon indicating copy to clipboard operation
jest-dom copied to clipboard

How to get element is visible through css class?

Open ko22009 opened this issue 1 year ago • 0 comments

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')

ko22009 avatar Nov 05 '24 23:11 ko22009