Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(toHaveStyle): handle when the prop style is undefined #29

Merged
merged 1 commit into from
Jul 26, 2020
Merged

feat(toHaveStyle): handle when the prop style is undefined #29

merged 1 commit into from
Jul 26, 2020

Conversation

brunohkbx
Copy link
Collaborator

What:
Now the matcher toHaveStyle can handle elements without style.

Why:
It's useful to check whether an element has a style or not when conditionally applying a style.

How:
I've added a default value {} to the received styles.

Checklist:

  • [N/A] Documentation added to the docs
  • [N/A] Typescript definitions updated
  • Tests
  • Ready to be merged

@codecov
Copy link

codecov bot commented Jun 23, 2020

Codecov Report

Merging #29 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #29   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines           90        90           
  Branches        23        24    +1     
=========================================
  Hits            90        90           
Impacted Files Coverage Δ
src/to-have-style.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60791a0...8cfde75. Read the comment docs.

@brunohkbx brunohkbx changed the title feat: handle null cases using toHaveStyle feat(toHaveStyle): handle when the prop style is undefined Jul 26, 2020
@brunohkbx brunohkbx merged commit db5ccb3 into testing-library:master Jul 26, 2020
@brunohkbx brunohkbx deleted the feat/handle-null-using-to-have-style branch July 26, 2020 17:04
@bcarroll22
Copy link
Collaborator

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants