Updated getNonOrphanVisits action so that it expects a signle DTO param

This commit is contained in:
Alejandro Celaya
2022-11-12 09:21:23 +01:00
parent 3b96b89492
commit b9efdd69f1
3 changed files with 8 additions and 10 deletions

View File

@@ -147,7 +147,7 @@ describe('nonOrphanVisitsReducer', () => {
it('dispatches start and error when promise is rejected', async () => {
const ShlinkApiClient = buildApiClientMock(Promise.reject({}));
await getNonOrphanVisits(() => ShlinkApiClient)()(dispatchMock, getState);
await getNonOrphanVisits(() => ShlinkApiClient)({})(dispatchMock, getState);
expect(dispatchMock).toHaveBeenCalledTimes(2);
expect(dispatchMock).toHaveBeenNthCalledWith(1, { type: GET_NON_ORPHAN_VISITS_START });
@@ -169,7 +169,7 @@ describe('nonOrphanVisitsReducer', () => {
},
}));
await getNonOrphanVisits(() => ShlinkApiClient)(query)(dispatchMock, getState);
await getNonOrphanVisits(() => ShlinkApiClient)({ query })(dispatchMock, getState);
expect(dispatchMock).toHaveBeenCalledTimes(2);
expect(dispatchMock).toHaveBeenNthCalledWith(1, { type: GET_NON_ORPHAN_VISITS_START });
@@ -201,7 +201,7 @@ describe('nonOrphanVisitsReducer', () => {
.mockResolvedValueOnce(buildVisitsResult(lastVisits));
const ShlinkApiClient = Mock.of<ShlinkApiClient>({ getNonOrphanVisits: getShlinkOrphanVisits });
await getNonOrphanVisits(() => ShlinkApiClient)({}, true)(dispatchMock, getState);
await getNonOrphanVisits(() => ShlinkApiClient)({ doIntervalFallback: true })(dispatchMock, getState);
expect(dispatchMock).toHaveBeenCalledTimes(2);
expect(dispatchMock).toHaveBeenNthCalledWith(1, { type: GET_NON_ORPHAN_VISITS_START });