mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-15 03:53:51 +00:00
Created now function and refactored intervalToDateRange
This commit is contained in:
@@ -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,
|
||||
],
|
||||
|
||||
@@ -177,12 +177,12 @@ describe('nonOrphanVisitsReducer', () => {
|
||||
|
||||
it.each([
|
||||
[
|
||||
[Mock.of<Visit>({ date: formatISO(subDays(new Date(), 5)) })],
|
||||
[Mock.of<Visit>({ date: formatISO(subDays(now, 5)) })],
|
||||
{ type: fallbackToIntervalAction.toString(), payload: 'last7Days' },
|
||||
3,
|
||||
],
|
||||
[
|
||||
[Mock.of<Visit>({ date: formatISO(subDays(new Date(), 200)) })],
|
||||
[Mock.of<Visit>({ date: formatISO(subDays(now, 200)) })],
|
||||
{ type: fallbackToIntervalAction.toString(), payload: 'last365Days' },
|
||||
3,
|
||||
],
|
||||
|
||||
@@ -175,12 +175,12 @@ describe('orphanVisitsReducer', () => {
|
||||
|
||||
it.each([
|
||||
[
|
||||
[Mock.of<Visit>({ date: formatISO(subDays(new Date(), 5)) })],
|
||||
[Mock.of<Visit>({ date: formatISO(subDays(now, 5)) })],
|
||||
{ type: fallbackToIntervalAction.toString(), payload: 'last7Days' },
|
||||
3,
|
||||
],
|
||||
[
|
||||
[Mock.of<Visit>({ date: formatISO(subDays(new Date(), 200)) })],
|
||||
[Mock.of<Visit>({ date: formatISO(subDays(now, 200)) })],
|
||||
{ type: fallbackToIntervalAction.toString(), payload: 'last365Days' },
|
||||
3,
|
||||
],
|
||||
|
||||
@@ -219,12 +219,12 @@ describe('shortUrlVisitsReducer', () => {
|
||||
|
||||
it.each([
|
||||
[
|
||||
[Mock.of<Visit>({ date: formatISO(subDays(new Date(), 5)) })],
|
||||
[Mock.of<Visit>({ date: formatISO(subDays(now, 5)) })],
|
||||
{ type: fallbackToIntervalAction.toString(), payload: 'last7Days' },
|
||||
3,
|
||||
],
|
||||
[
|
||||
[Mock.of<Visit>({ date: formatISO(subDays(new Date(), 200)) })],
|
||||
[Mock.of<Visit>({ date: formatISO(subDays(now, 200)) })],
|
||||
{ type: fallbackToIntervalAction.toString(), payload: 'last365Days' },
|
||||
3,
|
||||
],
|
||||
|
||||
@@ -193,12 +193,12 @@ describe('tagVisitsReducer', () => {
|
||||
|
||||
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,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user