Skip to content

Commit 7bca28c

Browse files
authored
Merge pull request #74 from material-elements/theme/fix
[theme/fix]
2 parents 5e74191 + 38f99f5 commit 7bca28c

File tree

138 files changed

+478
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+478
-260
lines changed

__test__/Accordion.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { StyleSheet, View, ViewStyle } from 'react-native';
3-
import { Accordion, AccordionDetails, AccordionDetailsProps, AccordionSummary, grey, Text } from '../src';
3+
import { Accordion, AccordionDetails, AccordionDetailsProps, AccordionSummary, gray, Text } from '../src';
44
import { fireEvent, render, waitFor } from './test-utils';
55

66
describe('Accordion Component', () => {
@@ -107,7 +107,7 @@ describe('AccordionSummary Component', () => {
107107
const flattenStyles = StyleSheet.flatten(element.props.style);
108108

109109
expect(flattenStyles.borderTopWidth).toEqual(1);
110-
expect(flattenStyles.borderTopColor).toEqual(grey[300]);
110+
expect(flattenStyles.borderTopColor).toEqual(gray[300]);
111111
});
112112

113113
it('should show the bottom border', () => {
@@ -119,7 +119,7 @@ describe('AccordionSummary Component', () => {
119119
const flattenStyles = StyleSheet.flatten(element.props.style);
120120

121121
expect(flattenStyles.borderBottomWidth).toEqual(1);
122-
expect(flattenStyles.borderBottomColor).toEqual(grey[300]);
122+
expect(flattenStyles.borderBottomColor).toEqual(gray[300]);
123123
});
124124

125125
it('should call the onPress function', () => {

__test__/Badge.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ describe('Badge', () => {
3030
success: { color: 'yellow' },
3131
error: { color: 'pink' },
3232
info: { color: 'blue' },
33-
grey: { color: 'red' },
34-
lightGrey: { color: 'green' },
33+
gray: { color: 'red' },
34+
lightGray: { color: 'green' },
3535
warning: { color: 'blue' },
3636
},
3737
};

__test__/Card.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { fireEvent, render as testRenderer, waitFor } from '@testing-library/react-native';
22
import React from 'react';
33
import { StyleSheet, View } from 'react-native';
4-
import { Card, CardAction, CardContent, CardHeader, CardMedia, grey, Text, ThemeProvider } from '../src';
4+
import { Card, CardAction, CardContent, CardHeader, CardMedia, gray, Text, ThemeProvider } from '../src';
55
import { render } from './test-utils';
66

77
describe('Card Component', () => {
@@ -41,7 +41,7 @@ describe('Card Component', () => {
4141
const card = getByTestId(mockCardTestId);
4242
const flattenedStyle = StyleSheet.flatten(card.props.style);
4343
expect(flattenedStyle.borderWidth).toEqual(0.5);
44-
expect(flattenedStyle.borderColor).toEqual(grey[500]);
44+
expect(flattenedStyle.borderColor).toEqual(gray[500]);
4545
});
4646

4747
it('should apply the root style', () => {

__test__/CheckBox.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
CHECKBOX_MEDIUM_SIZE,
77
CHECKBOX_SMALL_SIZE,
88
green,
9-
grey,
9+
gray,
1010
lightBlue,
1111
primary,
1212
red,
@@ -35,8 +35,8 @@ describe('CheckBox Component', () => {
3535
success: { color: 'yellow' },
3636
error: { color: 'pink' },
3737
info: { color: 'blue' },
38-
grey: { color: 'red' },
39-
lightGrey: { color: 'green' },
38+
gray: { color: 'red' },
39+
lightGray: { color: 'green' },
4040
warning: { color: 'blue' },
4141
},
4242
};
@@ -92,13 +92,13 @@ describe('CheckBox Component', () => {
9292
const { getByTestId } = render(<CheckBox checkBoxColor="red" checkBoxImageTestId={mockCheckBoxImageTestId} />);
9393
const checkBoxImage = getByTestId(mockCheckBoxImageTestId);
9494
expect(checkBoxImage.props.style).not.toEqual(expect.objectContaining({ tintColor: 'red' }));
95-
expect(checkBoxImage.props.style).toEqual(expect.objectContaining({ tintColor: grey[600] }));
95+
expect(checkBoxImage.props.style).toEqual(expect.objectContaining({ tintColor: gray[600] }));
9696
});
9797

9898
it('should take the default color of the checkbox', () => {
9999
const { getByTestId } = render(<CheckBox checkBoxImageTestId={mockCheckBoxImageTestId} />);
100100
const checkBoxImage = getByTestId(mockCheckBoxImageTestId);
101-
expect(checkBoxImage.props.style).toEqual(expect.objectContaining({ tintColor: grey[600] }));
101+
expect(checkBoxImage.props.style).toEqual(expect.objectContaining({ tintColor: gray[600] }));
102102
});
103103

104104
it('should call the onPress when clicked on the checkbox', () => {

__test__/List.test.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { fireEvent, render, waitFor } from './test-utils';
3-
import { grey, List, ListItem, ListItemText, Text, ThemeProvider } from '../src';
3+
import { gray, List, ListItem, ListItemText, Text, ThemeProvider } from '../src';
44
import { StyleSheet, View } from 'react-native';
55
import { BaseStyles } from '../src/libraries/style/styleTypes';
66
import { BOTTOM_LARGE_SPACING, BOTTOM_MEDIUM_SPACING, BOTTOM_SMALL_SPACING } from '../src/components/List/constants';
@@ -148,7 +148,7 @@ describe('ListItem Component', () => {
148148

149149
const listItem = getByTestId(mockListItemContainerTestId);
150150
const flattenedStyle = StyleSheet.flatten(listItem.props.style);
151-
expect(flattenedStyle.backgroundColor).toEqual(grey[100]);
151+
expect(flattenedStyle.backgroundColor).toEqual(gray[100]);
152152
});
153153

154154
it('should apply the active custom color on the selected item when passed the selected and selectedColor props', () => {
@@ -198,7 +198,7 @@ describe('ListItem Component', () => {
198198

199199
const listItem = getByTestId(mockListItemContainerTestId);
200200
const flattenedStyle = StyleSheet.flatten(listItem.props.style);
201-
expect(flattenedStyle.borderColor).toEqual(grey[400]);
201+
expect(flattenedStyle.borderColor).toEqual(gray[400]);
202202
});
203203

204204
it('should apply the outline width when outlineWidth prop is passed', () => {
@@ -208,7 +208,7 @@ describe('ListItem Component', () => {
208208

209209
const listItem = getByTestId(mockListItemContainerTestId);
210210
const flattenedStyle = StyleSheet.flatten(listItem.props.style);
211-
expect(flattenedStyle.borderColor).toEqual(grey[400]);
211+
expect(flattenedStyle.borderColor).toEqual(gray[400]);
212212
expect(flattenedStyle.borderWidth).toEqual(2);
213213
});
214214

@@ -223,12 +223,12 @@ describe('ListItem Component', () => {
223223
expect(flattenedStyle.borderColor).toEqual('red');
224224
});
225225

226-
it('should apply the grey color when showDefaultBg prop is passed', () => {
226+
it('should apply the gray color when showDefaultBg prop is passed', () => {
227227
const { getByTestId } = render(<ListItem showDefaultBg listItemContainerTestId={mockListItemContainerTestId} />);
228228

229229
const listItem = getByTestId(mockListItemContainerTestId);
230230
const flattenedStyle = StyleSheet.flatten(listItem.props.style);
231-
expect(flattenedStyle.backgroundColor).toEqual(grey[50]);
231+
expect(flattenedStyle.backgroundColor).toEqual(gray[50]);
232232
});
233233

234234
it('should apply the soft border radius when softRadius prop passed', () => {

__test__/TextField.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { Text, View } from 'react-native';
3-
import { grey, lightBlue, red, TextField, ThemeProvider } from '../src';
3+
import { gray, lightBlue, red, TextField, ThemeProvider } from '../src';
44
import { fireEvent, render } from './test-utils';
55
import { render as testRenderer, waitFor } from '@testing-library/react-native';
66

@@ -250,7 +250,7 @@ describe('TextField Component', () => {
250250
const { getByTestId } = render(<TextField variant="filled" outlineContainerTestId={mockTextFieldOutlineTestId} />);
251251

252252
const input = getByTestId(mockTextFieldOutlineTestId);
253-
expect(input.props.style).toEqual(expect.objectContaining({ backgroundColor: grey[500] }));
253+
expect(input.props.style).toEqual(expect.objectContaining({ backgroundColor: gray[500] }));
254254
});
255255

256256
it('should render the error border color when input variant is (filled)', () => {

__test__/__snapshots__/Accordion.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`Accordion Component should render correctly 1`] = `
44
<View

__test__/__snapshots__/Alert.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`Alert should render correctly with zero props 1`] = `
44
<View

__test__/__snapshots__/AppBar.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`AppBar should render correctly without any props 1`] = `
44
<View

__test__/__snapshots__/Avatar.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`Avatar Component should match the snapshot with props 1`] = `
44
<View>

0 commit comments

Comments
 (0)