Skip to content

jest-enzyme toHaveClassName does not work with some tailwind classes #379

Open
@anichols-ht

Description

I keep running into issues trying to do things like

expect(component).toHaveClassName('hover:bg-primary');

This gives me a message like Expected <div> to have className of ".hover:bg-primary" but instead found "hover:bg-primary". If I try to escape the : I get parsing errors.

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