Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Add toMatchComputedStyle matcher #112

Merged
merged 8 commits into from
Jun 29, 2021
Merged

Add toMatchComputedStyle matcher #112

merged 8 commits into from
Jun 29, 2021

Conversation

mskelton
Copy link
Member

This PR adds a new matcher for checking the computed style of an element or selector. While not often needed in testing, sometimes it is helpful to check that an element has a given style such as testing that a button color changes when a dark mode toggle is enabled.

Thoughts on the naming of this rule are welcomed. Here are a few other ideas:

  • toMatchStyle
  • toMatchStyleRule

Copy link
Collaborator

@mxschmitt mxschmitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like toMatchComputedStyle the most.

@mskelton mskelton merged commit e1f67df into master Jun 29, 2021
@mskelton mskelton deleted the toHaveComputedStyle branch June 29, 2021 12:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants