mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-11 01:53:51 +00:00
Add Shlink prefix to api-contract models
This commit is contained in:
@@ -2,7 +2,7 @@ import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { addDays, formatISO, subDays } from 'date-fns';
|
||||
import type { ShlinkApiClient, ShlinkVisits } from '../../../src/api-contract';
|
||||
import type { RootState } from '../../../src/container/store';
|
||||
import type { ShortUrl } from '../../../src/short-urls/data';
|
||||
import type { ShlinkShortUrl } from '../../../src/short-urls/data';
|
||||
import { formatIsoDate } from '../../../src/utils/dates/helpers/date';
|
||||
import type { DateInterval } from '../../../src/utils/dates/helpers/dateIntervals';
|
||||
import { rangeOf } from '../../../src/utils/helpers';
|
||||
@@ -124,7 +124,7 @@ describe('domainVisitsReducer', () => {
|
||||
visitsMocks.length,
|
||||
],
|
||||
])('prepends new visits on CREATE_VISIT', (state, shortUrlDomain, expectedVisits) => {
|
||||
const shortUrl = fromPartial<ShortUrl>({ domain: shortUrlDomain });
|
||||
const shortUrl = fromPartial<ShlinkShortUrl>({ domain: shortUrlDomain });
|
||||
const { visits } = reducer(buildState({ ...state, visits: visitsMocks }), createNewVisits([
|
||||
fromPartial({ shortUrl, visit: { date: formatIsoDate(now) ?? undefined } }),
|
||||
]));
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import type { ShortUrl } from '../../../src/short-urls/data';
|
||||
import type { ShlinkShortUrl } from '../../../src/short-urls/data';
|
||||
import { createNewVisits } from '../../../src/visits/reducers/visitCreation';
|
||||
import type { Visit } from '../../../src/visits/types';
|
||||
|
||||
describe('visitCreationReducer', () => {
|
||||
describe('createNewVisits', () => {
|
||||
const shortUrl = fromPartial<ShortUrl>({});
|
||||
const shortUrl = fromPartial<ShlinkShortUrl>({});
|
||||
const visit = fromPartial<Visit>({});
|
||||
|
||||
it('just returns the action with proper type', () => {
|
||||
|
||||
Reference in New Issue
Block a user