Pass an object to the toHaveStyle matcher. The object shape would be the same as the style object in React.
This would allow the tests to match the code conventions of a project using object-based CSS-in-JS and offer type checking/code completion.
Offered as an alternative for the string function signature.
expect(element).toHaveStyle({
padding: '10px',
marginTop: 5
});
I'm in favor. I personally really like objects as styles. 馃憤
I'm in favor too. And sorry for having left this issue forgotten. Should've replied earlier.
@tom-sherman are you interested and able to contribute with this enhancement? Otherwise I'd say we're open to have anyone else contribute. I may be able to take it eventually if no one jumps in.
I can handle this if @tom-sherman doesn't want to.
Please do crack on! I'm not going to have time for a couple of weeks, I can loop back around then and start if you haven't opened a PR.
:tada: This issue has been resolved in version 5.1.0 :tada:
The release is available on:
npm package (@latest dist-tag)Your semantic-release bot :package::rocket:
Most helpful comment
Please do crack on! I'm not going to have time for a couple of weeks, I can loop back around then and start if you haven't opened a PR.