kentcdodds / kentcdodds/jest-glamor-react
Is there any ways to get style for pseudo-class?
- Dominant language
- JavaScript
- Stars
- 97
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
* `jest-glamor-react` version: v4.2.1
* `node` version: v8.9.4
* `npm` (or `yarn`) version: v5.6.0
Relevant code or config
```javascript
const TestComp = glamorous.div({
'::after': {
backgroundColor: 'white',
},
});
it('should have white background', () => {
const component = enzyme.shallow();
expect(component).toHaveStyleRule(/* What should I do ??? */);
});
```
What you did:
Try to test pseudo-class style
What happened:
No way to test it
Problem description:
Suggested solution:
Add some matchers? or add functions to the matcher?
Contributor guide
Research direction
Start from the shown toHaveStyleRule matcher call and the glamorous.div example using ::after. Trace how style rules are currently asserted, then define and verify a pseudo-class or pseudo-element assertion whose expected result is demonstrated by a passing test for the white background.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100