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

toHaveStyleRule to work with not passed expected value and negated ".not" modifier #206

Merged
merged 4 commits into from Nov 10, 2018

Conversation

santino
Copy link
Contributor

@santino santino commented Nov 4, 2018

Following the input from #205 I'm creating this PR to add a feature to toHaveStyleRule to be able to work with a negated ".not" modifier and a not passed expected value to allow the following syntax:

expect(<Component />).not.toHaveStyleRule('opacity')

Key-points:

  1. No breaking changes
  2. Purely additive, doesn't revisit any existing behaviour
  3. It supports both React and React-Native
  4. Tests for this new use case are added for both web and native
  5. The Readme has been updated to document the use of this new feature

I know the work on this project is currently focused around compatibility with SCv4, however this should be merged on existing master and be followed by an new npm release.
This will not only allow existing users to benefit from this feature even before SCv4 work is completed but will also allow users who are not going to update to SCv4 in the near future from having a new feature available.

This PR can then be merged into the v4 branch to reflect the changes introduced.

to add compatibility with decimal values in media queries
* upstream/master:
  Update CHANGELOG.md
  v6.2.2
  Remove object rest/spread notation to continue Node 6 support (#196)
  Update CHANGELOG.md
  v6.2.1
  exclude empty nodes
  update README
  Add serializer and storybook note (#188)
  Change Value type to support react-native number props (#180) (#185)
  update CHANGELOG
  v6.2.0
  check if global.Element exists
  upgrade dependencies
  Fix mediaRegex to allow dot special character (#182)
  Updated regex to match attribute change of v4 (#181)
  Export serializer (#173)
@MicheleBertoli
Copy link
Member

I think I said it many time, @santino, but your PRs are the best :)
Thank you very much for addressing a user's problem, submitting a non-breaking change, covering it with tests and provide a comprehensive explanation.

@MicheleBertoli MicheleBertoli merged commit 831faca into styled-components:master Nov 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants