shlink-web-client/shlink-web-component/test/visits/reducers/visitCreation.test.ts

17 lines
650 B
TypeScript
Raw Normal View History

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';
2020-08-27 18:56:48 +03:00
describe('visitCreationReducer', () => {
describe('createNewVisits', () => {
const shortUrl = fromPartial<ShlinkShortUrl>({});
const visit = fromPartial<Visit>({});
2020-08-27 18:56:48 +03:00
2022-03-26 14:17:42 +03:00
it('just returns the action with proper type', () => {
const { payload } = createNewVisits([{ shortUrl, visit }]);
expect(payload).toEqual({ createdVisits: [{ shortUrl, visit }] });
2022-03-26 14:17:42 +03:00
});
2020-08-27 18:56:48 +03:00
});
});