Skip to content

Commit

Permalink
fix: fix chip snapshot tests
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Nov 8, 2018
1 parent a95eb10 commit aee06f3
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 53 deletions.
4 changes: 2 additions & 2 deletions src/components/__tests__/Chip.test.js
Expand Up @@ -18,10 +18,10 @@ it('renders chip with icon', () => {
expect(tree).toMatchSnapshot();
});

it('renders deletable chip', () => {
it('renders chip with close button', () => {
const tree = renderer
.create(
<Chip icon="info" onDelete={() => {}}>
<Chip icon="info" onClose={() => {}}>
Example Chip
</Chip>
)
Expand Down
153 changes: 102 additions & 51 deletions src/components/__tests__/__snapshots__/Chip.test.js.snap
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders chip with icon 1`] = `
exports[`renders chip with close button 1`] = `
<View
style={
Object {
Expand Down Expand Up @@ -104,20 +104,71 @@ exports[`renders chip with icon 1`] = `
Object {
"color": "rgba(0, 0, 0, 0.87)",
"marginLeft": 4,
"marginRight": 8,
"marginRight": 4,
},
],
]
}
>
Example Chip
</Text>
<View
accessibilityComponentType="button"
accessibilityTraits="button"
accessible={true}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"padding": 4,
}
}
>
<Text
accessibilityElementsHidden={true}
allowFontScaling={false}
importantForAccessibility="no-hide-descendants"
pointerEvents="none"
style={
Array [
Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontSize": 16,
},
Array [
Object {
"transform": Array [
Object {
"scaleX": 1,
},
],
},
Object {
"backgroundColor": "transparent",
},
],
Object {
"fontFamily": "Material Icons",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
</View>
</View>
</View>
</View>
`;

exports[`renders chip with onPress 1`] = `
exports[`renders chip with icon 1`] = `
<View
style={
Object {
Expand Down Expand Up @@ -156,6 +207,51 @@ exports[`renders chip with onPress 1`] = `
}
}
>
<View
style={
Array [
Object {
"padding": 4,
},
null,
]
}
>
<Text
accessibilityElementsHidden={true}
allowFontScaling={false}
importantForAccessibility="no-hide-descendants"
pointerEvents="none"
style={
Array [
Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontSize": 18,
},
Array [
Object {
"transform": Array [
Object {
"scaleX": 1,
},
],
},
Object {
"backgroundColor": "transparent",
},
],
Object {
"fontFamily": "Material Icons",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
</View>
<Text
numberOfLines={1}
style={
Expand All @@ -175,7 +271,7 @@ exports[`renders chip with onPress 1`] = `
},
Object {
"color": "rgba(0, 0, 0, 0.87)",
"marginLeft": 8,
"marginLeft": 4,
"marginRight": 8,
},
],
Expand All @@ -189,7 +285,7 @@ exports[`renders chip with onPress 1`] = `
</View>
`;

exports[`renders deletable chip 1`] = `
exports[`renders chip with onPress 1`] = `
<View
style={
Object {
Expand Down Expand Up @@ -228,51 +324,6 @@ exports[`renders deletable chip 1`] = `
}
}
>
<View
style={
Array [
Object {
"padding": 4,
},
null,
]
}
>
<Text
accessibilityElementsHidden={true}
allowFontScaling={false}
importantForAccessibility="no-hide-descendants"
pointerEvents="none"
style={
Array [
Object {
"color": "rgba(0, 0, 0, 0.54)",
"fontSize": 18,
},
Array [
Object {
"transform": Array [
Object {
"scaleX": 1,
},
],
},
Object {
"backgroundColor": "transparent",
},
],
Object {
"fontFamily": "Material Icons",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
</View>
<Text
numberOfLines={1}
style={
Expand All @@ -292,7 +343,7 @@ exports[`renders deletable chip 1`] = `
},
Object {
"color": "rgba(0, 0, 0, 0.87)",
"marginLeft": 4,
"marginLeft": 8,
"marginRight": 8,
},
],
Expand Down

0 comments on commit aee06f3

Please sign in to comment.