kentcdodds/jest-glamor-react

Is there any ways to get style for pseudo-class?

Open

#35 ouverte le 11 avr. 2018

Voir sur GitHub
 (6 commentaires) (0 réactions) (0 assignés)JavaScript (21 forks)github user discovery
help wanted

Métriques du dépôt

Stars
 (99 stars)
Métriques de merge PR
 (Métriques PR en attente)

Description

  • jest-glamor-react version: v4.2.1
  • node version: v8.9.4
  • npm (or yarn) version: v5.6.0

Relevant code or config

const TestComp = glamorous.div({
  '::after': {
    backgroundColor: 'white',
  },
});

it('should have white background', () => {
  const component = enzyme.shallow(<TestComp />);
  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?

Guide contributeur