This repository has been archived by the owner on May 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(ErrorLogger): add snapshot and configure jest mock
Signed-off-by: Diana Lease <[email protected]>
- Loading branch information
1 parent
905975b
commit bd5ef1a
Showing
5 changed files
with
199 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<ErrorLogger /> on initialization renders page correctly 1`] = ` | ||
<ReactTable | ||
AggregatedComponent={[Function]} | ||
ExpanderComponent={[Function]} | ||
FilterComponent={[Function]} | ||
LoadingComponent={[Function]} | ||
NoDataComponent={[Function]} | ||
PadRowComponent={[Function]} | ||
PaginationComponent={[Function]} | ||
PivotValueComponent={[Function]} | ||
ResizerComponent={[Function]} | ||
TableComponent={[Function]} | ||
TbodyComponent={[Function]} | ||
TdComponent={[Function]} | ||
TfootComponent={[Function]} | ||
ThComponent={[Function]} | ||
TheadComponent={[Function]} | ||
TrComponent={[Function]} | ||
TrGroupComponent={[Function]} | ||
aggregatedKey="_aggregated" | ||
className="" | ||
collapseOnDataChange={true} | ||
collapseOnPageChange={true} | ||
collapseOnSortingChange={true} | ||
column={ | ||
Object { | ||
"Aggregated": undefined, | ||
"Cell": undefined, | ||
"Expander": undefined, | ||
"Filter": undefined, | ||
"Footer": undefined, | ||
"Header": undefined, | ||
"Pivot": undefined, | ||
"PivotValue": undefined, | ||
"Placeholder": undefined, | ||
"aggregate": undefined, | ||
"className": "", | ||
"filterAll": false, | ||
"filterMethod": undefined, | ||
"filterable": undefined, | ||
"footerClassName": "", | ||
"footerStyle": Object {}, | ||
"getFooterProps": [Function], | ||
"getHeaderProps": [Function], | ||
"getProps": [Function], | ||
"headerClassName": "", | ||
"headerStyle": Object {}, | ||
"minResizeWidth": 11, | ||
"minWidth": 100, | ||
"resizable": undefined, | ||
"show": true, | ||
"sortMethod": undefined, | ||
"sortable": undefined, | ||
"style": Object {}, | ||
} | ||
} | ||
columns={ | ||
Array [ | ||
Object { | ||
"Header": "Type", | ||
"accessor": "type", | ||
"width": 100, | ||
}, | ||
Object { | ||
"Header": "Name", | ||
"accessor": "name", | ||
"width": 200, | ||
}, | ||
Object { | ||
"Header": "File", | ||
"accessor": "fileName", | ||
"width": 100, | ||
}, | ||
Object { | ||
"Header": "Start Location", | ||
"accessor": [Function], | ||
"id": "startLocation", | ||
"width": 100, | ||
}, | ||
Object { | ||
"Header": "End Location", | ||
"accessor": [Function], | ||
"id": "endLocation", | ||
"width": 100, | ||
}, | ||
Object { | ||
"Header": "Message", | ||
"accessor": "shortMessage", | ||
"width": 600, | ||
}, | ||
] | ||
} | ||
data={Array []} | ||
defaultExpanded={Object {}} | ||
defaultFilterMethod={[Function]} | ||
defaultFiltered={Array []} | ||
defaultPage={0} | ||
defaultPageSize={20} | ||
defaultResized={Array []} | ||
defaultSortDesc={false} | ||
defaultSortMethod={[Function]} | ||
defaultSorted={Array []} | ||
expanderDefaults={ | ||
Object { | ||
"filterable": false, | ||
"resizable": false, | ||
"sortable": false, | ||
"width": 35, | ||
} | ||
} | ||
filterable={false} | ||
freezeWhenExpanded={false} | ||
getLoadingProps={[Function]} | ||
getNoDataProps={[Function]} | ||
getPaginationProps={[Function]} | ||
getProps={[Function]} | ||
getResizerProps={[Function]} | ||
getTableProps={[Function]} | ||
getTbodyProps={[Function]} | ||
getTdProps={[Function]} | ||
getTfootProps={[Function]} | ||
getTfootTdProps={[Function]} | ||
getTfootTrProps={[Function]} | ||
getTheadFilterProps={[Function]} | ||
getTheadFilterThProps={[Function]} | ||
getTheadFilterTrProps={[Function]} | ||
getTheadGroupProps={[Function]} | ||
getTheadGroupThProps={[Function]} | ||
getTheadGroupTrProps={[Function]} | ||
getTheadProps={[Function]} | ||
getTheadThProps={[Function]} | ||
getTheadTrProps={[Function]} | ||
getTrGroupProps={[Function]} | ||
getTrProps={[Function]} | ||
groupedByPivotKey="_groupedByPivot" | ||
indexKey="_index" | ||
loading={false} | ||
loadingText="Loading..." | ||
multiSort={true} | ||
nestingLevelKey="_nestingLevel" | ||
nextText="Next" | ||
noDataText="No rows found" | ||
ofText="of" | ||
onFetchData={[Function]} | ||
originalKey="_original" | ||
pageJumpText="jump to page" | ||
pageSize={5} | ||
pageSizeOptions={ | ||
Array [ | ||
5, | ||
10, | ||
20, | ||
25, | ||
50, | ||
100, | ||
] | ||
} | ||
pageText="Page" | ||
pivotDefaults={Object {}} | ||
pivotIDKey="_pivotID" | ||
pivotValKey="_pivotVal" | ||
previousText="Previous" | ||
resizable={true} | ||
resolveData={[Function]} | ||
rowsSelectorText="rows per page" | ||
rowsText="rows" | ||
showPageJump={true} | ||
showPageSizeOptions={true} | ||
showPagination={true} | ||
showPaginationBottom={true} | ||
showPaginationTop={false} | ||
sortable={true} | ||
style={Object {}} | ||
subRowsKey="_subRows" | ||
/> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import toJson from 'enzyme-to-json'; | ||
|
||
import ErrorLogger from './index'; | ||
|
||
describe('<ErrorLogger />', () => { | ||
describe('on initialization', () => { | ||
it('renders page correctly', () => { | ||
const component = shallow(<ErrorLogger />); | ||
const tree = toJson(component); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); | ||
}); |