Skip to content

Feature Request: toMatchStyleSnapshot, toMatchInlineStyleSnapshot #272

Description

@greypants

I'd be great to have an API to take snapshots of just styles or specific rules. The API would be basically the same as toHaveStyleRule, but would do snapshot generation/matching instead.

// All styles as normal snapshot
expect(component).toMatchStyleSnapshot()
// Single rule as inline snapshot
expect(component).toMatchInlineStyleSnapshot('transform')

That would prevent users from having to manually record the output, and is much more terse than taking a snapshot of the entire DOM tree and every style.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions