Skip to content

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

Open
@ko22009

Description

@ko22009

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions