[arvados-workbench2] updated: 2.5.0-66-gea39c941
git repository hosting
git at public.arvados.org
Wed Feb 22 22:36:06 UTC 2023
Summary of changes:
src/components/data-table/data-table.test.tsx | 20 +++++++++-----------
.../data-explorer/data-explorer-reducer.test.tsx | 18 +++++++++---------
2 files changed, 18 insertions(+), 20 deletions(-)
via ea39c941f858898a9c701c818daee2b53714d19d (commit)
from 1d402d5f65011e082eb9332118c4dbfe4377952f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit ea39c941f858898a9c701c818daee2b53714d19d
Author: Stephen Smith <stephen at curii.com>
Date: Wed Feb 22 17:35:56 2023 -0500
19988: Update unit tests
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>
diff --git a/src/components/data-table/data-table.test.tsx b/src/components/data-table/data-table.test.tsx
index 866564ac..a72056d1 100644
--- a/src/components/data-table/data-table.test.tsx
+++ b/src/components/data-table/data-table.test.tsx
@@ -17,7 +17,7 @@ configure({ adapter: new Adapter() });
describe("<DataTable />", () => {
it("shows only selected columns", () => {
- const columns: DataColumns<string> = [
+ const columns: DataColumns<string, string> = [
createDataColumn({
name: "Column 1",
render: () => <span />,
@@ -49,7 +49,7 @@ describe("<DataTable />", () => {
});
it("renders column name", () => {
- const columns: DataColumns<string> = [
+ const columns: DataColumns<string, string> = [
createDataColumn({
name: "Column 1",
render: () => <span />,
@@ -69,7 +69,7 @@ describe("<DataTable />", () => {
});
it("uses renderHeader instead of name prop", () => {
- const columns: DataColumns<string> = [
+ const columns: DataColumns<string, string> = [
createDataColumn({
name: "Column 1",
renderHeader: () => <span>Column Header</span>,
@@ -90,7 +90,7 @@ describe("<DataTable />", () => {
});
it("passes column key prop to corresponding cells", () => {
- const columns: DataColumns<string> = [
+ const columns: DataColumns<string, string> = [
createDataColumn({
name: "Column 1",
key: "column-1-key",
@@ -113,7 +113,7 @@ describe("<DataTable />", () => {
});
it("renders items", () => {
- const columns: DataColumns<string> = [
+ const columns: DataColumns<string, string> = [
createDataColumn({
name: "Column 1",
render: (item) => <Typography>{item}</Typography>,
@@ -141,10 +141,10 @@ describe("<DataTable />", () => {
});
it("passes sorting props to <TableSortLabel />", () => {
- const columns: DataColumns<string> = [
+ const columns: DataColumns<string, string> = [
createDataColumn({
name: "Column 1",
- sortDirection: SortDirection.ASC,
+ sort: {direction: SortDirection.ASC, field: "length"},
selected: true,
configurable: true,
render: (item) => <Typography>{item}</Typography>
@@ -164,9 +164,8 @@ describe("<DataTable />", () => {
});
it("does not display <DataTableFiltersPopover /> if there is no filters provided", () => {
- const columns: DataColumns<string> = [{
+ const columns: DataColumns<string, string> = [{
name: "Column 1",
- sortDirection: SortDirection.ASC,
selected: true,
configurable: true,
filters: [],
@@ -189,9 +188,8 @@ describe("<DataTable />", () => {
() => createTree<DataTableFilterItem>(),
setNode(initTreeNode({ id: 'filter', value: { name: 'filter' } }))
);
- const columns: DataColumns<string> = [{
+ const columns: DataColumns<string, string> = [{
name: "Column 1",
- sortDirection: SortDirection.ASC,
selected: true,
configurable: true,
filters: filters(),
diff --git a/src/store/data-explorer/data-explorer-reducer.test.tsx b/src/store/data-explorer/data-explorer-reducer.test.tsx
index d26d768a..01aa7296 100644
--- a/src/store/data-explorer/data-explorer-reducer.test.tsx
+++ b/src/store/data-explorer/data-explorer-reducer.test.tsx
@@ -10,13 +10,13 @@ import { SortDirection } from "../../components/data-table/data-column";
describe('data-explorer-reducer', () => {
it('should set columns', () => {
- const columns: DataColumns<any> = [{
+ const columns: DataColumns<any, any> = [{
name: "Column 1",
filters: [],
render: jest.fn(),
selected: true,
configurable: true,
- sortDirection: SortDirection.NONE
+ sort: {direction: SortDirection.NONE, field: "name"}
}];
const state = dataExplorerReducer(undefined,
dataExplorerActions.SET_COLUMNS({ id: "Data explorer", columns }));
@@ -24,12 +24,12 @@ describe('data-explorer-reducer', () => {
});
it('should toggle sorting', () => {
- const columns: DataColumns<any> = [{
+ const columns: DataColumns<any, any> = [{
name: "Column 1",
filters: [],
render: jest.fn(),
selected: true,
- sortDirection: SortDirection.ASC,
+ sort: {direction: SortDirection.ASC, field: "name"},
configurable: true
}, {
name: "Column 2",
@@ -37,22 +37,22 @@ describe('data-explorer-reducer', () => {
render: jest.fn(),
selected: true,
configurable: true,
- sortDirection: SortDirection.NONE,
+ sort: {direction: SortDirection.NONE, field: "name"},
}];
const state = dataExplorerReducer({ "Data explorer": { ...initialDataExplorer, columns } },
dataExplorerActions.TOGGLE_SORT({ id: "Data explorer", columnName: "Column 2" }));
- expect(state["Data explorer"].columns[0].sortDirection).toEqual("none");
- expect(state["Data explorer"].columns[1].sortDirection).toEqual("asc");
+ expect(state["Data explorer"].columns[0].sort.direction).toEqual("none");
+ expect(state["Data explorer"].columns[1].sort.direction).toEqual("asc");
});
it('should set filters', () => {
- const columns: DataColumns<any> = [{
+ const columns: DataColumns<any, any> = [{
name: "Column 1",
filters: [],
render: jest.fn(),
selected: true,
configurable: true,
- sortDirection: SortDirection.NONE
+ sort: {direction: SortDirection.NONE, field: "name"}
}];
const filters: DataTableFilterItem[] = [{
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list