From 6942e4e41709651a5b0ee4093192de4a3537dd75 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Mon, 18 Sep 2017 19:47:03 -0700 Subject: [PATCH] Shallow render ActivityIndicator tests These snapshots should be improved by flattening the React Native style object. --- .../__snapshots__/index-test.js.snap | 350 ++++++++++++------ .../ActivityIndicator/__tests__/index-test.js | 16 +- 2 files changed, 253 insertions(+), 113 deletions(-) diff --git a/src/components/ActivityIndicator/__tests__/__snapshots__/index-test.js.snap b/src/components/ActivityIndicator/__tests__/__snapshots__/index-test.js.snap index d62d0a89..008e34ed 100644 --- a/src/components/ActivityIndicator/__tests__/__snapshots__/index-test.js.snap +++ b/src/components/ActivityIndicator/__tests__/__snapshots__/index-test.js.snap @@ -1,18 +1,30 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`components/ActivityIndicator prop "animating" is "false" 1`] = ` -
-
-
-
+ + `; exports[`components/ActivityIndicator prop "animating" is "true" 1`] = ` -
-
-
-
+ + `; exports[`components/ActivityIndicator prop "color" 1`] = ` -
-
- - - - -
-
+ + + `; exports[`components/ActivityIndicator prop "hidesWhenStopped" is "false" 1`] = ` -
-
-
-
+ + `; exports[`components/ActivityIndicator prop "hidesWhenStopped" is "true" 1`] = ` -
-
-
-
+ + `; exports[`components/ActivityIndicator prop "size" is "large" 1`] = ` -
-
-
-
+ + `; exports[`components/ActivityIndicator prop "size" is a number 1`] = ` -
-
-
-
+ + `; diff --git a/src/components/ActivityIndicator/__tests__/index-test.js b/src/components/ActivityIndicator/__tests__/index-test.js index d964d328..7961f00d 100644 --- a/src/components/ActivityIndicator/__tests__/index-test.js +++ b/src/components/ActivityIndicator/__tests__/index-test.js @@ -2,46 +2,46 @@ import ActivityIndicator from '..'; import React from 'react'; -import { render } from 'enzyme'; +import { shallow } from 'enzyme'; describe('components/ActivityIndicator', () => { describe('prop "animating"', () => { test('is "true"', () => { - const component = render(); + const component = shallow(); expect(component).toMatchSnapshot(); }); test('is "false"', () => { - const component = render(); + const component = shallow(); expect(component).toMatchSnapshot(); }); }); test('prop "color"', () => { - const component = render(); + const component = shallow().find('svg'); expect(component).toMatchSnapshot(); }); describe('prop "hidesWhenStopped"', () => { test('is "true"', () => { - const component = render(); + const component = shallow(); expect(component).toMatchSnapshot(); }); test('is "false"', () => { - const component = render(); + const component = shallow(); expect(component).toMatchSnapshot(); }); }); describe('prop "size"', () => { test('is "large"', () => { - const component = render(); + const component = shallow(); expect(component).toMatchSnapshot(); }); test('is a number', () => { - const component = render(); + const component = shallow(); expect(component).toMatchSnapshot(); }); });