diff --git a/src/pages/404.test.js b/src/pages/404.test.js index 9ad5dbf..939135d 100644 --- a/src/pages/404.test.js +++ b/src/pages/404.test.js @@ -1,14 +1,19 @@ +jest.mock('components/Metadata', () => + require('__mocks__/component-mock')('components/Metadata')); +jest.mock('components/Message', () => + require('__mocks__/component-mock')('components/Message')); + import React from 'react'; -import { shallow } from 'enzyme'; +import { render } from 'react-testing-library'; import { mockT } from 'i18n'; import { ErrorPage } from 'pages/404'; describe('Error Page', () => { test('rendering', () => { - const component = shallow( + const { asFragment } = render( ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); }); }); diff --git a/src/pages/__snapshots__/404.test.js.snap b/src/pages/__snapshots__/404.test.js.snap index 0bf48f1..43bfeea 100644 --- a/src/pages/__snapshots__/404.test.js.snap +++ b/src/pages/__snapshots__/404.test.js.snap @@ -1,19 +1,28 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Error Page rendering 1`] = ` - - + - - + The page you have requested could not be found. - + - - + + `;
- + The page you have requested could not be found. - +