X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b62944772ff96019c1e497426784690978bb9c96..6a9ed65ed717080ce933718436038b5c4dec2a74:/src/store/data-explorer/data-explorer-reducer.test.tsx diff --git a/src/store/data-explorer/data-explorer-reducer.test.tsx b/src/store/data-explorer/data-explorer-reducer.test.tsx index c54a86af4a..d26d768a0e 100644 --- a/src/store/data-explorer/data-explorer-reducer.test.tsx +++ b/src/store/data-explorer/data-explorer-reducer.test.tsx @@ -12,8 +12,11 @@ describe('data-explorer-reducer', () => { it('should set columns', () => { const columns: DataColumns = [{ name: "Column 1", + filters: [], render: jest.fn(), - selected: true + selected: true, + configurable: true, + sortDirection: SortDirection.NONE }]; const state = dataExplorerReducer(undefined, dataExplorerActions.SET_COLUMNS({ id: "Data explorer", columns })); @@ -23,13 +26,17 @@ describe('data-explorer-reducer', () => { it('should toggle sorting', () => { const columns: DataColumns = [{ name: "Column 1", + filters: [], render: jest.fn(), selected: true, - sortDirection: SortDirection.ASC + sortDirection: SortDirection.ASC, + configurable: true }, { name: "Column 2", + filters: [], render: jest.fn(), selected: true, + configurable: true, sortDirection: SortDirection.NONE, }]; const state = dataExplorerReducer({ "Data explorer": { ...initialDataExplorer, columns } }, @@ -41,8 +48,11 @@ describe('data-explorer-reducer', () => { it('should set filters', () => { const columns: DataColumns = [{ name: "Column 1", + filters: [], render: jest.fn(), selected: true, + configurable: true, + sortDirection: SortDirection.NONE }]; const filters: DataTableFilterItem[] = [{ @@ -55,7 +65,7 @@ describe('data-explorer-reducer', () => { }); it('should set items', () => { - const state = dataExplorerReducer({ "Data explorer": undefined }, + const state = dataExplorerReducer({}, dataExplorerActions.SET_ITEMS({ id: "Data explorer", items: ["Item 1", "Item 2"], @@ -67,13 +77,13 @@ describe('data-explorer-reducer', () => { }); it('should set page', () => { - const state = dataExplorerReducer({ "Data explorer": undefined }, + const state = dataExplorerReducer({}, dataExplorerActions.SET_PAGE({ id: "Data explorer", page: 2 })); expect(state["Data explorer"].page).toEqual(2); }); it('should set rows per page', () => { - const state = dataExplorerReducer({ "Data explorer": undefined }, + const state = dataExplorerReducer({}, dataExplorerActions.SET_ROWS_PER_PAGE({ id: "Data explorer", rowsPerPage: 5 })); expect(state["Data explorer"].rowsPerPage).toEqual(5); });