From 8b06f28281cf76ace286b4c894c1cf59ddd5d1e6 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Thu, 29 Jun 2017 16:10:42 -0700 Subject: [PATCH] [fix] ActivityIndicator sizing --- .../__snapshots__/index-test.js.snap | 187 +++++++++++++++++- .../ActivityIndicator/__tests__/index-test.js | 43 +++- src/components/ActivityIndicator/index.js | 4 +- 3 files changed, 222 insertions(+), 12 deletions(-) diff --git a/src/components/ActivityIndicator/__tests__/__snapshots__/index-test.js.snap b/src/components/ActivityIndicator/__tests__/__snapshots__/index-test.js.snap index d32f3be3..d62d0a89 100644 --- a/src/components/ActivityIndicator/__tests__/__snapshots__/index-test.js.snap +++ b/src/components/ActivityIndicator/__tests__/__snapshots__/index-test.js.snap @@ -1,6 +1,42 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`components/ActivityIndicator default render 1`] = ` +exports[`components/ActivityIndicator prop "animating" is "false" 1`] = ` +
+
+ + + + +
+
+`; + +exports[`components/ActivityIndicator prop "animating" is "true" 1`] = `
`; -exports[`components/ActivityIndicator other render 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`] = ` +
+
{ - test('default render', () => { - const component = render(); + describe('prop "animating"', () => { + test('is "true"', () => { + const component = render(); + expect(component).toMatchSnapshot(); + }); + + test('is "false"', () => { + const component = render(); + expect(component).toMatchSnapshot(); + }); + }); + + test('prop "color"', () => { + const component = render(); expect(component).toMatchSnapshot(); }); - test('other render', () => { - const component = render( - - ); - expect(component).toMatchSnapshot(); + describe('prop "hidesWhenStopped"', () => { + test('is "true"', () => { + const component = render(); + expect(component).toMatchSnapshot(); + }); + + test('is "false"', () => { + const component = render(); + expect(component).toMatchSnapshot(); + }); + }); + + describe('prop "size"', () => { + test('is "large"', () => { + const component = render(); + expect(component).toMatchSnapshot(); + }); + + test('is a number', () => { + const component = render(); + expect(component).toMatchSnapshot(); + }); }); }); diff --git a/src/components/ActivityIndicator/index.js b/src/components/ActivityIndicator/index.js index e95aecd9..758e0c02 100644 --- a/src/components/ActivityIndicator/index.js +++ b/src/components/ActivityIndicator/index.js @@ -72,12 +72,12 @@ class ActivityIndicator extends Component { accessibilityRole="progressbar" aria-valuemax="1" aria-valuemin="0" - style={[styles.container, style, typeof size === 'number' && { height: size, width: size }]} + style={[styles.container, style]} >