Skip to content

Commit

Permalink
feat: example component snapshot test
Browse files Browse the repository at this point in the history
  • Loading branch information
zstix committed May 13, 2020
1 parent 0101ee1 commit 7c3bf35
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/components/__tests__/Footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import renderer from 'react-test-renderer';

import Footer from '../Footer';

describe('Footer', () => {
it('renders correctly', () => {
const pages = [
{ displayName: 'One', url: '/one' },
{ displayName: 'Two', url: '/two' },
];
const tree = renderer.create(<Footer pages={[]} />).toJSON();

expect(tree).toMatchSnapshot();
});
});
32 changes: 32 additions & 0 deletions src/components/__tests__/__snapshots__/Footer.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Footer renders correctly 1`] = `
<footer
className="Footer"
>
<div
className="u-container"
>
<div
className="Footer-left"
>
<a
className="logo Footer-logo"
href="/"
/>
<div
className="Footer-copyright"
>
Copyright © 2020 New Relic Inc.
</div>
</div>
<nav
aria-label="Footer"
className="Footer-nav"
role="navigation"
>
<ul />
</nav>
</div>
</footer>
`;

0 comments on commit 7c3bf35

Please sign in to comment.