diff --git a/src/pages/__snapshots__/index.test.js.snap b/src/pages/__snapshots__/index.test.js.snap index b2aaaeb..10c9f0b 100644 --- a/src/pages/__snapshots__/index.test.js.snap +++ b/src/pages/__snapshots__/index.test.js.snap @@ -1,89 +1,61 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Index Page rendering 1`] = ` - - + - - + - + `; exports[`Index Page rendering with an expression on the URL 1`] = ` - - + - - + - + `; diff --git a/src/pages/index.test.js b/src/pages/index.test.js index ede26f7..ca1dfda 100644 --- a/src/pages/index.test.js +++ b/src/pages/index.test.js @@ -1,5 +1,12 @@ +jest.mock('components/Metadata', () => + require('__mocks__/component-mock')('components/Metadata')); +jest.mock('components/Message', () => + require('__mocks__/component-mock')('components/Message')); +jest.mock('components/App', () => + require('__mocks__/component-mock')('components/App')); + import React from 'react'; -import { shallow } from 'enzyme'; +import { render } from 'react-testing-library'; import { IndexPage } from 'pages/index'; @@ -18,19 +25,19 @@ const queryResult = { describe('Index Page', () => { test('rendering', () => { - const component = shallow( + const { asFragment } = render( ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); }); test('rendering with an expression on the URL', () => { - const component = shallow( + const { asFragment } = render( ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); }); });