shlink-web-client/shlink-web-component/test/visits/reducers/visitCreation.test.ts
2023-08-07 10:51:08 +02:00

16 lines
650 B
TypeScript

import { fromPartial } from '@total-typescript/shoehorn';
import type { ShlinkShortUrl } from '../../../src/api-contract';
import { createNewVisits } from '../../../src/visits/reducers/visitCreation';
import type { Visit } from '../../../src/visits/types';
describe('visitCreationReducer', () => {
describe('createNewVisits', () => {
const shortUrl = fromPartial<ShlinkShortUrl>({});
const visit = fromPartial<Visit>({});
it('just returns the action with proper type', () => {
const { payload } = createNewVisits([{ shortUrl, visit }]);
expect(payload).toEqual({ createdVisits: [{ shortUrl, visit }] });
});
});
});