From 692eaf7dc9f46d418a357a20349bb46e458ef7fe Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 7 Nov 2022 22:29:15 +0100 Subject: [PATCH] Referenced createNewVisits action directly, instead of its action type --- src/short-urls/reducers/shortUrlsList.ts | 4 ++-- src/tags/reducers/tagsList.ts | 4 ++-- src/visits/reducers/domainVisits.ts | 4 ++-- src/visits/reducers/nonOrphanVisits.ts | 4 ++-- src/visits/reducers/orphanVisits.ts | 4 ++-- src/visits/reducers/shortUrlVisits.ts | 4 ++-- src/visits/reducers/tagVisits.ts | 4 ++-- src/visits/reducers/visitCreation.ts | 2 +- src/visits/reducers/visitsOverview.ts | 4 ++-- test/short-urls/reducers/shortUrlsList.test.ts | 4 ++-- test/visits/reducers/domainVisits.test.ts | 4 ++-- test/visits/reducers/nonOrphanVisits.test.ts | 4 ++-- test/visits/reducers/orphanVisits.test.ts | 4 ++-- test/visits/reducers/shortUrlVisits.test.ts | 4 ++-- test/visits/reducers/tagVisits.test.ts | 4 ++-- test/visits/reducers/visitCreation.test.ts | 4 ++-- test/visits/reducers/visitsOverview.test.ts | 4 ++-- 17 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/short-urls/reducers/shortUrlsList.ts b/src/short-urls/reducers/shortUrlsList.ts index 54b2b4cc..3e492bff 100644 --- a/src/short-urls/reducers/shortUrlsList.ts +++ b/src/short-urls/reducers/shortUrlsList.ts @@ -1,7 +1,7 @@ import { assoc, assocPath, last, pipe, reject } from 'ramda'; import { Action, Dispatch } from 'redux'; import { shortUrlMatches } from '../helpers'; -import { CREATE_VISITS, CreateVisitsAction } from '../../visits/reducers/visitCreation'; +import { createNewVisits, CreateVisitsAction } from '../../visits/reducers/visitCreation'; import { buildReducer } from '../../utils/helpers/redux'; import { GetState } from '../../container/types'; import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder'; @@ -57,7 +57,7 @@ export default buildReducer({ state, )), ), - [CREATE_VISITS]: (state, { payload }) => assocPath( + [createNewVisits.toString()]: (state, { payload }) => assocPath( ['shortUrls', 'data'], state.shortUrls?.data?.map( (currentShortUrl) => { diff --git a/src/tags/reducers/tagsList.ts b/src/tags/reducers/tagsList.ts index b954e04d..c4b25da7 100644 --- a/src/tags/reducers/tagsList.ts +++ b/src/tags/reducers/tagsList.ts @@ -1,6 +1,6 @@ import { isEmpty, reject } from 'ramda'; import { Action, Dispatch } from 'redux'; -import { CREATE_VISITS, CreateVisitsAction } from '../../visits/reducers/visitCreation'; +import { createNewVisits, CreateVisitsAction } from '../../visits/reducers/visitCreation'; import { buildReducer } from '../../utils/helpers/redux'; import { ShlinkTags } from '../../api/types'; import { GetState } from '../../container/types'; @@ -99,7 +99,7 @@ export default buildReducer({ ...state, filteredTags: state.tags.filter((tag) => tag.toLowerCase().match(searchTerm.toLowerCase())), }), - [CREATE_VISITS]: (state, { payload }) => ({ + [createNewVisits.toString()]: (state, { payload }) => ({ ...state, stats: increaseVisitsForTags(calculateVisitsPerTag(payload.createdVisits), state.stats), }), diff --git a/src/visits/reducers/domainVisits.ts b/src/visits/reducers/domainVisits.ts index 72f83300..eb2c80fe 100644 --- a/src/visits/reducers/domainVisits.ts +++ b/src/visits/reducers/domainVisits.ts @@ -7,7 +7,7 @@ import { ShlinkVisitsParams } from '../../api/types'; import { ApiErrorAction } from '../../api/types/actions'; import { isBetween } from '../../utils/helpers/date'; import { getVisitsWithLoader, lastVisitLoaderForLoader } from './common'; -import { CREATE_VISITS, CreateVisitsAction } from './visitCreation'; +import { createNewVisits, CreateVisitsAction } from './visitCreation'; import { domainMatches } from '../../short-urls/helpers'; export const GET_DOMAIN_VISITS_START = 'shlink/domainVisits/GET_DOMAIN_VISITS_START'; @@ -56,7 +56,7 @@ export default buildReducer({ [GET_DOMAIN_VISITS_CANCEL]: (state) => ({ ...state, cancelLoad: true }), [GET_DOMAIN_VISITS_PROGRESS_CHANGED]: (state, { progress }) => ({ ...state, progress }), [GET_DOMAIN_VISITS_FALLBACK_TO_INTERVAL]: (state, { fallbackInterval }) => ({ ...state, fallbackInterval }), - [CREATE_VISITS]: (state, { payload }) => { + [createNewVisits.toString()]: (state, { payload }) => { const { domain, visits, query = {} } = state; const { startDate, endDate } = query; const newVisits = payload.createdVisits diff --git a/src/visits/reducers/nonOrphanVisits.ts b/src/visits/reducers/nonOrphanVisits.ts index 84e2555f..94c037fc 100644 --- a/src/visits/reducers/nonOrphanVisits.ts +++ b/src/visits/reducers/nonOrphanVisits.ts @@ -12,7 +12,7 @@ import { ShlinkVisitsParams } from '../../api/types'; import { ApiErrorAction } from '../../api/types/actions'; import { isBetween } from '../../utils/helpers/date'; import { getVisitsWithLoader, lastVisitLoaderForLoader } from './common'; -import { CREATE_VISITS, CreateVisitsAction } from './visitCreation'; +import { createNewVisits, CreateVisitsAction } from './visitCreation'; export const GET_NON_ORPHAN_VISITS_START = 'shlink/orphanVisits/GET_NON_ORPHAN_VISITS_START'; export const GET_NON_ORPHAN_VISITS_ERROR = 'shlink/orphanVisits/GET_NON_ORPHAN_VISITS_ERROR'; @@ -52,7 +52,7 @@ export default buildReducer({ [GET_NON_ORPHAN_VISITS_CANCEL]: (state) => ({ ...state, cancelLoad: true }), [GET_NON_ORPHAN_VISITS_PROGRESS_CHANGED]: (state, { progress }) => ({ ...state, progress }), [GET_NON_ORPHAN_VISITS_FALLBACK_TO_INTERVAL]: (state, { fallbackInterval }) => ({ ...state, fallbackInterval }), - [CREATE_VISITS]: (state, { payload }) => { + [createNewVisits.toString()]: (state, { payload }) => { const { visits, query = {} } = state; const { startDate, endDate } = query; const newVisits = payload.createdVisits diff --git a/src/visits/reducers/orphanVisits.ts b/src/visits/reducers/orphanVisits.ts index 27023458..ecbe832d 100644 --- a/src/visits/reducers/orphanVisits.ts +++ b/src/visits/reducers/orphanVisits.ts @@ -15,7 +15,7 @@ import { isOrphanVisit } from '../types/helpers'; import { ApiErrorAction } from '../../api/types/actions'; import { isBetween } from '../../utils/helpers/date'; import { getVisitsWithLoader, lastVisitLoaderForLoader } from './common'; -import { CREATE_VISITS, CreateVisitsAction } from './visitCreation'; +import { createNewVisits, CreateVisitsAction } from './visitCreation'; export const GET_ORPHAN_VISITS_START = 'shlink/orphanVisits/GET_ORPHAN_VISITS_START'; export const GET_ORPHAN_VISITS_ERROR = 'shlink/orphanVisits/GET_ORPHAN_VISITS_ERROR'; @@ -55,7 +55,7 @@ export default buildReducer({ [GET_ORPHAN_VISITS_CANCEL]: (state) => ({ ...state, cancelLoad: true }), [GET_ORPHAN_VISITS_PROGRESS_CHANGED]: (state, { progress }) => ({ ...state, progress }), [GET_ORPHAN_VISITS_FALLBACK_TO_INTERVAL]: (state, { fallbackInterval }) => ({ ...state, fallbackInterval }), - [CREATE_VISITS]: (state, { payload }) => { + [createNewVisits.toString()]: (state, { payload }) => { const { visits, query = {} } = state; const { startDate, endDate } = query; const newVisits = payload.createdVisits diff --git a/src/visits/reducers/shortUrlVisits.ts b/src/visits/reducers/shortUrlVisits.ts index 2bfe505e..c768d8b5 100644 --- a/src/visits/reducers/shortUrlVisits.ts +++ b/src/visits/reducers/shortUrlVisits.ts @@ -9,7 +9,7 @@ import { ShlinkVisitsParams } from '../../api/types'; import { ApiErrorAction } from '../../api/types/actions'; import { isBetween } from '../../utils/helpers/date'; import { getVisitsWithLoader, lastVisitLoaderForLoader } from './common'; -import { CREATE_VISITS, CreateVisitsAction } from './visitCreation'; +import { createNewVisits, CreateVisitsAction } from './visitCreation'; export const GET_SHORT_URL_VISITS_START = 'shlink/shortUrlVisits/GET_SHORT_URL_VISITS_START'; export const GET_SHORT_URL_VISITS_ERROR = 'shlink/shortUrlVisits/GET_SHORT_URL_VISITS_ERROR'; @@ -60,7 +60,7 @@ export default buildReducer({ [GET_SHORT_URL_VISITS_CANCEL]: (state) => ({ ...state, cancelLoad: true }), [GET_SHORT_URL_VISITS_PROGRESS_CHANGED]: (state, { progress }) => ({ ...state, progress }), [GET_SHORT_URL_VISITS_FALLBACK_TO_INTERVAL]: (state, { fallbackInterval }) => ({ ...state, fallbackInterval }), - [CREATE_VISITS]: (state, { payload }) => { + [createNewVisits.toString()]: (state, { payload }) => { const { shortCode, domain, visits, query = {} } = state; const { startDate, endDate } = query; const newVisits = payload.createdVisits diff --git a/src/visits/reducers/tagVisits.ts b/src/visits/reducers/tagVisits.ts index 07372ea1..65b0bfc8 100644 --- a/src/visits/reducers/tagVisits.ts +++ b/src/visits/reducers/tagVisits.ts @@ -7,7 +7,7 @@ import { ShlinkVisitsParams } from '../../api/types'; import { ApiErrorAction } from '../../api/types/actions'; import { isBetween } from '../../utils/helpers/date'; import { getVisitsWithLoader, lastVisitLoaderForLoader } from './common'; -import { CREATE_VISITS, CreateVisitsAction } from './visitCreation'; +import { createNewVisits, CreateVisitsAction } from './visitCreation'; export const GET_TAG_VISITS_START = 'shlink/tagVisits/GET_TAG_VISITS_START'; export const GET_TAG_VISITS_ERROR = 'shlink/tagVisits/GET_TAG_VISITS_ERROR'; @@ -53,7 +53,7 @@ export default buildReducer({ [GET_TAG_VISITS_CANCEL]: (state) => ({ ...state, cancelLoad: true }), [GET_TAG_VISITS_PROGRESS_CHANGED]: (state, { progress }) => ({ ...state, progress }), [GET_TAG_VISITS_FALLBACK_TO_INTERVAL]: (state, { fallbackInterval }) => ({ ...state, fallbackInterval }), - [CREATE_VISITS]: (state, { payload }) => { + [createNewVisits.toString()]: (state, { payload }) => { const { tag, visits, query = {} } = state; const { startDate, endDate } = query; const newVisits = payload.createdVisits diff --git a/src/visits/reducers/visitCreation.ts b/src/visits/reducers/visitCreation.ts index a14a339a..3f7f9137 100644 --- a/src/visits/reducers/visitCreation.ts +++ b/src/visits/reducers/visitCreation.ts @@ -1,7 +1,7 @@ import { createAction, PayloadAction } from '@reduxjs/toolkit'; import { CreateVisit } from '../types'; -export const CREATE_VISITS = 'shlink/visitCreation/CREATE_VISITS'; +const CREATE_VISITS = 'shlink/visitCreation/CREATE_VISITS'; export type CreateVisitsAction = PayloadAction<{ createdVisits: CreateVisit[]; diff --git a/src/visits/reducers/visitsOverview.ts b/src/visits/reducers/visitsOverview.ts index a9a0ff9a..824d7f5f 100644 --- a/src/visits/reducers/visitsOverview.ts +++ b/src/visits/reducers/visitsOverview.ts @@ -4,7 +4,7 @@ import { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilde import { GetState } from '../../container/types'; import { buildReducer } from '../../utils/helpers/redux'; import { groupNewVisitsByType } from '../types/helpers'; -import { CREATE_VISITS, CreateVisitsAction } from './visitCreation'; +import { createNewVisits, CreateVisitsAction } from './visitCreation'; export const GET_OVERVIEW_START = 'shlink/visitsOverview/GET_OVERVIEW_START'; export const GET_OVERVIEW_ERROR = 'shlink/visitsOverview/GET_OVERVIEW_ERROR'; @@ -30,7 +30,7 @@ export default buildReducer ({ ...initialState, loading: true }), [GET_OVERVIEW_ERROR]: () => ({ ...initialState, error: true }), [GET_OVERVIEW]: (_, { visitsCount, orphanVisitsCount }) => ({ ...initialState, visitsCount, orphanVisitsCount }), - [CREATE_VISITS]: ({ visitsCount, orphanVisitsCount = 0, ...rest }, { payload }) => { + [createNewVisits.toString()]: ({ visitsCount, orphanVisitsCount = 0, ...rest }, { payload }) => { const { regularVisits, orphanVisits } = groupNewVisitsByType(payload.createdVisits); return { diff --git a/test/short-urls/reducers/shortUrlsList.test.ts b/test/short-urls/reducers/shortUrlsList.test.ts index 05b500ea..3eccb8d8 100644 --- a/test/short-urls/reducers/shortUrlsList.test.ts +++ b/test/short-urls/reducers/shortUrlsList.test.ts @@ -6,12 +6,12 @@ import reducer, { listShortUrls, } from '../../../src/short-urls/reducers/shortUrlsList'; import { SHORT_URL_DELETED } from '../../../src/short-urls/reducers/shortUrlDeletion'; -import { CREATE_VISITS } from '../../../src/visits/reducers/visitCreation'; import { ShortUrl } from '../../../src/short-urls/data'; import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import { ShlinkPaginator, ShlinkShortUrlsResponse } from '../../../src/api/types'; import { CREATE_SHORT_URL } from '../../../src/short-urls/reducers/shortUrlCreation'; import { SHORT_URL_EDITED } from '../../../src/short-urls/reducers/shortUrlEdition'; +import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; describe('shortUrlsListReducer', () => { const shortCode = 'abc123'; @@ -85,7 +85,7 @@ describe('shortUrlsListReducer', () => { error: false, }; - expect(reducer(state, { type: CREATE_VISITS, payload: { createdVisits } } as any)).toEqual({ + expect(reducer(state, { type: createNewVisits.toString(), payload: { createdVisits } } as any)).toEqual({ shortUrls: { data: [ { shortCode, domain: 'example.com', visitsCount: 5 }, diff --git a/test/visits/reducers/domainVisits.test.ts b/test/visits/reducers/domainVisits.test.ts index f3d8d7d8..d7f92bbb 100644 --- a/test/visits/reducers/domainVisits.test.ts +++ b/test/visits/reducers/domainVisits.test.ts @@ -13,7 +13,6 @@ import reducer, { DomainVisits, DEFAULT_DOMAIN, } from '../../../src/visits/reducers/domainVisits'; -import { CREATE_VISITS } from '../../../src/visits/reducers/visitCreation'; import { rangeOf } from '../../../src/utils/utils'; import { Visit } from '../../../src/visits/types'; import { ShlinkVisits } from '../../../src/api/types'; @@ -22,6 +21,7 @@ import { ShlinkState } from '../../../src/container/types'; import { formatIsoDate } from '../../../src/utils/helpers/date'; import { DateInterval } from '../../../src/utils/dates/types'; import { ShortUrl } from '../../../src/short-urls/data'; +import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; describe('domainVisitsReducer', () => { const now = new Date(); @@ -134,7 +134,7 @@ describe('domainVisitsReducer', () => { }); const { visits } = reducer(prevState, { - type: CREATE_VISITS, + type: createNewVisits.toString(), payload: { createdVisits: [{ shortUrl, visit: { date: formatIsoDate(now) ?? undefined } }] }, } as any); diff --git a/test/visits/reducers/nonOrphanVisits.test.ts b/test/visits/reducers/nonOrphanVisits.test.ts index f4c2bc40..285b1e5e 100644 --- a/test/visits/reducers/nonOrphanVisits.test.ts +++ b/test/visits/reducers/nonOrphanVisits.test.ts @@ -11,7 +11,6 @@ import reducer, { GET_NON_ORPHAN_VISITS_PROGRESS_CHANGED, GET_NON_ORPHAN_VISITS_FALLBACK_TO_INTERVAL, } from '../../../src/visits/reducers/nonOrphanVisits'; -import { CREATE_VISITS } from '../../../src/visits/reducers/visitCreation'; import { rangeOf } from '../../../src/utils/utils'; import { Visit, VisitsInfo } from '../../../src/visits/types'; import { ShlinkVisits } from '../../../src/api/types'; @@ -19,6 +18,7 @@ import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import { ShlinkState } from '../../../src/container/types'; import { formatIsoDate } from '../../../src/utils/helpers/date'; import { DateInterval } from '../../../src/utils/dates/types'; +import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; describe('nonOrphanVisitsReducer', () => { const now = new Date(); @@ -106,7 +106,7 @@ describe('nonOrphanVisitsReducer', () => { const visit = Mock.of({ date: formatIsoDate(now) ?? undefined }); const { visits } = reducer(prevState, { - type: CREATE_VISITS, + type: createNewVisits.toString(), payload: { createdVisits: [{ visit }, { visit }] }, } as any); diff --git a/test/visits/reducers/orphanVisits.test.ts b/test/visits/reducers/orphanVisits.test.ts index 5325ac77..5c259a6e 100644 --- a/test/visits/reducers/orphanVisits.test.ts +++ b/test/visits/reducers/orphanVisits.test.ts @@ -11,7 +11,6 @@ import reducer, { GET_ORPHAN_VISITS_PROGRESS_CHANGED, GET_ORPHAN_VISITS_FALLBACK_TO_INTERVAL, } from '../../../src/visits/reducers/orphanVisits'; -import { CREATE_VISITS } from '../../../src/visits/reducers/visitCreation'; import { rangeOf } from '../../../src/utils/utils'; import { Visit, VisitsInfo } from '../../../src/visits/types'; import { ShlinkVisits } from '../../../src/api/types'; @@ -19,6 +18,7 @@ import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import { ShlinkState } from '../../../src/container/types'; import { formatIsoDate } from '../../../src/utils/helpers/date'; import { DateInterval } from '../../../src/utils/dates/types'; +import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; describe('orphanVisitsReducer', () => { const now = new Date(); @@ -106,7 +106,7 @@ describe('orphanVisitsReducer', () => { const visit = Mock.of({ date: formatIsoDate(now) ?? undefined }); const { visits } = reducer(prevState, { - type: CREATE_VISITS, + type: createNewVisits.toString(), payload: { createdVisits: [{ visit }, { visit }] }, } as any); diff --git a/test/visits/reducers/shortUrlVisits.test.ts b/test/visits/reducers/shortUrlVisits.test.ts index d396edb4..f1134557 100644 --- a/test/visits/reducers/shortUrlVisits.test.ts +++ b/test/visits/reducers/shortUrlVisits.test.ts @@ -12,7 +12,6 @@ import reducer, { GET_SHORT_URL_VISITS_FALLBACK_TO_INTERVAL, ShortUrlVisits, } from '../../../src/visits/reducers/shortUrlVisits'; -import { CREATE_VISITS } from '../../../src/visits/reducers/visitCreation'; import { rangeOf } from '../../../src/utils/utils'; import { Visit } from '../../../src/visits/types'; import { ShlinkVisits } from '../../../src/api/types'; @@ -20,6 +19,7 @@ import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import { ShlinkState } from '../../../src/container/types'; import { formatIsoDate } from '../../../src/utils/helpers/date'; import { DateInterval } from '../../../src/utils/dates/types'; +import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; describe('shortUrlVisitsReducer', () => { const now = new Date(); @@ -127,7 +127,7 @@ describe('shortUrlVisitsReducer', () => { }); const { visits } = reducer(prevState, { - type: CREATE_VISITS, + type: createNewVisits.toString(), payload: { createdVisits: [{ shortUrl, visit: { date: formatIsoDate(now) ?? undefined } }] }, } as any); diff --git a/test/visits/reducers/tagVisits.test.ts b/test/visits/reducers/tagVisits.test.ts index d5fd0375..9e5c9e78 100644 --- a/test/visits/reducers/tagVisits.test.ts +++ b/test/visits/reducers/tagVisits.test.ts @@ -12,7 +12,6 @@ import reducer, { GET_TAG_VISITS_FALLBACK_TO_INTERVAL, TagVisits, } from '../../../src/visits/reducers/tagVisits'; -import { CREATE_VISITS } from '../../../src/visits/reducers/visitCreation'; import { rangeOf } from '../../../src/utils/utils'; import { Visit } from '../../../src/visits/types'; import { ShlinkVisits } from '../../../src/api/types'; @@ -20,6 +19,7 @@ import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import { ShlinkState } from '../../../src/container/types'; import { formatIsoDate } from '../../../src/utils/helpers/date'; import { DateInterval } from '../../../src/utils/dates/types'; +import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; describe('tagVisitsReducer', () => { const now = new Date(); @@ -127,7 +127,7 @@ describe('tagVisitsReducer', () => { }); const { visits } = reducer(prevState, { - type: CREATE_VISITS, + type: createNewVisits.toString(), payload: { createdVisits: [{ shortUrl, visit: { date: formatIsoDate(now) ?? undefined } }] }, } as any); diff --git a/test/visits/reducers/visitCreation.test.ts b/test/visits/reducers/visitCreation.test.ts index eba1d4a7..19e5f899 100644 --- a/test/visits/reducers/visitCreation.test.ts +++ b/test/visits/reducers/visitCreation.test.ts @@ -1,5 +1,5 @@ import { Mock } from 'ts-mockery'; -import { CREATE_VISITS, createNewVisits } from '../../../src/visits/reducers/visitCreation'; +import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; import { ShortUrl } from '../../../src/short-urls/data'; import { Visit } from '../../../src/visits/types'; @@ -10,7 +10,7 @@ describe('visitCreationReducer', () => { it('just returns the action with proper type', () => { expect(createNewVisits([{ shortUrl, visit }])).toEqual({ - type: CREATE_VISITS, + type: createNewVisits.toString(), payload: { createdVisits: [{ shortUrl, visit }] }, }); }); diff --git a/test/visits/reducers/visitsOverview.test.ts b/test/visits/reducers/visitsOverview.test.ts index 8405c43a..e93a6565 100644 --- a/test/visits/reducers/visitsOverview.test.ts +++ b/test/visits/reducers/visitsOverview.test.ts @@ -7,7 +7,7 @@ import reducer, { VisitsOverview, loadVisitsOverview, } from '../../../src/visits/reducers/visitsOverview'; -import { CREATE_VISITS, CreateVisitsAction } from '../../../src/visits/reducers/visitCreation'; +import { createNewVisits, CreateVisitsAction } from '../../../src/visits/reducers/visitCreation'; import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import { ShlinkVisitsOverview } from '../../../src/api/types'; import { ShlinkState } from '../../../src/container/types'; @@ -51,7 +51,7 @@ describe('visitsOverviewReducer', () => { const { visitsCount, orphanVisitsCount } = reducer( state({ visitsCount: 100, orphanVisitsCount: providedOrphanVisitsCount }), { - type: CREATE_VISITS, + type: createNewVisits.toString(), payload: { createdVisits: [ Mock.of({ visit: Mock.all() }),