From 54407af9802fc0490ba52dc86a24aaf607c92bc6 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 5 Nov 2022 10:49:28 +0100 Subject: [PATCH] Fixed tests --- src/domains/reducers/domainsList.ts | 2 +- src/mercure/reducers/mercureInfo.ts | 2 +- test/servers/reducers/selectedServer.test.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/domains/reducers/domainsList.ts b/src/domains/reducers/domainsList.ts index 80f7bf06..77b8fe72 100644 --- a/src/domains/reducers/domainsList.ts +++ b/src/domains/reducers/domainsList.ts @@ -49,7 +49,7 @@ export const domainsListReducerCreator = ( buildShlinkApiClient: ShlinkApiClientBuilder, editDomainRedirects: AsyncThunk, ) => { - const listDomains = createAsyncThunk(LIST_DOMAINS, async (_, { getState }): Promise => { + const listDomains = createAsyncThunk(LIST_DOMAINS, async (_: void, { getState }): Promise => { const { listDomains: shlinkListDomains } = buildShlinkApiClient(getState); const { data, defaultRedirects } = await shlinkListDomains(); diff --git a/src/mercure/reducers/mercureInfo.ts b/src/mercure/reducers/mercureInfo.ts index 6104b232..75806cde 100644 --- a/src/mercure/reducers/mercureInfo.ts +++ b/src/mercure/reducers/mercureInfo.ts @@ -17,7 +17,7 @@ const initialState: MercureInfo = { }; export const mercureInfoReducerCreator = (buildShlinkApiClient: ShlinkApiClientBuilder) => { - const loadMercureInfo = createAsyncThunk(GET_MERCURE_INFO, async (_, { getState }): Promise => { + const loadMercureInfo = createAsyncThunk(GET_MERCURE_INFO, (_: void, { getState }): Promise => { const { settings } = getState(); if (!settings.realTimeUpdates.enabled) { throw new Error('Real time updates not enabled'); diff --git a/test/servers/reducers/selectedServer.test.ts b/test/servers/reducers/selectedServer.test.ts index 28c443ae..f04a4eed 100644 --- a/test/servers/reducers/selectedServer.test.ts +++ b/test/servers/reducers/selectedServer.test.ts @@ -63,7 +63,7 @@ describe('selectedServerReducer', () => { expect(dispatch).toHaveBeenCalledTimes(3); expect(dispatch).toHaveBeenNthCalledWith(1, { type: RESET_SELECTED_SERVER }); - expect(dispatch).toHaveBeenNthCalledWith(2, { type: SELECT_SERVER, selectedServer: expectedSelectedServer }); + expect(dispatch).toHaveBeenNthCalledWith(2, { type: SELECT_SERVER, payload: expectedSelectedServer }); expect(loadMercureInfo).toHaveBeenCalledTimes(1); }); @@ -87,7 +87,7 @@ describe('selectedServerReducer', () => { await selectServer(buildApiClient, loadMercureInfo)(id)(dispatch, getState); expect(apiClientMock.health).toHaveBeenCalled(); - expect(dispatch).toHaveBeenNthCalledWith(2, { type: SELECT_SERVER, selectedServer: expectedSelectedServer }); + expect(dispatch).toHaveBeenNthCalledWith(2, { type: SELECT_SERVER, payload: expectedSelectedServer }); expect(loadMercureInfo).not.toHaveBeenCalled(); }); @@ -100,7 +100,7 @@ describe('selectedServerReducer', () => { expect(getState).toHaveBeenCalled(); expect(apiClientMock.health).not.toHaveBeenCalled(); - expect(dispatch).toHaveBeenNthCalledWith(2, { type: SELECT_SERVER, selectedServer: expectedSelectedServer }); + expect(dispatch).toHaveBeenNthCalledWith(2, { type: SELECT_SERVER, payload: expectedSelectedServer }); expect(loadMercureInfo).not.toHaveBeenCalled(); }); });