Skip to content

Commit

Permalink
fix: Header test calls html() not to have several elements in the sna…
Browse files Browse the repository at this point in the history
…pshot
  • Loading branch information
ptbrowne committed May 5, 2020
1 parent 7f12495 commit 301d9b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 91 deletions.
2 changes: 1 addition & 1 deletion src/components/Header/Header.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Header from './Header'
import { useCozyTheme } from 'cozy-ui/transpiled/react/CozyTheme'

describe('Header', () => {
const setup = element => mount(element).find('div')
const setup = element => mount(element).html()

it(`should display children`, () => {
expect(setup(<Header>content</Header>)).toMatchSnapshot()
Expand Down
95 changes: 5 additions & 90 deletions src/components/Header/__snapshots__/Header.spec.jsx.snap
Original file line number Diff line number Diff line change
@@ -1,96 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Header should display children 1`] = `
Array [
<div
className=""
>
<div
className="HeaderColor_normal"
>
content
</div>
</div>,
<div
className="HeaderColor_normal"
>
content
</div>,
]
`;
exports[`Header should display children 1`] = `"<div class=\\"\\"><div class=\\"HeaderColor_normal\\">content</div></div>"`;
exports[`Header should extend className 1`] = `
Array [
<div
className=""
>
<div
className="HeaderColor_normal noPaddingBottom"
>
content
</div>
</div>,
<div
className="HeaderColor_normal noPaddingBottom"
>
content
</div>,
]
`;
exports[`Header should extend className 1`] = `"<div class=\\"\\"><div class=\\"HeaderColor_normal noPaddingBottom\\">content</div></div>"`;
exports[`Header should set position fixed 1`] = `
Array [
<div
className=""
>
<div
className="HeaderColor_normal HeaderFixed"
>
content
</div>
</div>,
<div
className="HeaderColor_normal HeaderFixed"
>
content
</div>,
]
`;
exports[`Header should set position fixed 1`] = `"<div class=\\"\\"><div class=\\"HeaderColor_normal HeaderFixed\\">content</div></div>"`;
exports[`Header should set theme default 1`] = `
Array [
<div
className=""
>
<div
className="HeaderColor_normal"
>
content
</div>
</div>,
<div
className="HeaderColor_normal"
>
content
</div>,
]
`;
exports[`Header should set theme default 1`] = `"<div class=\\"\\"><div class=\\"HeaderColor_normal\\">content</div></div>"`;
exports[`Header should set theme inverted 1`] = `
Array [
<div
className="styles__CozyTheme--inverted___1ygHa"
>
<div
className="HeaderColor_inverted"
>
content
</div>
</div>,
<div
className="HeaderColor_inverted"
>
content
</div>,
]
`;
exports[`Header should set theme inverted 1`] = `"<div class=\\"styles__CozyTheme--inverted___1ygHa\\"><div class=\\"HeaderColor_inverted\\">content</div></div>"`;

0 comments on commit 301d9b6

Please sign in to comment.