You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just re-ran my tests after screwing around with Babel and my build system (bad idea I know) and now my styled-components snapshots have completely changed. Each component renders as it should but now the snapshot is wrapped by a full DOM ( etc etc), any ideas why? Is it ok or a bug?
importReactfrom'react'import{render,cleanup}from'react-testing-library'importLinkfrom'./index'afterEach(cleanup)test('Link snapshot',()=>{consttree=render(<Linkhref="https://google.com">This is a link</Link>)expect(tree).toMatchSnapshot()})
@MicheleBertoli thanks, I had thought that it was this jest-styled-components that caused the issue but perhaps react-testing-library. I will raise a ticket there to see if that produces any answers.
I just re-ran my tests after screwing around with Babel and my build system (bad idea I know) and now my styled-components snapshots have completely changed. Each component renders as it should but now the snapshot is wrapped by a full DOM ( etc etc), any ideas why? Is it ok or a bug?
FYI I'm using https://www.npmjs.com/package/react-testing-library to 'render' in the tests.
Before snapshot:
After snapshot:
Notice that
<html>
and a full 'page' has been added to the snapshot.. 😕Test file:
Component source:
.babelrc
Let me know if I can provide more info.
The text was updated successfully, but these errors were encountered: