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

No style rules found on passed Component with SC-5.0.0 #299

Closed
Undistraction opened this issue Jan 21, 2020 · 1 comment
Closed

No style rules found on passed Component with SC-5.0.0 #299

Undistraction opened this issue Jan 21, 2020 · 1 comment

Comments

@Undistraction
Copy link

The following test fails:

import React from 'react'
import styled from 'styled-components'
import 'jest-styled-components'
import renderer from 'react-test-renderer'

describe(`colors`, () => {
    const Example = styled.div`
      color: red;
    `
    it(`returns the correct property and value`, () => {
      const tree = renderer.create(<Example />).toJSON()
      // eslint-disable-next-line
      expect(tree).toHaveStyleRule(`color`, `red`)
    })
  })

With the message:

No style rules found on passed Component

  • react: 16.12.0
  • react-test-renderer: 16.12.0
  • styled-components: 5.0.0
  • jest-styled-components: 7.0.0
@Undistraction
Copy link
Author

Undistraction commented Jan 21, 2020

Duplicate of #294

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

No branches or pull requests

1 participant