Updating privacy page to use react-testing-library
This commit is contained in:
parent
5d700f47aa
commit
9f15287fcc
@ -1,10 +1,16 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Privacy Page rendering 1`] = `
|
||||
<Fragment>
|
||||
<withI18nextTranslation(Metadata)
|
||||
title="TRANSLATE(Privacy Policy)"
|
||||
<DocumentFragment>
|
||||
<span
|
||||
data-component="withI18nextTranslation(Metadata)"
|
||||
data-props="{
|
||||
\\"title\\": \\"TRANSLATE(Privacy Policy)\\"
|
||||
}"
|
||||
/>
|
||||
<withI18nextTranslation(PrivacyPolicy) />
|
||||
</Fragment>
|
||||
<span
|
||||
data-component="withI18nextTranslation(PrivacyPolicy)"
|
||||
data-props="{}"
|
||||
/>
|
||||
</DocumentFragment>
|
||||
`;
|
||||
|
@ -1,14 +1,19 @@
|
||||
jest.mock('components/Metadata', () =>
|
||||
require('__mocks__/component-mock')('components/Metadata'));
|
||||
jest.mock('components/PrivacyPolicy', () =>
|
||||
require('__mocks__/component-mock')('components/PrivacyPolicy'));
|
||||
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { render } from 'react-testing-library';
|
||||
|
||||
import { mockT } from 'i18n';
|
||||
import { PrivacyPage } from 'pages/privacy';
|
||||
|
||||
describe('Privacy Page', () => {
|
||||
test('rendering', () => {
|
||||
const component = shallow(
|
||||
const { asFragment } = render(
|
||||
<PrivacyPage t={ mockT } />
|
||||
);
|
||||
expect(component).toMatchSnapshot();
|
||||
expect(asFragment()).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user