Updating Footer to use react-testing-library

This commit is contained in:
Jeff Avallone 2019-03-24 13:04:06 -04:00
parent ced6c42c3d
commit 383197a4c1
2 changed files with 46 additions and 38 deletions

View File

@ -1,24 +1,31 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Footer rendering 1`] = `
<footer
className="footer"
>
<DocumentFragment>
<footer
class="footer"
>
<ul
className="list"
class="list"
>
<li>
<Trans>
<span
data-component="Trans"
data-props="{}"
>
Created by
<a
href="mailto:jeff.avallone@gmail.com"
>
Jeff Avallone
</a>
</Trans>
</span>
</li>
<li>
<Trans>
<span
data-component="Trans"
data-props="{}"
>
Generated images licensed:
<a
href="http://creativecommons.org/licenses/by/3.0/"
@ -30,13 +37,14 @@ exports[`Footer rendering 1`] = `
src="cc-by.svg"
/>
</a>
</Trans>
</span>
</li>
</ul>
<div
className="buildId"
class="buildId"
>
abc-123
</div>
</footer>
</footer>
</DocumentFragment>
`;

View File

@ -1,14 +1,14 @@
import React from 'react';
import { shallow } from 'enzyme';
import { render } from 'react-testing-library';
import { mockT } from 'i18n';
import { Footer } from 'components/Footer';
describe('Footer', () => {
test('rendering', () => {
const component = shallow(
const { asFragment } = render(
<Footer buildId="abc-123" t={ mockT } />
);
expect(component).toMatchSnapshot();
expect(asFragment()).toMatchSnapshot();
});
});