X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/1c1a44191e11b62a0640551ea73f2281b2ed9a7f..d7a29f892371764b1bff2e6ec64f8011c001b725:/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 11296ce5..d26d768a 100644 --- a/src/store/data-explorer/data-explorer-reducer.test.tsx +++ b/src/store/data-explorer/data-explorer-reducer.test.tsx @@ -12,9 +12,11 @@ describe('data-explorer-reducer', () => { it('should set columns', () => { const columns: DataColumns = [{ name: "Column 1", + filters: [], render: jest.fn(), selected: true, - configurable: false + configurable: true, + sortDirection: SortDirection.NONE }]; const state = dataExplorerReducer(undefined, dataExplorerActions.SET_COLUMNS({ id: "Data explorer", columns })); @@ -24,16 +26,18 @@ describe('data-explorer-reducer', () => { it('should toggle sorting', () => { const columns: DataColumns = [{ name: "Column 1", + filters: [], render: jest.fn(), selected: true, sortDirection: SortDirection.ASC, - configurable: false + configurable: true }, { name: "Column 2", + filters: [], render: jest.fn(), selected: true, + configurable: true, sortDirection: SortDirection.NONE, - configurable: false }]; const state = dataExplorerReducer({ "Data explorer": { ...initialDataExplorer, columns } }, dataExplorerActions.TOGGLE_SORT({ id: "Data explorer", columnName: "Column 2" })); @@ -44,9 +48,11 @@ describe('data-explorer-reducer', () => { it('should set filters', () => { const columns: DataColumns = [{ name: "Column 1", + filters: [], render: jest.fn(), selected: true, - configurable: false + configurable: true, + sortDirection: SortDirection.NONE }]; const filters: DataTableFilterItem[] = [{ @@ -59,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"], @@ -71,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); });