MM-12258 Update snapshots to only compare against the elements and not the bloated objects (#2140)

* update snapshots to only compare against the elements and not the bloated objects

* resolve conflicts to master
This commit is contained in:
Saturnino Abril 2018-09-21 16:07:37 +08:00 committed by GitHub
parent 3554ae77df
commit 63196936d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 1328 additions and 12483 deletions

View file

@ -1,401 +1,62 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AnnouncementBanner should match snapshot 1`] = `
ShallowWrapper {
Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <AnnouncementBanner
bannerColor="#ddd"
bannerDismissed={false}
bannerEnabled={true}
bannerText="Banner Text"
bannerTextColor="#fff"
navigator={Object {}}
theme={Object {}}
/>,
Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function],
"getNode": [Function],
"render": [Function],
"simulateError": [Function],
"simulateEvent": [Function],
"unmount": [Function],
},
Symbol(enzyme.__node__): Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": <TouchableOpacity
activeOpacity={0.2}
onPress={[Function]}
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
}
}
>
<Component
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"flex": 1,
"fontSize": 14,
"marginRight": 5,
},
Object {
"color": "#fff",
},
]
}
>
<RemoveMarkdown
value="Banner Text"
/>
</Component>
<Icon
allowFontScaling={false}
color="#fff"
name="info"
size={16}
/>
</TouchableOpacity>,
"style": Array [
Object {
"overflow": "hidden",
"paddingHorizontal": 10,
"position": "absolute",
"top": 0,
"width": "100%",
},
Object {
"backgroundColor": "#ddd",
"height": 0,
},
],
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"activeOpacity": 0.2,
"children": Array [
<Component
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"flex": 1,
"fontSize": 14,
"marginRight": 5,
},
Object {
"color": "#fff",
},
]
}
>
<RemoveMarkdown
value="Banner Text"
/>
</Component>,
<Icon
allowFontScaling={false}
color="#fff"
name="info"
size={16}
/>,
],
"onPress": [Function],
"style": Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
},
<AnimatedComponent
style={
Array [
Object {
"overflow": "hidden",
"paddingHorizontal": 10,
"position": "absolute",
"top": 0,
"width": "100%",
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": <RemoveMarkdown
value="Banner Text"
/>,
"ellipsizeMode": "tail",
"numberOfLines": 1,
"style": Array [
Object {
"flex": 1,
"fontSize": 14,
"marginRight": 5,
},
Object {
"color": "#fff",
},
],
Object {
"backgroundColor": "#ddd",
"height": 0,
},
]
}
>
<TouchableOpacity
activeOpacity={0.2}
onPress={[Function]}
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
}
}
>
<Component
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"flex": 1,
"fontSize": 14,
"marginRight": 5,
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"value": "Banner Text",
},
"ref": null,
"rendered": null,
"type": [Function],
},
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"allowFontScaling": false,
Object {
"color": "#fff",
"name": "info",
"size": 16,
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": [Function],
},
"type": [Function],
},
Symbol(enzyme.__nodes__): Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": <TouchableOpacity
activeOpacity={0.2}
onPress={[Function]}
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
}
}
>
<Component
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"flex": 1,
"fontSize": 14,
"marginRight": 5,
},
Object {
"color": "#fff",
},
]
}
>
<RemoveMarkdown
value="Banner Text"
/>
</Component>
<Icon
allowFontScaling={false}
color="#fff"
name="info"
size={16}
/>
</TouchableOpacity>,
"style": Array [
Object {
"overflow": "hidden",
"paddingHorizontal": 10,
"position": "absolute",
"top": 0,
"width": "100%",
},
Object {
"backgroundColor": "#ddd",
"height": 0,
},
],
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"activeOpacity": 0.2,
"children": Array [
<Component
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"flex": 1,
"fontSize": 14,
"marginRight": 5,
},
Object {
"color": "#fff",
},
]
}
>
<RemoveMarkdown
value="Banner Text"
/>
</Component>,
<Icon
allowFontScaling={false}
color="#fff"
name="info"
size={16}
/>,
],
"onPress": [Function],
"style": Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
},
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": <RemoveMarkdown
value="Banner Text"
/>,
"ellipsizeMode": "tail",
"numberOfLines": 1,
"style": Array [
Object {
"flex": 1,
"fontSize": 14,
"marginRight": 5,
},
Object {
"color": "#fff",
},
],
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"value": "Banner Text",
},
"ref": null,
"rendered": null,
"type": [Function],
},
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"allowFontScaling": false,
"color": "#fff",
"name": "info",
"size": 16,
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": [Function],
},
"type": [Function],
},
],
Symbol(enzyme.__options__): Object {
"adapter": ReactSixteenAdapter {
"options": Object {
"enableComponentDidUpdateOnSetState": true,
"lifecycles": Object {
"componentDidUpdate": Object {
"onSetState": true,
},
"getDerivedStateFromProps": true,
"getSnapshotBeforeUpdate": true,
"setState": Object {
"skipsComponentDidUpdateOnNullish": true,
},
},
},
},
"attachTo": undefined,
"hydrateIn": undefined,
},
}
]
}
>
<RemoveMarkdown
value="Banner Text"
/>
</Component>
<Icon
allowFontScaling={false}
color="#fff"
name="info"
size={16}
/>
</TouchableOpacity>
</AnimatedComponent>
`;
exports[`AnnouncementBanner should match snapshot 2`] = `
ShallowWrapper {
Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <AnnouncementBanner
bannerColor="#ddd"
bannerDismissed={false}
bannerEnabled={false}
bannerText="Banner Text"
bannerTextColor="#fff"
navigator={Object {}}
theme={Object {}}
/>,
Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function],
"getNode": [Function],
"render": [Function],
"simulateError": [Function],
"simulateEvent": [Function],
"unmount": [Function],
},
Symbol(enzyme.__node__): null,
Symbol(enzyme.__nodes__): Array [
null,
],
Symbol(enzyme.__options__): Object {
"adapter": ReactSixteenAdapter {
"options": Object {
"enableComponentDidUpdateOnSetState": true,
"lifecycles": Object {
"componentDidUpdate": Object {
"onSetState": true,
},
"getDerivedStateFromProps": true,
"getSnapshotBeforeUpdate": true,
"setState": Object {
"skipsComponentDidUpdateOnNullish": true,
},
},
},
},
"attachTo": undefined,
"hydrateIn": undefined,
},
}
`;
exports[`AnnouncementBanner should match snapshot 2`] = `null`;

View file

@ -24,9 +24,9 @@ describe('AnnouncementBanner', () => {
<AnnouncementBanner {...baseProps}/>
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
wrapper.setProps({bannerEnabled: false});
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
});

View file

@ -1,216 +1,38 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`CustomList should match snapshot 1`] = `
ShallowWrapper {
Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <CustomList
createSections={[Function]}
data={
Array [
Object {
"username": "username_1",
},
Object {
"username": "username_2",
},
]
}
listInitialSize={0}
listPageSize={0}
listScrollRenderAheadDistance={0}
loading={false}
loadingText={
Object {
"defaultMessage": "Loading Members...",
"id": "mobile.loading_members",
}
}
onListEndReached={[Function]}
onListEndReachedThreshold={0}
onRowPress={[Function]}
onRowSelect={[Function]}
renderRow={[Function]}
searching={false}
selectable={true}
showNoResults={false}
showSections={true}
theme={
Object {
"centerChannelBg": "#aaa",
"centerChannelColor": "#aaa",
}
}
/>,
Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function],
"getNode": [Function],
"render": [Function],
"simulateError": [Function],
"simulateEvent": [Function],
"unmount": [Function],
},
Symbol(enzyme.__node__): Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<ListViewMock
dataSource={
ListViewDataSource {
"items": 2,
}
}
enableEmptySections={true}
initialListSize={0}
onEndReached={[Function]}
onEndReachedThreshold={0}
pageSize={0}
renderFooter={[Function]}
renderRow={[Function]}
renderScrollComponent={[Function]}
renderSectionHeader={[Function]}
renderSeparator={[Function]}
scrollRenderAheadDistance={0}
style={
Object {
"backgroundColor": "#aaa",
"flex": 1,
}
}
/>,
undefined,
],
"style": Object {
"flex": 1,
},
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"dataSource": ListViewDataSource {
"items": 2,
},
"enableEmptySections": true,
"initialListSize": 0,
"onEndReached": [Function],
"onEndReachedThreshold": 0,
"pageSize": 0,
"renderFooter": [Function],
"renderRow": [Function],
"renderScrollComponent": [Function],
"renderSectionHeader": [Function],
"renderSeparator": [Function],
"scrollRenderAheadDistance": 0,
"style": Object {
"backgroundColor": "#aaa",
"flex": 1,
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
undefined,
],
"type": [Function],
},
Symbol(enzyme.__nodes__): Array [
<Component
style={
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<ListViewMock
dataSource={
ListViewDataSource {
"items": 2,
}
}
enableEmptySections={true}
initialListSize={0}
onEndReached={[Function]}
onEndReachedThreshold={0}
pageSize={0}
renderFooter={[Function]}
renderRow={[Function]}
renderScrollComponent={[Function]}
renderSectionHeader={[Function]}
renderSeparator={[Function]}
scrollRenderAheadDistance={0}
style={
Object {
"backgroundColor": "#aaa",
"flex": 1,
}
}
/>,
undefined,
],
"style": Object {
"flex": 1,
},
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"dataSource": ListViewDataSource {
"items": 2,
},
"enableEmptySections": true,
"initialListSize": 0,
"onEndReached": [Function],
"onEndReachedThreshold": 0,
"pageSize": 0,
"renderFooter": [Function],
"renderRow": [Function],
"renderScrollComponent": [Function],
"renderSectionHeader": [Function],
"renderSeparator": [Function],
"scrollRenderAheadDistance": 0,
"style": Object {
"backgroundColor": "#aaa",
"flex": 1,
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
undefined,
],
"type": [Function],
},
],
Symbol(enzyme.__options__): Object {
"adapter": ReactSixteenAdapter {
"options": Object {
"enableComponentDidUpdateOnSetState": true,
"lifecycles": Object {
"componentDidUpdate": Object {
"onSetState": true,
},
"getDerivedStateFromProps": true,
"getSnapshotBeforeUpdate": true,
"setState": Object {
"skipsComponentDidUpdateOnNullish": true,
},
},
},
},
"attachTo": undefined,
"hydrateIn": undefined,
},
}
"flex": 1,
}
}
>
<ListViewMock
dataSource={
ListViewDataSource {
"items": 2,
}
}
enableEmptySections={true}
initialListSize={0}
onEndReached={[Function]}
onEndReachedThreshold={0}
pageSize={0}
renderFooter={[Function]}
renderRow={[Function]}
renderScrollComponent={[Function]}
renderSectionHeader={[Function]}
renderSeparator={[Function]}
scrollRenderAheadDistance={0}
style={
Object {
"backgroundColor": "#aaa",
"flex": 1,
}
}
/>
</Component>
`;
exports[`CustomList should match snapshot, renderFooter 1`] = `null`;

View file

@ -35,7 +35,7 @@ describe('CustomList', () => {
const wrapper = shallow(
<CustomList {...baseProps}/>
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
expect(wrapper.state('data')).toEqual({U: baseProps.data});
// on componentWillReceiveProps

View file

@ -36,7 +36,7 @@ describe('UserListRow', () => {
<UserListRow {...baseProps}/>,
{context: {intl: {formatMessage}}},
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
test('should match snapshot for deactivated user', () => {
@ -55,7 +55,7 @@ describe('UserListRow', () => {
<UserListRow {...newProps}/>,
{context: {intl: {formatMessage}}},
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
test('should match snapshot for currentUser with (you) populated in list', () => {
@ -68,6 +68,6 @@ describe('UserListRow', () => {
<UserListRow {...newProps}/>,
{context: {intl: {formatMessage}}},
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
});

View file

@ -1,76 +1,14 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Hashtag should match snapshot 1`] = `
ShallowWrapper {
Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <Hashtag
hashtag="test"
linkStyle={
Object {
"color": "red",
}
}
navigator={Object {}}
theme={Object {}}
/>,
Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function],
"getNode": [Function],
"render": [Function],
"simulateError": [Function],
"simulateEvent": [Function],
"unmount": [Function],
},
Symbol(enzyme.__node__): Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": "#test",
"onPress": [Function],
"style": Object {
"color": "red",
},
},
"ref": null,
"rendered": "#test",
"type": [Function],
},
Symbol(enzyme.__nodes__): Array [
<Component
onPress={[Function]}
style={
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": "#test",
"onPress": [Function],
"style": Object {
"color": "red",
},
},
"ref": null,
"rendered": "#test",
"type": [Function],
},
],
Symbol(enzyme.__options__): Object {
"adapter": ReactSixteenAdapter {
"options": Object {
"enableComponentDidUpdateOnSetState": true,
"lifecycles": Object {
"componentDidUpdate": Object {
"onSetState": true,
},
"getDerivedStateFromProps": true,
"getSnapshotBeforeUpdate": true,
"setState": Object {
"skipsComponentDidUpdateOnNullish": true,
},
},
},
},
"attachTo": undefined,
"hydrateIn": undefined,
},
}
"color": "red",
}
}
>
#test
</Component>
`;

