X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/ac0992ffca196679a7121fab27e43c38bc25072f..f470b41502497ccc4b37872cc921d71e57a37986:/src/store/data-explorer/data-explorer-middleware.test.ts diff --git a/src/store/data-explorer/data-explorer-middleware.test.ts b/src/store/data-explorer/data-explorer-middleware.test.ts index 00931bf8..17edba52 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); }); @@ -64,7 +64,7 @@ describe("DataExplorerMiddleware", () => { const next = jest.fn(); const middleware = dataExplorerMiddleware(service)(api)(next); middleware(dataExplorerActions.REQUEST_ITEMS({ id: "ServiceId" })); - expect(config.requestItems).toHaveBeenCalled(); + expect(api.dispatch).toHaveBeenCalledTimes(1); }); it("handles SET_PAGE action", () => { @@ -202,7 +202,7 @@ class ServiceMock extends DataExplorerMiddlewareService { constructor(private config: { id: string, columns: DataColumns, - requestItems: (api: MiddlewareAPI) => void + requestItems: (api: MiddlewareAPI) => Promise }) { super(config.id); } @@ -211,7 +211,8 @@ class ServiceMock extends DataExplorerMiddlewareService { return this.config.columns; } - requestItems(api: MiddlewareAPI) { + requestItems(api: MiddlewareAPI): Promise { this.config.requestItems(api); + return Promise.resolve(); } }