From 092fd39da6d128a0968dff7f89da2a826e73c906 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sun, 24 Mar 2019 13:07:39 -0400 Subject: [PATCH] Updating tests for Loader to use react-testing-library --- .../Loader/__snapshots__/test.js.snap | 133 +++++++++--------- src/components/Loader/test.js | 6 +- 2 files changed, 66 insertions(+), 73 deletions(-) diff --git a/src/components/Loader/__snapshots__/test.js.snap b/src/components/Loader/__snapshots__/test.js.snap index 29fa6a5..ff47cf2 100644 --- a/src/components/Loader/__snapshots__/test.js.snap +++ b/src/components/Loader/__snapshots__/test.js.snap @@ -1,82 +1,75 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Loader rendering 1`] = ` - +
- - - - - - - - - - - - + + + + + + + + +
TRANSLATE(Loading...)
-
+ `; diff --git a/src/components/Loader/test.js b/src/components/Loader/test.js index c463c51..49231b8 100644 --- a/src/components/Loader/test.js +++ b/src/components/Loader/test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { mount } from 'enzyme'; +import { render } from 'react-testing-library'; import { mockT } from 'i18n'; import { Loader } from 'components/Loader'; @@ -8,9 +8,9 @@ describe('Loader', () => { test('rendering', () => { // Using full rendering here since styles for this depend on the structure // of the SVG. - const component = mount( + const { asFragment } = render( ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); }); });