From 9f15287fcca944826e65202a81ce84f61c87b83f Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sun, 24 Mar 2019 13:01:03 -0400 Subject: [PATCH] Updating privacy page to use react-testing-library --- src/pages/__snapshots__/privacy.test.js.snap | 16 +++++++++++----- src/pages/privacy.test.js | 11 ++++++++--- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/pages/__snapshots__/privacy.test.js.snap b/src/pages/__snapshots__/privacy.test.js.snap index 6c1aa89..d2080d6 100644 --- a/src/pages/__snapshots__/privacy.test.js.snap +++ b/src/pages/__snapshots__/privacy.test.js.snap @@ -1,10 +1,16 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Privacy Page rendering 1`] = ` - - + - - + + `; diff --git a/src/pages/privacy.test.js b/src/pages/privacy.test.js index 38be05d..6e2e7aa 100644 --- a/src/pages/privacy.test.js +++ b/src/pages/privacy.test.js @@ -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( ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); }); });