From: Daniel Kos Date: Wed, 2 Jan 2019 08:28:10 +0000 (+0100) Subject: Fix test passing X-Git-Tag: 1.4.0~70 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/fe477581df706f4c2c1669f2df584bd94dbb4bea Fix test passing No issue # Arvados-DCO-1.1-Signed-off-by: Daniel Kos --- diff --git a/src/components/data-explorer/data-explorer.test.tsx b/src/components/data-explorer/data-explorer.test.tsx index d74b5319..1d8738ab 100644 --- a/src/components/data-explorer/data-explorer.test.tsx +++ b/src/components/data-explorer/data-explorer.test.tsx @@ -8,11 +8,10 @@ import * as Adapter from 'enzyme-adapter-react-16'; import { DataExplorer } from "./data-explorer"; import { ColumnSelector } from "../column-selector/column-selector"; -import { DataTable } from "../data-table/data-table"; +import { DataTable, DataTableFetchMode } from "../data-table/data-table"; import { SearchInput } from "../search-input/search-input"; import { TablePagination } from "@material-ui/core"; import { ProjectIcon } from '../icon/icon'; -import { DefaultView } from '../default-view/default-view'; import { SortDirection } from '../data-table/data-column'; configure({ adapter: new Adapter() }); @@ -36,7 +35,7 @@ describe("", () => { it("communicates with ", () => { const onColumnToggle = jest.fn(); const onSetColumns = jest.fn(); - const columns = [{ name: "Column 1", render: jest.fn(), selected: true, configurable: true, sortDirection: SortDirection.ASC, filters: [] }]; + const columns = [{ name: "Column 1", render: jest.fn(), selected: true, configurable: true, sortDirection: SortDirection.ASC, filters: {} }]; const dataExplorer = mount(", () => { const onSortToggle = jest.fn(); const onRowClick = jest.fn(); const onSetColumns = jest.fn(); - const columns = [{ name: "Column 1", render: jest.fn(), selected: true, configurable: true, sortDirection: SortDirection.ASC, filters: [] }]; + const columns = [{ name: "Column 1", render: jest.fn(), selected: true, configurable: true, sortDirection: SortDirection.ASC, filters: {} }]; const items = [{ name: "item 1" }]; const dataExplorer = mount(", () => { }); const mockDataExplorerProps = () => ({ + fetchMode: DataTableFetchMode.PAGINATED, columns: [], items: [], itemsAvailable: 0, @@ -114,6 +114,7 @@ const mockDataExplorerProps = () => ({ onContextMenu: jest.fn(), defaultIcon: ProjectIcon, onSetColumns: jest.fn(), + onLoadMore: jest.fn(), defaultMessages: ['testing'], contextMenuColumn: true }); diff --git a/src/store/data-explorer/data-explorer-middleware.test.ts b/src/store/data-explorer/data-explorer-middleware.test.ts index 00931bf8..5d729ce2 100644 --- a/src/store/data-explorer/data-explorer-middleware.test.ts +++ b/src/store/data-explorer/data-explorer-middleware.test.ts @@ -38,7 +38,7 @@ describe("DataExplorerMiddleware", () => { middleware(dataExplorerActions.SET_PAGE({ id: "OtherId", page: 0 })); middleware(dataExplorerActions.SET_PAGE({ id: "ServiceId", page: 0 })); middleware(dataExplorerActions.SET_PAGE({ id: "OtherId", page: 0 })); - expect(api.dispatch).toHaveBeenCalledWith(dataExplorerActions.REQUEST_ITEMS({ id: "ServiceId" })); + expect(api.dispatch).toHaveBeenCalledWith(dataExplorerActions.REQUEST_ITEMS({ id: "ServiceId", criteriaChanged: false })); expect(api.dispatch).toHaveBeenCalledTimes(1); });