View file

@ -18,7 +18,7 @@ describe('Hashtag', () => {
test('should match snapshot', () => {
const wrapper = shallow(<Hashtag {...baseProps}/>);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
test('should open hashtag search on click', () => {

View file

@ -1,669 +1,119 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`DateHeader component should match snapshot with suffix 1`] = `
ShallowWrapper {
Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <DateHeader
dateLineString="date-1531152392-index-2"
index={2}
theme={
<Component
style={
Array [
Object {
"centerChannelBg": "#aaa",
"centerChannelColor": "#aaa",
"alignItems": "center",
"flexDirection": "row",
"height": 28,
"marginTop": 8,
},
undefined,
]
}
>
<Component
style={
Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
}
}
/>,
Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function],
"getNode": [Function],
"render": [Function],
"simulateError": [Function],
"simulateEvent": [Function],
"unmount": [Function],
},
Symbol(enzyme.__node__): Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<Component
style={
Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
}
}
/>,
<Component
style={
Object {
"marginHorizontal": 15,
}
}
>
<InjectIntl(FormattedDate)
day="2-digit"
month="short"
style={
Object {
"color": "#aaa",
"fontSize": 14,
"fontWeight": "600",
}
}
value={1970-01-18T17:19:12.392Z}
weekday="short"
year="numeric"
/>
</Component>,
<Component
style={
Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
}
}
/>,
],
"style": Array [
Object {
"alignItems": "center",
"flexDirection": "row",
"height": 28,
"marginTop": 8,
},
undefined,
],
},
"ref": null,
"rendered": Array [
/>
<Component
style={
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"style": Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
"marginHorizontal": 15,
}
}
>
<InjectIntl(FormattedDate)
day="2-digit"
month="short"
style={
Object {
"color": "#aaa",
"fontSize": 14,
"fontWeight": "600",
}
}
value={1970-01-18T17:19:12.392Z}
weekday="short"
year="numeric"
/>
</Component>
<Component
style={
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": <InjectIntl(FormattedDate)
day="2-digit"
month="short"
style={
Object {
"color": "#aaa",
"fontSize": 14,
"fontWeight": "600",
}
}
value={1970-01-18T17:19:12.392Z}
weekday="short"
year="numeric"
/>,
"style": Object {
"marginHorizontal": 15,
},
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"day": "2-digit",
"month": "short",
"style": Object {
"color": "#aaa",
"fontSize": 14,
"fontWeight": "600",
},
"value": 1970-01-18T17:19:12.392Z,
"weekday": "short",
"year": "numeric",
},
"ref": null,
"rendered": null,
"type": [Function],
},
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"style": Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": [Function],
},
Symbol(enzyme.__nodes__): Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<Component
style={
Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
}
}
/>,
<Component
style={
Object {
"marginHorizontal": 15,
}
}
>
<InjectIntl(FormattedDate)
day="2-digit"
month="short"
style={
Object {
"color": "#aaa",
"fontSize": 14,
"fontWeight": "600",
}
}
value={1970-01-18T17:19:12.392Z}
weekday="short"
year="numeric"
/>
</Component>,
<Component
style={
Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
}
}
/>,
],
"style": Array [
Object {
"alignItems": "center",
"flexDirection": "row",
"height": 28,
"marginTop": 8,
},
undefined,
],
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"style": Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": <InjectIntl(FormattedDate)
day="2-digit"
month="short"
style={
Object {
"color": "#aaa",
"fontSize": 14,
"fontWeight": "600",
}
}
value={1970-01-18T17:19:12.392Z}
weekday="short"
year="numeric"
/>,
"style": Object {
"marginHorizontal": 15,
},
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"day": "2-digit",
"month": "short",
"style": Object {
"color": "#aaa",
"fontSize": 14,
"fontWeight": "600",
},
"value": 1970-01-18T17:19:12.392Z,
"weekday": "short",
"year": "numeric",
},
"ref": null,
"rendered": null,
"type": [Function],
},
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"style": Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": [Function],
},
],
Symbol(enzyme.__options__): Object {
"adapter": ReactSixteenAdapter {
"options": Object {
"enableComponentDidUpdateOnSetState": true,
"lifecycles": Object {
"componentDidUpdate": Object {
"onSetState": true,
},
"getDerivedStateFromProps": true,
"getSnapshotBeforeUpdate": true,
"setState": Object {
"skipsComponentDidUpdateOnNullish": true,
},
},
},
},
"attachTo": undefined,
"context": Object {
"intl": Object {
"formatMessage": [MockFunction],
},
},
"hydrateIn": undefined,
},
}
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
}
}
/>
</Component>
`;
exports[`DateHeader component should match snapshot without suffix 1`] = `
ShallowWrapper {
Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <DateHeader
dateLineString="date-1531152392"
index={0}
theme={
<Component
style={
Array [
Object {
"centerChannelBg": "#aaa",
"centerChannelColor": "#aaa",
"alignItems": "center",
"flexDirection": "row",
"height": 28,
"marginTop": 8,
},
undefined,
]
}
>
<Component
style={
Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
}
}
/>,
Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function],
"getNode": [Function],
"render": [Function],
"simulateError": [Function],
"simulateEvent": [Function],
"unmount": [Function],
},
Symbol(enzyme.__node__): Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<Component
style={
Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
}
}
/>,
<Component
style={
Object {
"marginHorizontal": 15,
}
}
>
<InjectIntl(FormattedDate)
day="2-digit"
month="short"
style={
Object {
"color": "#aaa",
"fontSize": 14,
"fontWeight": "600",
}
}
value={1970-01-18T17:19:12.392Z}
weekday="short"
year="numeric"
/>
</Component>,
<Component
style={
Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
}
}
/>,
],
"style": Array [
Object {
"alignItems": "center",
"flexDirection": "row",
"height": 28,
"marginTop": 8,
},
undefined,
],
},
"ref": null,
"rendered": Array [
/>
<Component
style={
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"style": Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
"marginHorizontal": 15,
}
}
>
<InjectIntl(FormattedDate)
day="2-digit"
month="short"
style={
Object {
"color": "#aaa",
"fontSize": 14,
"fontWeight": "600",
}
}
value={1970-01-18T17:19:12.392Z}
weekday="short"
year="numeric"
/>
</Component>
<Component
style={
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": <InjectIntl(FormattedDate)
day="2-digit"
month="short"
style={
Object {
"color": "#aaa",
"fontSize": 14,
"fontWeight": "600",
}
}
value={1970-01-18T17:19:12.392Z}
weekday="short"
year="numeric"
/>,
"style": Object {
"marginHorizontal": 15,
},
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"day": "2-digit",
"month": "short",
"style": Object {
"color": "#aaa",
"fontSize": 14,
"fontWeight": "600",
},
"value": 1970-01-18T17:19:12.392Z,
"weekday": "short",
"year": "numeric",
},
"ref": null,
"rendered": null,
"type": [Function],
},
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"style": Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": [Function],
},
Symbol(enzyme.__nodes__): Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<Component
style={
Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
}
}
/>,
<Component
style={
Object {
"marginHorizontal": 15,
}
}
>
<InjectIntl(FormattedDate)
day="2-digit"
month="short"
style={
Object {
"color": "#aaa",
"fontSize": 14,
"fontWeight": "600",
}
}
value={1970-01-18T17:19:12.392Z}
weekday="short"
year="numeric"
/>
</Component>,
<Component
style={
Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
}
}
/>,
],
"style": Array [
Object {
"alignItems": "center",
"flexDirection": "row",
"height": 28,
"marginTop": 8,
},
undefined,
],
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"style": Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": <InjectIntl(FormattedDate)
day="2-digit"
month="short"
style={
Object {
"color": "#aaa",
"fontSize": 14,
"fontWeight": "600",
}
}
value={1970-01-18T17:19:12.392Z}
weekday="short"
year="numeric"
/>,
"style": Object {
"marginHorizontal": 15,
},
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"day": "2-digit",
"month": "short",
"style": Object {
"color": "#aaa",
"fontSize": 14,
"fontWeight": "600",
},
"value": 1970-01-18T17:19:12.392Z,
"weekday": "short",
"year": "numeric",
},
"ref": null,
"rendered": null,
"type": [Function],
},
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"style": Object {
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": [Function],
},
],
Symbol(enzyme.__options__): Object {
"adapter": ReactSixteenAdapter {
"options": Object {
"enableComponentDidUpdateOnSetState": true,
"lifecycles": Object {
"componentDidUpdate": Object {
"onSetState": true,
},
"getDerivedStateFromProps": true,
"getSnapshotBeforeUpdate": true,
"setState": Object {
"skipsComponentDidUpdateOnNullish": true,
},
},
},
},
"attachTo": undefined,
"context": Object {
"intl": Object {
"formatMessage": [MockFunction],
},
},
"hydrateIn": undefined,
},
}
"backgroundColor": "#aaa",
"flex": 1,
"height": 1,
"opacity": 0.2,
}
}
/>
</Component>
`;

View file

@ -25,7 +25,7 @@ describe('DateHeader', () => {
{context: {intl: {formatMessage: jest.fn()}}},
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
it('with suffix', () => {
@ -39,7 +39,7 @@ describe('DateHeader', () => {
{context: {intl: {formatMessage: jest.fn()}}},
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
});
});

View file

@ -35,879 +35,125 @@ exports[`ShowMoreButton should match, button snapshot 2`] = `
`;
exports[`ShowMoreButton should match, full snapshot 1`] = `
ShallowWrapper {
Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <ShowMoreButton
highlight={false}
onPress={[MockFunction]}
showMore={true}
theme={
<Component>
<LinearGradient
colors={
Array [
"rgba(47,62,78,0)",
"rgba(47,62,78,0.75)",
"#2f3e4e",
]
}
end={
Object {
"centerChannelBg": "#2f3e4e",
"centerChannelColor": "#dddddd",
"x": 0.5,
"y": 1,
}
}
/>,
Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function],
"getNode": [Function],
"render": [Function],
"simulateError": [Function],
"simulateEvent": [Function],
"unmount": [Function],
},
Symbol(enzyme.__node__): Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<LinearGradient
colors={
Array [
"rgba(47,62,78,0)",
"rgba(47,62,78,0.75)",
"#2f3e4e",
]
}
end={
Object {
"x": 0.5,
"y": 1,
}
}
locations={
Array [
0,
0.7,
1,
]
}
start={
Object {
"x": 0.5,
"y": 0,
}
}
style={
Object {
"flex": 1,
"height": 50,
"position": "absolute",
"top": -50,
"width": "100%",
}
}
/>,
<Component
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "center",
"marginBottom": 10,
"position": "relative",
"top": 10,
}
}
>
<Component
style={
Object {
"backgroundColor": "rgba(221,221,221,0.2)",
"flex": 1,
"height": 1,
"marginRight": 10,
}
}
/>
<TouchableOpacity
activeOpacity={0.2}
onPress={[MockFunction]}
style={
Object {
"backgroundColor": "#2f3e4e",
"borderColor": "rgba(221,221,221,0.2)",
"borderRadius": 4,
"borderWidth": 1,
"height": 37,
"paddingHorizontal": 10,
}
}
>
<Component
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
}
}
>
<Component
style={
Object {
"color": undefined,
"fontSize": 16,
"fontWeight": "600",
"marginRight": 8,
}
}
>
+
</Component>
<FormattedText
defaultMessage="Show More"
id="post_info.message.show_more"
style={
Object {
"color": undefined,
"fontSize": 13,
"fontWeight": "600",
}
}
/>
</Component>
</TouchableOpacity>
<Component
style={
Object {
"backgroundColor": "rgba(221,221,221,0.2)",
"flex": 1,
"height": 1,
"marginLeft": 10,
}
}
/>
</Component>,
],
},
"ref": null,
"rendered": Array [
locations={
Array [
0,
0.7,
1,
]
}
start={
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"colors": Array [
"rgba(47,62,78,0)",
"rgba(47,62,78,0.75)",
"#2f3e4e",
],
"end": Object {
"x": 0.5,
"y": 1,
},
"locations": Array [
0,
0.7,
1,
],
"start": Object {
"x": 0.5,
"y": 0,
},
"style": Object {
"flex": 1,
"height": 50,
"position": "absolute",
"top": -50,
"width": "100%",
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
"x": 0.5,
"y": 0,
}
}
style={
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<Component
style={
Object {
"backgroundColor": "rgba(221,221,221,0.2)",
"flex": 1,
"height": 1,
"marginRight": 10,
}
}
/>,
<TouchableOpacity
activeOpacity={0.2}
onPress={[MockFunction]}
style={
Object {
"backgroundColor": "#2f3e4e",
"borderColor": "rgba(221,221,221,0.2)",
"borderRadius": 4,
"borderWidth": 1,
"height": 37,
"paddingHorizontal": 10,
}
}
>
<Component
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
}
}
>
<Component
style={
Object {
"color": undefined,
"fontSize": 16,
"fontWeight": "600",
"marginRight": 8,
}
}
>
+
</Component>
<FormattedText
defaultMessage="Show More"
id="post_info.message.show_more"
style={
Object {
"color": undefined,
"fontSize": 13,
"fontWeight": "600",
}
}
/>
</Component>
</TouchableOpacity>,
<Component
style={
Object {
"backgroundColor": "rgba(221,221,221,0.2)",
"flex": 1,
"height": 1,
"marginLeft": 10,
}
}
/>,
],
"style": Object {
"flex": 1,
"height": 50,
"position": "absolute",
"top": -50,
"width": "100%",
}
}
/>
<Component
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "center",
"marginBottom": 10,
"position": "relative",
"top": 10,
}
}
>
<Component
style={
Object {
"backgroundColor": "rgba(221,221,221,0.2)",
"flex": 1,
"height": 1,
"marginRight": 10,
}
}
/>
<TouchableOpacity
activeOpacity={0.2}
onPress={[MockFunction]}
style={
Object {
"backgroundColor": "#2f3e4e",
"borderColor": "rgba(221,221,221,0.2)",
"borderRadius": 4,
"borderWidth": 1,
"height": 37,
"paddingHorizontal": 10,
}
}
>
<Component
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "center",
"marginBottom": 10,
"position": "relative",
"top": 10,
},
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"style": Object {
"backgroundColor": "rgba(221,221,221,0.2)",
"flex": 1,
"height": 1,
"marginRight": 10,
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"activeOpacity": 0.2,
"children": <Component
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
}
}
>
<Component
style={
Object {
"color": undefined,
"fontSize": 16,
"fontWeight": "600",
"marginRight": 8,
}
}
>
+
</Component>
<FormattedText
defaultMessage="Show More"
id="post_info.message.show_more"
style={
Object {
"color": undefined,
"fontSize": 13,
"fontWeight": "600",
}
}
/>
</Component>,
"onPress": [MockFunction],
"style": Object {
"backgroundColor": "#2f3e4e",
"borderColor": "rgba(221,221,221,0.2)",
"borderRadius": 4,
"borderWidth": 1,
"height": 37,
"paddingHorizontal": 10,
},
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<Component
style={
Object {
"color": undefined,
"fontSize": 16,
"fontWeight": "600",
"marginRight": 8,
}
}
>
+
</Component>,
<FormattedText
defaultMessage="Show More"
id="post_info.message.show_more"
style={
Object {
"color": undefined,
"fontSize": 13,
"fontWeight": "600",
}
}
/>,
],
"style": Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
},
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": "+",
"style": Object {
"color": undefined,
"fontSize": 16,
"fontWeight": "600",
"marginRight": 8,
},
},
"ref": null,
"rendered": "+",
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"defaultMessage": "Show More",
"id": "post_info.message.show_more",
"style": Object {
"color": undefined,
"fontSize": 13,
"fontWeight": "600",
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": [Function],
},
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"style": Object {
"backgroundColor": "rgba(221,221,221,0.2)",
"flex": 1,
"height": 1,
"marginLeft": 10,
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": [Function],
},
],
"type": [Function],
},
Symbol(enzyme.__nodes__): Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<LinearGradient
colors={
Array [
"rgba(47,62,78,0)",
"rgba(47,62,78,0.75)",
"#2f3e4e",
]
}
}
>
<Component
style={
Object {
"color": undefined,
"fontSize": 16,
"fontWeight": "600",
"marginRight": 8,
}
end={
Object {
"x": 0.5,
"y": 1,
}
}
>
+
</Component>
<FormattedText
defaultMessage="Show More"
id="post_info.message.show_more"
style={
Object {
"color": undefined,
"fontSize": 13,
"fontWeight": "600",
}
locations={
Array [
0,
0.7,
1,
]
}
start={
Object {
"x": 0.5,
"y": 0,
}
}
style={
Object {
"flex": 1,
"height": 50,
"position": "absolute",
"top": -50,
"width": "100%",
}
}
/>,
<Component
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "center",
"marginBottom": 10,
"position": "relative",
"top": 10,
}
}
>
<Component
style={
Object {
"backgroundColor": "rgba(221,221,221,0.2)",
"flex": 1,
"height": 1,
"marginRight": 10,
}
}
/>
<TouchableOpacity
activeOpacity={0.2}
onPress={[MockFunction]}
style={
Object {
"backgroundColor": "#2f3e4e",
"borderColor": "rgba(221,221,221,0.2)",
"borderRadius": 4,
"borderWidth": 1,
"height": 37,
"paddingHorizontal": 10,
}
}
>
<Component
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
}
}
>
<Component
style={
Object {
"color": undefined,
"fontSize": 16,
"fontWeight": "600",
"marginRight": 8,
}
}
>
+
</Component>
<FormattedText
defaultMessage="Show More"
id="post_info.message.show_more"
style={
Object {
"color": undefined,
"fontSize": 13,
"fontWeight": "600",
}
}
/>
</Component>
</TouchableOpacity>
<Component
style={
Object {
"backgroundColor": "rgba(221,221,221,0.2)",
"flex": 1,
"height": 1,
"marginLeft": 10,
}
}
/>
</Component>,
],
},
"ref": null,
"rendered": Array [
}
/>
</Component>
</TouchableOpacity>
<Component
style={
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"colors": Array [
"rgba(47,62,78,0)",
"rgba(47,62,78,0.75)",
"#2f3e4e",
],
"end": Object {
"x": 0.5,
"y": 1,
},
"locations": Array [
0,
0.7,
1,
],
"start": Object {
"x": 0.5,
"y": 0,
},
"style": Object {
"flex": 1,
"height": 50,
"position": "absolute",
"top": -50,
"width": "100%",
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<Component
style={
Object {
"backgroundColor": "rgba(221,221,221,0.2)",
"flex": 1,
"height": 1,
"marginRight": 10,
}
}
/>,
<TouchableOpacity
activeOpacity={0.2}
onPress={[MockFunction]}
style={
Object {
"backgroundColor": "#2f3e4e",
"borderColor": "rgba(221,221,221,0.2)",
"borderRadius": 4,
"borderWidth": 1,
"height": 37,
"paddingHorizontal": 10,
}
}
>
<Component
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
}
}
>
<Component
style={
Object {
"color": undefined,
"fontSize": 16,
"fontWeight": "600",
"marginRight": 8,
}
}
>
+
</Component>
<FormattedText
defaultMessage="Show More"
id="post_info.message.show_more"
style={
Object {
"color": undefined,
"fontSize": 13,
"fontWeight": "600",
}
}
/>
</Component>
</TouchableOpacity>,
<Component
style={
Object {
"backgroundColor": "rgba(221,221,221,0.2)",
"flex": 1,
"height": 1,
"marginLeft": 10,
}
}
/>,
],
"style": Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"justifyContent": "center",
"marginBottom": 10,
"position": "relative",
"top": 10,
},
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"style": Object {
"backgroundColor": "rgba(221,221,221,0.2)",
"flex": 1,
"height": 1,
"marginRight": 10,
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"activeOpacity": 0.2,
"children": <Component
style={
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
}
}
>
<Component
style={
Object {
"color": undefined,
"fontSize": 16,
"fontWeight": "600",
"marginRight": 8,
}
}
>
+
</Component>
<FormattedText
defaultMessage="Show More"
id="post_info.message.show_more"
style={
Object {
"color": undefined,
"fontSize": 13,
"fontWeight": "600",
}
}
/>
</Component>,
"onPress": [MockFunction],
"style": Object {
"backgroundColor": "#2f3e4e",
"borderColor": "rgba(221,221,221,0.2)",
"borderRadius": 4,
"borderWidth": 1,
"height": 37,
"paddingHorizontal": 10,
},
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<Component
style={
Object {
"color": undefined,
"fontSize": 16,
"fontWeight": "600",
"marginRight": 8,
}
}
>
+
</Component>,
<FormattedText
defaultMessage="Show More"
id="post_info.message.show_more"
style={
Object {
"color": undefined,
"fontSize": 13,
"fontWeight": "600",
}
}
/>,
],
"style": Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
},
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": "+",
"style": Object {
"color": undefined,
"fontSize": 16,
"fontWeight": "600",
"marginRight": 8,
},
},
"ref": null,
"rendered": "+",
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"defaultMessage": "Show More",
"id": "post_info.message.show_more",
"style": Object {
"color": undefined,
"fontSize": 13,
"fontWeight": "600",
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": [Function],
},
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"style": Object {
"backgroundColor": "rgba(221,221,221,0.2)",
"flex": 1,
"height": 1,
"marginLeft": 10,
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": [Function],
},
],
"type": [Function],
},
],
Symbol(enzyme.__options__): Object {
"adapter": ReactSixteenAdapter {
"options": Object {
"enableComponentDidUpdateOnSetState": true,
"lifecycles": Object {
"componentDidUpdate": Object {
"onSetState": true,
},
"getDerivedStateFromProps": true,
"getSnapshotBeforeUpdate": true,
"setState": Object {
"skipsComponentDidUpdateOnNullish": true,
},
},
},
},
"attachTo": undefined,
"hydrateIn": undefined,
},
}
"backgroundColor": "rgba(221,221,221,0.2)",
"flex": 1,
"height": 1,
"marginLeft": 10,
}
}
/>
</Component>
</Component>
`;

View file

@ -25,7 +25,7 @@ describe('ShowMoreButton', () => {
<ShowMoreButton {...baseProps}/>
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
test('should match, button snapshot', () => {

View file

@ -1,818 +1,82 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChannelItem should match snapshot 1`] = `
ShallowWrapper {
Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <ChannelItem
channelId="channel_id"
currentChannelId="current_channel_id"
displayName="display_name"
fake={false}
isArchived={false}
isChannelMuted={false}
isMyUser={true}
isUnread={true}
mentions={0}
navigator={
Object {
"push": [Function],
<AnimatedComponent>
<TouchableHighlight
activeOpacity={0.85}
delayPressOut={100}
onLongPress={[Function]}
onPress={[Function]}
underlayColor="rgba(170,170,170,0.5)"
>
<Component
style={
Array [
Object {
"flex": 1,
"flexDirection": "row",
"height": 44,
},
undefined,
]
}
}
onSelectChannel={[Function]}
shouldHideChannel={false}
showUnreadForMsgs={true}
status="online"
teammateDeletedAt={0}
theme={
Object {
"sidebarText": "#aaa",
"sidebarTextActiveBorder": "#aaa",
"sidebarTextActiveColor": "#aaa",
"sidebarTextHoverBg": "#aaa",
}
}
type="O"
unreadMsgs={1}
/>,
Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function],
"getNode": [Function],
"render": [Function],
"simulateError": [Function],
"simulateEvent": [Function],
"unmount": [Function],
},
Symbol(enzyme.__node__): Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": <TouchableHighlight
activeOpacity={0.85}
delayPressOut={100}
onLongPress={[Function]}
onPress={[Function]}
underlayColor="rgba(170,170,170,0.5)"
>
<Component
style={
Array [
Object {
"flex": 1,
"flexDirection": "row",
"height": 44,
},
undefined,
]
}
>
<Component
style={
Array [
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"paddingLeft": 16,
},
undefined,
]
}
>
<ChannelIcon
channelId="channel_id"
isActive={false}
isArchived={false}
isInfo={false}
isUnread={true}
membersCount={1}
size={16}
status="online"
teammateDeletedAt={0}
theme={
Object {
"sidebarText": "#aaa",
"sidebarTextActiveBorder": "#aaa",
"sidebarTextActiveColor": "#aaa",
"sidebarTextHoverBg": "#aaa",
}
}
type="O"
/>
<Component
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "rgba(170,170,170,0.4)",
"flex": 1,
"fontSize": 14,
"fontWeight": "600",
"height": "100%",
"lineHeight": 44,
"paddingRight": 40,
"textAlignVertical": "center",
},
Object {
"color": undefined,
},
]
}
/>
</Component>
</Component>
</TouchableHighlight>,
},
"ref": [Function],
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"activeOpacity": 0.85,
"children": <Component
style={
Array [
Object {
"flex": 1,
"flexDirection": "row",
"height": 44,
},
undefined,
]
}
>
<Component
style={
Array [
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"paddingLeft": 16,
},
undefined,
]
}
>
<ChannelIcon
channelId="channel_id"
isActive={false}
isArchived={false}
isInfo={false}
isUnread={true}
membersCount={1}
size={16}
status="online"
teammateDeletedAt={0}
theme={
Object {
"sidebarText": "#aaa",
"sidebarTextActiveBorder": "#aaa",
"sidebarTextActiveColor": "#aaa",
"sidebarTextHoverBg": "#aaa",
}
}
type="O"
/>
<Component
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "rgba(170,170,170,0.4)",
"flex": 1,
"fontSize": 14,
"fontWeight": "600",
"height": "100%",
"lineHeight": 44,
"paddingRight": 40,
"textAlignVertical": "center",
},
Object {
"color": undefined,
},
]
}
/>
</Component>
</Component>,
"delayPressOut": 100,
"onLongPress": [Function],
"onPress": [Function],
"underlayColor": "rgba(170,170,170,0.5)",
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
undefined,
<Component
style={
Array [
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"paddingLeft": 16,
},
undefined,
]
}
>
<ChannelIcon
channelId="channel_id"
isActive={false}
isArchived={false}
isInfo={false}
isUnread={true}
membersCount={1}
size={16}
status="online"
teammateDeletedAt={0}
theme={
Object {
"sidebarText": "#aaa",
"sidebarTextActiveBorder": "#aaa",
"sidebarTextActiveColor": "#aaa",
"sidebarTextHoverBg": "#aaa",
}
}
type="O"
/>
<Component
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "rgba(170,170,170,0.4)",
"flex": 1,
"fontSize": 14,
"fontWeight": "600",
"height": "100%",
"lineHeight": 44,
"paddingRight": 40,
"textAlignVertical": "center",
},
Object {
"color": undefined,
},
]
}
/>
</Component>,
],
"style": Array [
>
<Component
style={
Array [
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"height": 44,
"paddingLeft": 16,
},
undefined,
],
},
"ref": null,
"rendered": Array [
undefined,
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<ChannelIcon
channelId="channel_id"
isActive={false}
isArchived={false}
isInfo={false}
isUnread={true}
membersCount={1}
size={16}
status="online"
teammateDeletedAt={0}
theme={
Object {
"sidebarText": "#aaa",
"sidebarTextActiveBorder": "#aaa",
"sidebarTextActiveColor": "#aaa",
"sidebarTextHoverBg": "#aaa",
}
}
type="O"
/>,
<Component
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "rgba(170,170,170,0.4)",
"flex": 1,
"fontSize": 14,
"fontWeight": "600",
"height": "100%",
"lineHeight": 44,
"paddingRight": 40,
"textAlignVertical": "center",
},
Object {
"color": undefined,
},
]
}
/>,
undefined,
],
"style": Array [
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"paddingLeft": 16,
},
undefined,
],
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"channelId": "channel_id",
"isActive": false,
"isArchived": false,
"isInfo": false,
"isUnread": true,
"membersCount": 1,
"size": 16,
"status": "online",
"teammateDeletedAt": 0,
"theme": Object {
"sidebarText": "#aaa",
"sidebarTextActiveBorder": "#aaa",
"sidebarTextActiveColor": "#aaa",
"sidebarTextHoverBg": "#aaa",
},
"type": "O",
},
"ref": null,
"rendered": null,
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": undefined,
"ellipsizeMode": "tail",
"numberOfLines": 1,
"style": Array [
Object {
"color": "rgba(170,170,170,0.4)",
"flex": 1,
"fontSize": 14,
"fontWeight": "600",
"height": "100%",
"lineHeight": 44,
"paddingRight": 40,
"textAlignVertical": "center",
},
Object {
"color": undefined,
},
],
},
"ref": null,
"rendered": null,
"type": [Function],
},
undefined,
],
"type": [Function],
},
],
"type": [Function],
},
"type": [Function],
},
"type": [Function],
},
Symbol(enzyme.__nodes__): Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": <TouchableHighlight
activeOpacity={0.85}
delayPressOut={100}
onLongPress={[Function]}
onPress={[Function]}
underlayColor="rgba(170,170,170,0.5)"
>
<Component
style={
Array [
Object {
"flex": 1,
"flexDirection": "row",
"height": 44,
},
undefined,
]
}
>
<Component
style={
Array [
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"paddingLeft": 16,
},
undefined,
]
}
>
<ChannelIcon
channelId="channel_id"
isActive={false}
isArchived={false}
isInfo={false}
isUnread={true}
membersCount={1}
size={16}
status="online"
teammateDeletedAt={0}
theme={
Object {
"sidebarText": "#aaa",
"sidebarTextActiveBorder": "#aaa",
"sidebarTextActiveColor": "#aaa",
"sidebarTextHoverBg": "#aaa",
}
}
type="O"
/>
<Component
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "rgba(170,170,170,0.4)",
"flex": 1,
"fontSize": 14,
"fontWeight": "600",
"height": "100%",
"lineHeight": 44,
"paddingRight": 40,
"textAlignVertical": "center",
},
Object {
"color": undefined,
},
]
}
/>
</Component>
</Component>
</TouchableHighlight>,
},
"ref": [Function],
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"activeOpacity": 0.85,
"children": <Component
style={
Array [
Object {
"flex": 1,
"flexDirection": "row",
"height": 44,
},
undefined,
]
}
>
<Component
style={
Array [
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"paddingLeft": 16,
},
undefined,
]
}
>
<ChannelIcon
channelId="channel_id"
isActive={false}
isArchived={false}
isInfo={false}
isUnread={true}
membersCount={1}
size={16}
status="online"
teammateDeletedAt={0}
theme={
Object {
"sidebarText": "#aaa",
"sidebarTextActiveBorder": "#aaa",
"sidebarTextActiveColor": "#aaa",
"sidebarTextHoverBg": "#aaa",
}
}
type="O"
/>
<Component
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "rgba(170,170,170,0.4)",
"flex": 1,
"fontSize": 14,
"fontWeight": "600",
"height": "100%",
"lineHeight": 44,
"paddingRight": 40,
"textAlignVertical": "center",
},
Object {
"color": undefined,
},
]
}
/>
</Component>
</Component>,
"delayPressOut": 100,
"onLongPress": [Function],
"onPress": [Function],
"underlayColor": "rgba(170,170,170,0.5)",
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
undefined,
<Component
style={
Array [
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"paddingLeft": 16,
},
undefined,
]
}
>
<ChannelIcon
channelId="channel_id"
isActive={false}
isArchived={false}
isInfo={false}
isUnread={true}
membersCount={1}
size={16}
status="online"
teammateDeletedAt={0}
theme={
Object {
"sidebarText": "#aaa",
"sidebarTextActiveBorder": "#aaa",
"sidebarTextActiveColor": "#aaa",
"sidebarTextHoverBg": "#aaa",
}
}
type="O"
/>
<Component
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "rgba(170,170,170,0.4)",
"flex": 1,
"fontSize": 14,
"fontWeight": "600",
"height": "100%",
"lineHeight": 44,
"paddingRight": 40,
"textAlignVertical": "center",
},
Object {
"color": undefined,
},
]
}
/>
</Component>,
],
"style": Array [
Object {
"flex": 1,
"flexDirection": "row",
"height": 44,
},
undefined,
],
},
"ref": null,
"rendered": Array [
undefined,
]
}
>
<ChannelIcon
channelId="channel_id"
isActive={false}
isArchived={false}
isInfo={false}
isUnread={true}
membersCount={1}
size={16}
status="online"
teammateDeletedAt={0}
theme={
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<ChannelIcon
channelId="channel_id"
isActive={false}
isArchived={false}
isInfo={false}
isUnread={true}
membersCount={1}
size={16}
status="online"
teammateDeletedAt={0}
theme={
Object {
"sidebarText": "#aaa",
"sidebarTextActiveBorder": "#aaa",
"sidebarTextActiveColor": "#aaa",
"sidebarTextHoverBg": "#aaa",
}
}
type="O"
/>,
<Component
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"color": "rgba(170,170,170,0.4)",
"flex": 1,
"fontSize": 14,
"fontWeight": "600",
"height": "100%",
"lineHeight": 44,
"paddingRight": 40,
"textAlignVertical": "center",
},
Object {
"color": undefined,
},
]
}
/>,
undefined,
],
"style": Array [
Object {
"alignItems": "center",
"flex": 1,
"flexDirection": "row",
"paddingLeft": 16,
},
undefined,
],
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"channelId": "channel_id",
"isActive": false,
"isArchived": false,
"isInfo": false,
"isUnread": true,
"membersCount": 1,
"size": 16,
"status": "online",
"teammateDeletedAt": 0,
"theme": Object {
"sidebarText": "#aaa",
"sidebarTextActiveBorder": "#aaa",
"sidebarTextActiveColor": "#aaa",
"sidebarTextHoverBg": "#aaa",
},
"type": "O",
},
"ref": null,
"rendered": null,
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": undefined,
"ellipsizeMode": "tail",
"numberOfLines": 1,
"style": Array [
Object {
"color": "rgba(170,170,170,0.4)",
"flex": 1,
"fontSize": 14,
"fontWeight": "600",
"height": "100%",
"lineHeight": 44,
"paddingRight": 40,
"textAlignVertical": "center",
},
Object {
"color": undefined,
},
],
},
"ref": null,
"rendered": null,
"type": [Function],
},
undefined,
],
"type": [Function],
},
],
"type": [Function],
},
"type": [Function],
},
"type": [Function],
},
],
Symbol(enzyme.__options__): Object {
"adapter": ReactSixteenAdapter {
"options": Object {
"enableComponentDidUpdateOnSetState": true,
"lifecycles": Object {
"componentDidUpdate": Object {
"onSetState": true,
},
"getDerivedStateFromProps": true,
"getSnapshotBeforeUpdate": true,
"setState": Object {
"skipsComponentDidUpdateOnNullish": true,
},
},
},
},
"attachTo": undefined,
"context": Object {
"intl": Object {
"formatMessage": [MockFunction] {
"calls": Array [
"sidebarText": "#aaa",
"sidebarTextActiveBorder": "#aaa",
"sidebarTextActiveColor": "#aaa",
"sidebarTextHoverBg": "#aaa",
}
}
type="O"
/>
<Component
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"defaultMessage": "{displayName} (you)",
"id": "channel_header.directchannel.you",
"color": "rgba(170,170,170,0.4)",
"flex": 1,
"fontSize": 14,
"fontWeight": "600",
"height": "100%",
"lineHeight": 44,
"paddingRight": 40,
"textAlignVertical": "center",
},
Object {
"displayname": "display_name",
"color": undefined,
},
],
],
"results": Array [
Object {
"isThrow": false,
"value": undefined,
},
],
},
},
},
"hydrateIn": undefined,
},
}
]
}
/>
</Component>
</Component>
</TouchableHighlight>
</AnimatedComponent>
`;

View file

@ -41,6 +41,6 @@ describe('ChannelItem', () => {
{context: {intl: {formatMessage: jest.fn()}}},
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
});

View file

@ -1,178 +1,30 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ErrorTeamsList should match snapshot 1`] = `
ShallowWrapper {
Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <ErrorTeamsList
actions={
Object {
"connection": [Function],
"loadMe": [Function],
"logout": [Function],
"selectDefaultTeam": [Function],
}
}
navigator={
Object {
"setOnNavigatorEvent": [Function],
}
}
theme={Object {}}
/>,
Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function],
"getNode": [Function],
"render": [Function],
"simulateError": [Function],
"simulateEvent": [Function],
"unmount": [Function],
},
Symbol(enzyme.__node__): Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<Connect(StatusBar) />,
<FailedNetworkAction
errorDescription={
Object {
"defaultMessage": "Make sure you have an active connection and try again.",
"id": "mobile.failed_network_action.shortDescription",
}
}
errorTitle={
Object {
"defaultMessage": "Team Not Found",
"id": "error.team_not_found.title",
}
}
onRetry={[Function]}
theme={Object {}}
/>,
],
"style": Object {
"backgroundColor": undefined,
"flex": 1,
},
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {},
"ref": null,
"rendered": null,
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"errorDescription": Object {
"defaultMessage": "Make sure you have an active connection and try again.",
"id": "mobile.failed_network_action.shortDescription",
},
"errorTitle": Object {
"defaultMessage": "Team Not Found",
"id": "error.team_not_found.title",
},
"onRetry": [Function],
"theme": Object {},
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": [Function],
},
Symbol(enzyme.__nodes__): Array [
<Component
style={
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<Connect(StatusBar) />,
<FailedNetworkAction
errorDescription={
Object {
"defaultMessage": "Make sure you have an active connection and try again.",
"id": "mobile.failed_network_action.shortDescription",
}
}
errorTitle={
Object {
"defaultMessage": "Team Not Found",
"id": "error.team_not_found.title",
}
}
onRetry={[Function]}
theme={Object {}}
/>,
],
"style": Object {
"backgroundColor": undefined,
"flex": 1,
},
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {},
"ref": null,
"rendered": null,
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"errorDescription": Object {
"defaultMessage": "Make sure you have an active connection and try again.",
"id": "mobile.failed_network_action.shortDescription",
},
"errorTitle": Object {
"defaultMessage": "Team Not Found",
"id": "error.team_not_found.title",
},
"onRetry": [Function],
"theme": Object {},
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": [Function],
},
],
Symbol(enzyme.__options__): Object {
"adapter": ReactSixteenAdapter {
"options": Object {
"enableComponentDidUpdateOnSetState": true,
"lifecycles": Object {
"componentDidUpdate": Object {
"onSetState": true,
},
"getDerivedStateFromProps": true,
"getSnapshotBeforeUpdate": true,
"setState": Object {
"skipsComponentDidUpdateOnNullish": true,
},
},
},
},
"attachTo": undefined,
"hydrateIn": undefined,
},
}
"backgroundColor": undefined,
"flex": 1,
}
}
>
<Connect(StatusBar) />
<FailedNetworkAction
errorDescription={
Object {
"defaultMessage": "Make sure you have an active connection and try again.",
"id": "mobile.failed_network_action.shortDescription",
}
}
errorTitle={
Object {
"defaultMessage": "Team Not Found",
"id": "error.team_not_found.title",
}
}
onRetry={[Function]}
theme={Object {}}
/>
</Component>
`;

