Closed jhamill34 closed 3 years ago
Are you still seeing this issue? I have a test issue happening on 0.3.1
as well where there seems to be some state that theme-ui
is using and is shared across renders. Essentially I have two tests pass independently but one fails if they're both run. When I switch to using
<div style={...} />
instead of
<div sx={...} />
the tests will both pass.
Did you discover the root of your problem and might it be related?
Hey @joshrasmussen34! Are you still having this issue/is this still relevant?
I’m going to close as inactive for now, please comment if this is still relevant!
Describe the bug I have a unit test that uses
@testing-library/jest-dom
matchers to check if the element is visible or not.Where
EventItem.tsx
looks like:and the
test-helper.tsx
exports a render function that wraps the component in a theme provider like so:Expected behavior On version
0.2.53
this test would pass but as soon as I upgraded to0.3.1
this test would fail. Other tests that asserted specific styles using jest-emotion'stoHaveStyleRule
matcher continued to pass.Additional context if I remove the custom render function and use the normal render function from
@testing-library/react
it also passes.Also, I know that the
toBeVisible
function in the jest-dom matchers useswindow.getComputedStyle
but I'm not sure that's the issue here.