From ced6c42c3d826ae3f7c6392d6ba80b8845acd404 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sun, 24 Mar 2019 13:02:22 -0400 Subject: [PATCH] Updating PrivacyPolicy to use react-testing-library --- .../PrivacyPolicy/__snapshots__/test.js.snap | 101 ++++++++++-------- src/components/PrivacyPolicy/test.js | 9 +- 2 files changed, 60 insertions(+), 50 deletions(-) diff --git a/src/components/PrivacyPolicy/__snapshots__/test.js.snap b/src/components/PrivacyPolicy/__snapshots__/test.js.snap index 5a30c2d..bfa44fc 100644 --- a/src/components/PrivacyPolicy/__snapshots__/test.js.snap +++ b/src/components/PrivacyPolicy/__snapshots__/test.js.snap @@ -1,56 +1,63 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`PrivacyPolicy rendering 1`] = ` - - + -

- Regexper and the tools used to create it are all open source. If you are concerned that the JavaScript being delivered is in any way malicious, please inspect the source in the - - GitLab repository - - . -

-

- There are two data collection tools integrated in the app. These tools are not used to collect personal information: -

-
    -
  • + +

    + Regexper and the tools used to create it are all open source. If you are concerned that the JavaScript being delivered is in any way malicious, please inspect the source in the + + GitLab repository + + . +

    +

    + There are two data collection tools integrated in the app. These tools are not used to collect personal information: +

    +
      +
    • + + Google Analytics + + is used to track browser usage data and application performance. It is configured to anonymize the client IP address. +
    • +
    • + + Sentry.io + + is a tool used to capture and report client-side JavaScript errors. It is configured to not store the client IP address. +
    • +
    +

    + Regexper honors the browser - Google Analytics + “Do Not Track” - is used to track browser usage data and application performance. It is configured to anonymize the client IP address. -

  • -
  • + setting and will not enable these data collection tools if that setting is enabled. Also, most popular ad blockers will prevent these tools from sending any tracking data. Disabling or blocking these data collection tools will - Sentry.io + not - is a tool used to capture and report client-side JavaScript errors. It is configured to not store the client IP address. -
  • -
-

- Regexper honors the browser - - “Do Not Track” - - setting and will not enable these data collection tools if that setting is enabled. Also, most popular ad blockers will prevent these tools from sending any tracking data. Disabling or blocking these data collection tools will - - not - - impact the performance of this app. The information collected by these tools is used to monitor application performance, determine browser support, and collect error reports. -

-

- Regexper is not supported by ad revenue or sales of any kind. -

-
-
+ impact the performance of this app. The information collected by these tools is used to monitor application performance, determine browser support, and collect error reports. +

+

+ Regexper is not supported by ad revenue or sales of any kind. +

+ + + `; diff --git a/src/components/PrivacyPolicy/test.js b/src/components/PrivacyPolicy/test.js index e26b427..3a1c4b3 100644 --- a/src/components/PrivacyPolicy/test.js +++ b/src/components/PrivacyPolicy/test.js @@ -1,14 +1,17 @@ +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 { PrivacyPolicy } from 'components/PrivacyPolicy'; describe('PrivacyPolicy', () => { test('rendering', () => { - const component = shallow( + const { asFragment } = render( ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); }); });