View file

@ -35,7 +35,7 @@ describe('ErrorTeamsList', () => {
const wrapper = shallow(
<ErrorTeamsList {...baseProps}/>
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
test('should call for userInfo on retry', async () => {

View file

@ -25,7 +25,7 @@ describe('ForgotPassword', () => {
{context: {intl: {formatMessage}}},
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
test('snapshot for error on failure of email regex', () => {
@ -37,7 +37,7 @@ describe('ForgotPassword', () => {
wrapper.setState({email: 'bar'});
wrapper.instance().submitResetPassword();
wrapper.update();
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
test('Should call sendPasswordResetEmail', () => {
@ -71,6 +71,6 @@ describe('ForgotPassword', () => {
wrapper.setState({email: 'test@test.com'});
wrapper.instance().submitResetPassword();
await sendPasswordResetEmail();
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
});

View file

@ -1,690 +1,79 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`MoreChannels should match snapshot 1`] = `
ShallowWrapper {
Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <MoreChannels
actions={
Object {
"getChannels": [Function],
"handleSelectChannel": [Function],
"joinChannel": [Function],
"removeHiddenDefaultChannel": [Function],
"searchChannels": [Function],
"setChannelDisplayName": [Function],
}
}
canCreateChannels={true}
channels={
Array [
<Connect(KeyboardLayout)>
<Connect(StatusBar) />
<React.Fragment>
<Component
style={
Object {
"display_name": "display_name",
"id": "id",
"name": "name",
},
]
}
closeButton={Object {}}
currentTeamId="current_team_id"
currentUserId="current_user_id"
navigator={
Object {
"dismissModal": [Function],
"push": [Function],
"setButtons": [Function],
"setOnNavigatorEvent": [Function],
"marginVertical": 5,
}
}
}
requestStatus={Object {}}
theme={
Object {
"centerChannelBg": "#aaa",
"centerChannelColor": "#aaa",
"sidebarHeaderBg": "#aaa",
"sidebarHeaderTextColor": "#aaa",
}
}
/>,
Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function],
"getNode": [Function],
"render": [Function],
"simulateError": [Function],
"simulateEvent": [Function],
"unmount": [Function],
},
Symbol(enzyme.__node__): Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<Connect(StatusBar) />,
<React.Fragment>
<Component
style={
Object {
"marginVertical": 5,
}
}
>
<SearchBarIos
autoCapitalize="none"
backgroundColor="transparent"
blurOnSubmit={true}
inputHeight={33}
inputStyle={
Object {
"backgroundColor": "rgba(170,170,170,0.2)",
"color": "#aaa",
"fontSize": 15,
}
}
onBlur={[Function]}
onCancelButtonPress={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
onSearchButtonPress={[Function]}
onSelectionChange={[Function]}
placeholderTextColor="rgba(170,170,170,0.5)"
tintColorDelete="rgba(170,170,170,0.5)"
tintColorSearch="rgba(170,170,170,0.5)"
titleCancelColor="#aaa"
value=""
/>
</Component>
<CustomList
createSections={[Function]}
data={
Array [
Object {
"display_name": "display_name",
"id": "id",
"name": "name",
},
]
}
listInitialSize={10}
listPageSize={10}
listScrollRenderAheadDistance={50}
loading={false}
loadingText={
Object {
"defaultMessage": "Loading Channels...",
"id": "mobile.loading_channels",
}
}
onListEndReached={[Function]}
onListEndReachedThreshold={50}
onRowPress={[Function]}
renderRow={[Function]}
searching={false}
selectable={false}
showNoResults={false}
showSections={false}
theme={
Object {
"centerChannelBg": "#aaa",
"centerChannelColor": "#aaa",
"sidebarHeaderBg": "#aaa",
"sidebarHeaderTextColor": "#aaa",
}
}
/>
</React.Fragment>,
],
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {},
"ref": null,
"rendered": null,
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "function",
"props": Object {
"children": Array [
<Component
style={
Object {
"marginVertical": 5,
}
}
>
<SearchBarIos
autoCapitalize="none"
backgroundColor="transparent"
blurOnSubmit={true}
inputHeight={33}
inputStyle={
Object {
"backgroundColor": "rgba(170,170,170,0.2)",
"color": "#aaa",
"fontSize": 15,
}
}
onBlur={[Function]}
onCancelButtonPress={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
onSearchButtonPress={[Function]}
onSelectionChange={[Function]}
placeholderTextColor="rgba(170,170,170,0.5)"
tintColorDelete="rgba(170,170,170,0.5)"
tintColorSearch="rgba(170,170,170,0.5)"
titleCancelColor="#aaa"
value=""
/>
</Component>,
<CustomList
createSections={[Function]}
data={
Array [
Object {
"display_name": "display_name",
"id": "id",
"name": "name",
},
]
}
listInitialSize={10}
listPageSize={10}
listScrollRenderAheadDistance={50}
loading={false}
loadingText={
Object {
"defaultMessage": "Loading Channels...",
"id": "mobile.loading_channels",
}
}
onListEndReached={[Function]}
onListEndReachedThreshold={50}
onRowPress={[Function]}
renderRow={[Function]}
searching={false}
selectable={false}
showNoResults={false}
showSections={false}
theme={
Object {
"centerChannelBg": "#aaa",
"centerChannelColor": "#aaa",
"sidebarHeaderBg": "#aaa",
"sidebarHeaderTextColor": "#aaa",
}
}
/>,
],
},
"ref": null,
"rendered": Array [
>
<SearchBarIos
autoCapitalize="none"
backgroundColor="transparent"
blurOnSubmit={true}
inputHeight={33}
inputStyle={
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": <SearchBarIos
autoCapitalize="none"
backgroundColor="transparent"
blurOnSubmit={true}
inputHeight={33}
inputStyle={
Object {
"backgroundColor": "rgba(170,170,170,0.2)",
"color": "#aaa",
"fontSize": 15,
}
}
onBlur={[Function]}
onCancelButtonPress={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
onSearchButtonPress={[Function]}
onSelectionChange={[Function]}
placeholderTextColor="rgba(170,170,170,0.5)"
tintColorDelete="rgba(170,170,170,0.5)"
tintColorSearch="rgba(170,170,170,0.5)"
titleCancelColor="#aaa"
value=""
/>,
"style": Object {
"marginVertical": 5,
},
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"autoCapitalize": "none",
"backgroundColor": "transparent",
"blurOnSubmit": true,
"cancelTitle": undefined,
"inputHeight": 33,
"inputStyle": Object {
"backgroundColor": "rgba(170,170,170,0.2)",
"color": "#aaa",
"fontSize": 15,
},
"onBlur": [Function],
"onCancelButtonPress": [Function],
"onChangeText": [Function],
"onFocus": [Function],
"onSearchButtonPress": [Function],
"onSelectionChange": [Function],
"placeholder": undefined,
"placeholderTextColor": "rgba(170,170,170,0.5)",
"tintColorDelete": "rgba(170,170,170,0.5)",
"tintColorSearch": "rgba(170,170,170,0.5)",
"titleCancelColor": "#aaa",
"value": "",
},
"ref": "search_bar",
"rendered": null,
"type": [Function],
},
"type": [Function],
},
"backgroundColor": "rgba(170,170,170,0.2)",
"color": "#aaa",
"fontSize": 15,
}
}
onBlur={[Function]}
onCancelButtonPress={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
onSearchButtonPress={[Function]}
onSelectionChange={[Function]}
placeholderTextColor="rgba(170,170,170,0.5)"
tintColorDelete="rgba(170,170,170,0.5)"
tintColorSearch="rgba(170,170,170,0.5)"
titleCancelColor="#aaa"
value=""
/>
</Component>
<CustomList
createSections={[Function]}
data={
Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"createSections": [Function],
"data": Array [
Object {
"display_name": "display_name",
"id": "id",
"name": "name",
},
],
"listInitialSize": 10,
"listPageSize": 10,
"listScrollRenderAheadDistance": 50,
"loading": false,
"loadingText": Object {
"defaultMessage": "Loading Channels...",
"id": "mobile.loading_channels",
},
"onListEndReached": [Function],
"onListEndReachedThreshold": 50,
"onRowPress": [Function],
"renderRow": [Function],
"searching": false,
"selectable": false,
"showNoResults": false,
"showSections": false,
"theme": Object {
"centerChannelBg": "#aaa",
"centerChannelColor": "#aaa",
"sidebarHeaderBg": "#aaa",
"sidebarHeaderTextColor": "#aaa",
},
},
"ref": null,
"rendered": null,
"type": [Function],
"display_name": "display_name",
"id": "id",
"name": "name",
},
],
"type": Symbol(react.fragment),
},
],
"type": [Function],
},
Symbol(enzyme.__nodes__): Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<Connect(StatusBar) />,
<React.Fragment>
<Component
style={
Object {
"marginVertical": 5,
}
}
>
<SearchBarIos
autoCapitalize="none"
backgroundColor="transparent"
blurOnSubmit={true}
inputHeight={33}
inputStyle={
Object {
"backgroundColor": "rgba(170,170,170,0.2)",
"color": "#aaa",
"fontSize": 15,
}
}
onBlur={[Function]}
onCancelButtonPress={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
onSearchButtonPress={[Function]}
onSelectionChange={[Function]}
placeholderTextColor="rgba(170,170,170,0.5)"
tintColorDelete="rgba(170,170,170,0.5)"
tintColorSearch="rgba(170,170,170,0.5)"
titleCancelColor="#aaa"
value=""
/>
</Component>
<CustomList
createSections={[Function]}
data={
Array [
Object {
"display_name": "display_name",
"id": "id",
"name": "name",
},
]
}
listInitialSize={10}
listPageSize={10}
listScrollRenderAheadDistance={50}
loading={false}
loadingText={
Object {
"defaultMessage": "Loading Channels...",
"id": "mobile.loading_channels",
}
}
onListEndReached={[Function]}
onListEndReachedThreshold={50}
onRowPress={[Function]}
renderRow={[Function]}
searching={false}
selectable={false}
showNoResults={false}
showSections={false}
theme={
Object {
"centerChannelBg": "#aaa",
"centerChannelColor": "#aaa",
"sidebarHeaderBg": "#aaa",
"sidebarHeaderTextColor": "#aaa",
}
}
/>
</React.Fragment>,
],
},
"ref": null,
"rendered": Array [
]
}
listInitialSize={10}
listPageSize={10}
listScrollRenderAheadDistance={50}
loading={false}
loadingText={
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {},
"ref": null,
"rendered": null,
"type": [Function],
},
"defaultMessage": "Loading Channels...",
"id": "mobile.loading_channels",
}
}
onListEndReached={[Function]}
onListEndReachedThreshold={50}
onRowPress={[Function]}
renderRow={[Function]}
searching={false}
selectable={false}
showNoResults={false}
showSections={false}
theme={
Object {
"instance": null,
"key": undefined,
"nodeType": "function",
"props": Object {
"children": Array [
<Component
style={
Object {
"marginVertical": 5,
}
}
>
<SearchBarIos
autoCapitalize="none"
backgroundColor="transparent"
blurOnSubmit={true}
inputHeight={33}
inputStyle={
Object {
"backgroundColor": "rgba(170,170,170,0.2)",
"color": "#aaa",
"fontSize": 15,
}
}
onBlur={[Function]}
onCancelButtonPress={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
onSearchButtonPress={[Function]}
onSelectionChange={[Function]}
placeholderTextColor="rgba(170,170,170,0.5)"
tintColorDelete="rgba(170,170,170,0.5)"
tintColorSearch="rgba(170,170,170,0.5)"
titleCancelColor="#aaa"
value=""
/>
</Component>,
<CustomList
createSections={[Function]}
data={
Array [
Object {
"display_name": "display_name",
"id": "id",
"name": "name",
},
]
}
listInitialSize={10}
listPageSize={10}
listScrollRenderAheadDistance={50}
loading={false}
loadingText={
Object {
"defaultMessage": "Loading Channels...",
"id": "mobile.loading_channels",
}
}
onListEndReached={[Function]}
onListEndReachedThreshold={50}
onRowPress={[Function]}
renderRow={[Function]}
searching={false}
selectable={false}
showNoResults={false}
showSections={false}
theme={
Object {
"centerChannelBg": "#aaa",
"centerChannelColor": "#aaa",
"sidebarHeaderBg": "#aaa",
"sidebarHeaderTextColor": "#aaa",
}
}
/>,
],
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": <SearchBarIos
autoCapitalize="none"
backgroundColor="transparent"
blurOnSubmit={true}
inputHeight={33}
inputStyle={
Object {
"backgroundColor": "rgba(170,170,170,0.2)",
"color": "#aaa",
"fontSize": 15,
}
}
onBlur={[Function]}
onCancelButtonPress={[Function]}
onChangeText={[Function]}
onFocus={[Function]}
onSearchButtonPress={[Function]}
onSelectionChange={[Function]}
placeholderTextColor="rgba(170,170,170,0.5)"
tintColorDelete="rgba(170,170,170,0.5)"
tintColorSearch="rgba(170,170,170,0.5)"
titleCancelColor="#aaa"
value=""
/>,
"style": Object {
"marginVertical": 5,
},
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"autoCapitalize": "none",
"backgroundColor": "transparent",
"blurOnSubmit": true,
"cancelTitle": undefined,
"inputHeight": 33,
"inputStyle": Object {
"backgroundColor": "rgba(170,170,170,0.2)",
"color": "#aaa",
"fontSize": 15,
},
"onBlur": [Function],
"onCancelButtonPress": [Function],
"onChangeText": [Function],
"onFocus": [Function],
"onSearchButtonPress": [Function],
"onSelectionChange": [Function],
"placeholder": undefined,
"placeholderTextColor": "rgba(170,170,170,0.5)",
"tintColorDelete": "rgba(170,170,170,0.5)",
"tintColorSearch": "rgba(170,170,170,0.5)",
"titleCancelColor": "#aaa",
"value": "",
},
"ref": "search_bar",
"rendered": null,
"type": [Function],
},
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"createSections": [Function],
"data": Array [
Object {
"display_name": "display_name",
"id": "id",
"name": "name",
},
],
"listInitialSize": 10,
"listPageSize": 10,
"listScrollRenderAheadDistance": 50,
"loading": false,
"loadingText": Object {
"defaultMessage": "Loading Channels...",
"id": "mobile.loading_channels",
},
"onListEndReached": [Function],
"onListEndReachedThreshold": 50,
"onRowPress": [Function],
"renderRow": [Function],
"searching": false,
"selectable": false,
"showNoResults": false,
"showSections": false,
"theme": Object {
"centerChannelBg": "#aaa",
"centerChannelColor": "#aaa",
"sidebarHeaderBg": "#aaa",
"sidebarHeaderTextColor": "#aaa",
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": Symbol(react.fragment),
},
],
"type": [Function],
},
],
Symbol(enzyme.__options__): Object {
"adapter": ReactSixteenAdapter {
"options": Object {
"enableComponentDidUpdateOnSetState": true,
"lifecycles": Object {
"componentDidUpdate": Object {
"onSetState": true,
},
"getDerivedStateFromProps": true,
"getSnapshotBeforeUpdate": true,
"setState": Object {
"skipsComponentDidUpdateOnNullish": true,
},
},
},
},
"attachTo": undefined,
"context": Object {
"intl": Object {
"formatMessage": [MockFunction] {
"calls": Array [
Array [
Object {
"defaultMessage": "Create",
"id": "mobile.create_channel",
},
],
Array [
Object {
"defaultMessage": "Search",
"id": "search_bar.search",
},
],
Array [
Object {
"defaultMessage": "Cancel",
"id": "mobile.post.cancel",
},
],
],
"results": Array [
Object {
"isThrow": false,
"value": undefined,
},
Object {
"isThrow": false,
"value": undefined,
},
Object {
"isThrow": false,
"value": undefined,
},
],
},
},
},
"hydrateIn": undefined,
},
}
"centerChannelBg": "#aaa",
"centerChannelColor": "#aaa",
"sidebarHeaderBg": "#aaa",
"sidebarHeaderTextColor": "#aaa",
}
}
/>
</React.Fragment>
</Connect(KeyboardLayout)>
`;

View file

@ -48,7 +48,7 @@ describe('MoreChannels', () => {
{context: {intl: {formatMessage: jest.fn()}}},
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
test('should call props.navigator.dismissModal on close', () => {

View file

@ -31,13 +31,13 @@ describe('OptionModalList', () => {
const wrapper = shallow(
<OptionModalListIOS {...baseProps}/>,
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
test('should match snapshot for Android', async () => {
const wrapper = shallow(
<OptionModalListAndroid {...baseProps}/>,
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
});

View file

@ -1,153 +1,74 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`SelectTeam should match snapshot for fail of teams 1`] = `
ShallowWrapper {
Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <SelectTeam
actions={
Object {
"getTeams": [Function],
"handleTeamChange": [MockFunction],
"joinTeam": [MockFunction],
"logout": [MockFunction],
"markChannelAsRead": [MockFunction],
}
}
currentChannelId="someId"
currentUrl="test"
joinTeamRequest={Object {}}
navigator={
Object {
"setOnNavigatorEvent": [MockFunction] {
"calls": Array [
Array [
[Function],
],
],
"results": Array [
Object {
"isThrow": false,
"value": undefined,
},
],
},
}
}
teams={Array []}
teamsRequest={
Object {
"status": "failure",
}
}
theme={Object {}}
userWithoutTeams={false}
/>,
Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function],
"getNode": [Function],
"render": [Function],
"simulateError": [Function],
"simulateEvent": [Function],
"unmount": [Function],
},
Symbol(enzyme.__node__): Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"errorDescription": Object {
"defaultMessage": "Make sure you have an active connection and try again.",
"id": "mobile.failed_network_action.shortDescription",
},
"errorTitle": Object {
"defaultMessage": "Team Not Found",
"id": "error.team_not_found.title",
},
"onRetry": [Function],
"theme": Object {},
},
"ref": null,
"rendered": null,
"type": [Function],
},
Symbol(enzyme.__nodes__): Array [
<FailedNetworkAction
errorDescription={
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"errorDescription": Object {
"defaultMessage": "Make sure you have an active connection and try again.",
"id": "mobile.failed_network_action.shortDescription",
},
"errorTitle": Object {
"defaultMessage": "Team Not Found",
"id": "error.team_not_found.title",
},
"onRetry": [Function],
"theme": Object {},
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
Symbol(enzyme.__options__): Object {
"adapter": ReactSixteenAdapter {
"options": Object {
"enableComponentDidUpdateOnSetState": true,
"lifecycles": Object {
"componentDidUpdate": Object {
"onSetState": true,
},
"getDerivedStateFromProps": true,
"getSnapshotBeforeUpdate": true,
"setState": Object {
"skipsComponentDidUpdateOnNullish": true,
},
},
},
},
"attachTo": undefined,
"hydrateIn": undefined,
},
}
"defaultMessage": "Make sure you have an active connection and try again.",
"id": "mobile.failed_network_action.shortDescription",
}
}
errorTitle={
Object {
"defaultMessage": "Team Not Found",
"id": "error.team_not_found.title",
}
}
onRetry={[Function]}
theme={Object {}}
/>
`;
exports[`SelectTeam should match snapshot for teams 1`] = `
ShallowWrapper {
Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <SelectTeam
actions={
<Component
style={
Object {
"backgroundColor": undefined,
"flex": 1,
}
}
>
<Connect(StatusBar) />
<Component
style={
Object {
"getTeams": [Function],
"handleTeamChange": [MockFunction],
"joinTeam": [MockFunction],
"logout": [MockFunction],
"markChannelAsRead": [MockFunction],
"alignItems": "center",
"flexDirection": "row",
"marginHorizontal": 16,
"marginTop": 20,
}
}
currentChannelId="someId"
currentUrl="test"
joinTeamRequest={Object {}}
navigator={
Object {
"setOnNavigatorEvent": [MockFunction] {
"calls": Array [
Array [
[Function],
],
],
"results": Array [
Object {
"isThrow": false,
"value": undefined,
},
],
},
>
<Component
style={
Object {
"marginRight": 15,
}
}
}
teams={
>
<FormattedText
defaultMessage="Open teams you can join"
id="mobile.select_team.join_open"
style={
Object {
"color": undefined,
"fontSize": 13,
}
}
/>
</Component>
<Component
style={
Object {
"backgroundColor": undefined,
"height": 1,
"width": "100%",
}
}
/>
</Component>
<FlatList
data={
Array [
Object {
"id": "kemjcpu9bi877yegqjs18ndp4r",
@ -156,490 +77,23 @@ ShallowWrapper {
},
]
}
teamsRequest={
disableVirtualization={false}
horizontal={false}
initialNumToRender={10}
keyExtractor={[Function]}
maxToRenderPerBatch={10}
numColumns={1}
onEndReachedThreshold={2}
renderItem={[Function]}
scrollEventThrottle={50}
updateCellsBatchingPeriod={50}
viewabilityConfig={
Object {
"status": "success",
"viewAreaCoveragePercentThreshold": 3,
"waitForInteraction": false,
}
}
theme={Object {}}
userWithoutTeams={false}
/>,
Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function],
"getNode": [Function],
"render": [Function],
"simulateError": [Function],
"simulateEvent": [Function],
"unmount": [Function],
},
Symbol(enzyme.__node__): Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<Connect(StatusBar) />,
<Component
style={
Object {
"alignItems": "center",
"flexDirection": "row",
"marginHorizontal": 16,
"marginTop": 20,
}
}
>
<Component
style={
Object {
"marginRight": 15,
}
}
>
<FormattedText
defaultMessage="Open teams you can join"
id="mobile.select_team.join_open"
style={
Object {
"color": undefined,
"fontSize": 13,
}
}
/>
</Component>
<Component
style={
Object {
"backgroundColor": undefined,
"height": 1,
"width": "100%",
}
}
/>
</Component>,
<FlatList
data={
Array [
Object {
"id": "kemjcpu9bi877yegqjs18ndp4r",
"invite_id": "ojsnudhqzbfzpk6e4n6ip1hwae",
"name": "test",
},
]
}
disableVirtualization={false}
horizontal={false}
initialNumToRender={10}
keyExtractor={[Function]}
maxToRenderPerBatch={10}
numColumns={1}
onEndReachedThreshold={2}
renderItem={[Function]}
scrollEventThrottle={50}
updateCellsBatchingPeriod={50}
viewabilityConfig={
Object {
"viewAreaCoveragePercentThreshold": 3,
"waitForInteraction": false,
}
}
windowSize={21}
/>,
],
"style": Object {
"backgroundColor": undefined,
"flex": 1,
},
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {},
"ref": null,
"rendered": null,
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<Component
style={
Object {
"marginRight": 15,
}
}
>
<FormattedText
defaultMessage="Open teams you can join"
id="mobile.select_team.join_open"
style={
Object {
"color": undefined,
"fontSize": 13,
}
}
/>
</Component>,
<Component
style={
Object {
"backgroundColor": undefined,
"height": 1,
"width": "100%",
}
}
/>,
],
"style": Object {
"alignItems": "center",
"flexDirection": "row",
"marginHorizontal": 16,
"marginTop": 20,
},
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": <FormattedText
defaultMessage="Open teams you can join"
id="mobile.select_team.join_open"
style={
Object {
"color": undefined,
"fontSize": 13,
}
}
/>,
"style": Object {
"marginRight": 15,
},
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"defaultMessage": "Open teams you can join",
"id": "mobile.select_team.join_open",
"style": Object {
"color": undefined,
"fontSize": 13,
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"style": Object {
"backgroundColor": undefined,
"height": 1,
"width": "100%",
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"data": Array [
Object {
"id": "kemjcpu9bi877yegqjs18ndp4r",
"invite_id": "ojsnudhqzbfzpk6e4n6ip1hwae",
"name": "test",
},
],
"disableVirtualization": false,
"horizontal": false,
"initialNumToRender": 10,
"keyExtractor": [Function],
"maxToRenderPerBatch": 10,
"numColumns": 1,
"onEndReachedThreshold": 2,
"renderItem": [Function],
"scrollEventThrottle": 50,
"updateCellsBatchingPeriod": 50,
"viewabilityConfig": Object {
"viewAreaCoveragePercentThreshold": 3,
"waitForInteraction": false,
},
"windowSize": 21,
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": [Function],
},
Symbol(enzyme.__nodes__): Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<Connect(StatusBar) />,
<Component
style={
Object {
"alignItems": "center",
"flexDirection": "row",
"marginHorizontal": 16,
"marginTop": 20,
}
}
>
<Component
style={
Object {
"marginRight": 15,
}
}
>
<FormattedText
defaultMessage="Open teams you can join"
id="mobile.select_team.join_open"
style={
Object {
"color": undefined,
"fontSize": 13,
}
}
/>
</Component>
<Component
style={
Object {
"backgroundColor": undefined,
"height": 1,
"width": "100%",
}
}
/>
</Component>,
<FlatList
data={
Array [
Object {
"id": "kemjcpu9bi877yegqjs18ndp4r",
"invite_id": "ojsnudhqzbfzpk6e4n6ip1hwae",
"name": "test",
},
]
}
disableVirtualization={false}
horizontal={false}
initialNumToRender={10}
keyExtractor={[Function]}
maxToRenderPerBatch={10}
numColumns={1}
onEndReachedThreshold={2}
renderItem={[Function]}
scrollEventThrottle={50}
updateCellsBatchingPeriod={50}
viewabilityConfig={
Object {
"viewAreaCoveragePercentThreshold": 3,
"waitForInteraction": false,
}
}
windowSize={21}
/>,
],
"style": Object {
"backgroundColor": undefined,
"flex": 1,
},
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {},
"ref": null,
"rendered": null,
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<Component
style={
Object {
"marginRight": 15,
}
}
>
<FormattedText
defaultMessage="Open teams you can join"
id="mobile.select_team.join_open"
style={
Object {
"color": undefined,
"fontSize": 13,
}
}
/>
</Component>,
<Component
style={
Object {
"backgroundColor": undefined,
"height": 1,
"width": "100%",
}
}
/>,
],
"style": Object {
"alignItems": "center",
"flexDirection": "row",
"marginHorizontal": 16,
"marginTop": 20,
},
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": <FormattedText
defaultMessage="Open teams you can join"
id="mobile.select_team.join_open"
style={
Object {
"color": undefined,
"fontSize": 13,
}
}
/>,
"style": Object {
"marginRight": 15,
},
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"defaultMessage": "Open teams you can join",
"id": "mobile.select_team.join_open",
"style": Object {
"color": undefined,
"fontSize": 13,
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"style": Object {
"backgroundColor": undefined,
"height": 1,
"width": "100%",
},
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"data": Array [
Object {
"id": "kemjcpu9bi877yegqjs18ndp4r",
"invite_id": "ojsnudhqzbfzpk6e4n6ip1hwae",
"name": "test",
},
],
"disableVirtualization": false,
"horizontal": false,
"initialNumToRender": 10,
"keyExtractor": [Function],
"maxToRenderPerBatch": 10,
"numColumns": 1,
"onEndReachedThreshold": 2,
"renderItem": [Function],
"scrollEventThrottle": 50,
"updateCellsBatchingPeriod": 50,
"viewabilityConfig": Object {
"viewAreaCoveragePercentThreshold": 3,
"waitForInteraction": false,
},
"windowSize": 21,
},
"ref": null,
"rendered": null,
"type": [Function],
},
],
"type": [Function],
},
],
Symbol(enzyme.__options__): Object {
"adapter": ReactSixteenAdapter {
"options": Object {
"enableComponentDidUpdateOnSetState": true,
"lifecycles": Object {
"componentDidUpdate": Object {
"onSetState": true,
},
"getDerivedStateFromProps": true,
"getSnapshotBeforeUpdate": true,
"setState": Object {
"skipsComponentDidUpdateOnNullish": true,
},
},
},
},
"attachTo": undefined,
"hydrateIn": undefined,
},
}
windowSize={21}
/>
</Component>
`;

View file

@ -54,7 +54,7 @@ describe('SelectTeam', () => {
await getTeams();
expect(wrapper.state('loading')).toEqual(false);
wrapper.update();
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
test('should match snapshot for teams', async () => {
@ -75,6 +75,6 @@ describe('SelectTeam', () => {
);
await getTeams();
wrapper.update();
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
});

View file

@ -50,6 +50,6 @@ describe('user_profile', () => {
<UserProfile {...baseProps}/>,
{context: {intl: {formatMessage: jest.fn()}}},
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getElement()).toMatchSnapshot();
});
});