Skip to content

Commit

Permalink
chore: update unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
leangseu-edx committed Jun 28, 2022
1 parent d3d8797 commit 61c73b5
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 74 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`OverrideTable Component snapshots basic snapshot shows a row for each entry and one editable row 1`] = `
<Component
<DataTable
columns={
Array [
Object {
Expand Down Expand Up @@ -59,5 +59,6 @@ exports[`OverrideTable Component snapshots basic snapshot shows a row for each e
},
]
}
itemCount={2}
/>
`;
2 changes: 1 addition & 1 deletion src/components/GradesView/EditModal/OverrideTable/test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
mapStateToProps,
} from '.';

jest.mock('@edx/paragon', () => ({ Table: () => 'Table' }));
jest.mock('@edx/paragon', () => ({ DataTable: () => 'DataTable' }));
jest.mock('./ReasonInput', () => 'ReasonInput');
jest.mock('./AdjustedGradeInput', () => 'AdjustedGradeInput');

Expand Down
111 changes: 39 additions & 72 deletions src/components/GradesView/GradebookTable/__snapshots__/test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,78 +4,45 @@ exports[`GradebookTable component snapshot - fields1 and 2 between email and tot
<div
className="gradebook-container"
>
<div
className="gbook"
>
<DataTable
EmptyTableComponent={[Function]}
FilterStatusComponent={[Function]}
RowStatusComponent={[Function]}
SelectionStatusComponent={[Function]}
additionalColumns={Array []}
bulkActions={Array []}
columns={
Array [
Object {
"Header": <UsernameLabelReplacement />,
"accessor": "Username",
},
Object {
"Header": <FormattedMessage
defaultMessage="Email"
description="Gradebook table email column header"
id="gradebook.GradesView.table.headings.email"
/>,
"accessor": "Email",
},
Object {
"Header": "field1",
"accessor": "field1",
},
Object {
"Header": "field2",
"accessor": "field2",
},
Object {
"Header": <TotalGradeLabelReplacement />,
"accessor": "Total Grade (%)",
},
]
}
data={
Array [
"mappedRow: 1",
"mappedRow: 2",
"mappedRow: 3",
]
}
dataViewToggleOptions={
<DataTable
columns={
Array [
Object {
"defaultActiveStateValue": "card",
"isDataViewToggleEnabled": false,
"onDataViewToggle": [Function],
"togglePlacement": "left",
}
}
defaultColumnValues={Object {}}
fetchData={null}
hasFixedColumnWidths={true}
initialState={Object {}}
initialTableOptions={Object {}}
isExpandable={false}
isFilterable={false}
isLoading={false}
isPaginated={false}
isSelectable={false}
isSortable={false}
manualFilters={false}
manualPagination={false}
manualSortBy={false}
numBreakoutFilters={1}
rowHeaderColumnKey="username"
showFiltersInSidebar={false}
tableActions={Array []}
/>
</div>
"Header": <UsernameLabelReplacement />,
"accessor": "Username",
},
Object {
"Header": <FormattedMessage
defaultMessage="Email"
description="Gradebook table email column header"
id="gradebook.GradesView.table.headings.email"
/>,
"accessor": "Email",
},
Object {
"Header": "field1",
"accessor": "field1",
},
Object {
"Header": "field2",
"accessor": "field2",
},
Object {
"Header": <TotalGradeLabelReplacement />,
"accessor": "Total Grade (%)",
},
]
}
data={
Array [
"mappedRow: 1",
"mappedRow: 2",
"mappedRow: 3",
]
}
hasFixedColumnWidths={true}
itemCount={3}
rowHeaderColumnKey="username"
/>
</div>
`;
1 change: 1 addition & 0 deletions src/components/GradesView/GradebookTable/test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Fields from './Fields';
import messages from './messages';
import { GradebookTable, mapStateToProps } from '.';

jest.mock('@edx/paragon', () => ({ DataTable: () => 'DataTable' }));
jest.mock('./Fields', () => ({
__esModule: true,
default: {
Expand Down

0 comments on commit 61c73b5

Please sign in to comment.