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

Spaces are not ignored in rgb color #387

Open
nkumar-ee opened this issue Aug 6, 2021 · 1 comment
Open

Spaces are not ignored in rgb color #387

nkumar-ee opened this issue Aug 6, 2021 · 1 comment

Comments

@nkumar-ee
Copy link

It seems like the spaces are not ignored in colour which is making this test fail. It seems similar to Issue #89

I have tried below

it("should pass but it fails", () => {
  const Wrapper = styled.i`
    > svg {
      fill: rgb(185, 185, 185);
    }
  }
  `
  const Svg = styled.svg``

  const tree = renderer
    .create(
      <Wrapper>
        <Svg />
      </Wrapper>,
    )
    .toJSON()
  expect(tree).toHaveStyleRule("fill", "rgb(185, 185, 185)", { modifier: `> svg` })
})

but it returns with an error

Value mismatch for property 'fill'

    Expected
      "fill: rgb(185, 185, 185)"
    Received:
      "fill: rgb(185,185,185)"
@soujvnunes
Copy link

soujvnunes commented Jul 30, 2022

I have facing this false positive as well. One way to get around of it is removing the spaces, like:

  expect(tree).toHaveStyleRule("fill", "rgb(185,185,185)", { modifier: `> svg` })

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

2 participants