Created now function and refactored intervalToDateRange

This commit is contained in:
Alejandro Celaya
2022-12-05 17:18:00 +01:00
parent 7d83e434e6
commit 1654784471
10 changed files with 38 additions and 50 deletions

View File

@@ -197,12 +197,12 @@ describe('domainVisitsReducer', () => {
it.each([
[
[Mock.of<Visit>({ date: formatISO(subDays(new Date(), 20)) })],
[Mock.of<Visit>({ date: formatISO(subDays(now, 20)) })],
{ type: fallbackToIntervalAction.toString(), payload: 'last30Days' },
3,
],
[
[Mock.of<Visit>({ date: formatISO(subDays(new Date(), 100)) })],
[Mock.of<Visit>({ date: formatISO(subDays(now, 100)) })],
{ type: fallbackToIntervalAction.toString(), payload: 'last180Days' },
3,
],