2023-04-14 10:28:53 +03:00
|
|
|
import { fromPartial } from '@total-typescript/shoehorn';
|
2023-08-07 11:51:08 +03:00
|
|
|
import type { ShlinkShortUrl } from '../../../src/api-contract';
|
2023-08-02 10:01:44 +03:00
|
|
|
import { createNewVisits } from '../../../src/visits/reducers/visitCreation';
|
|
|
|
import type { Visit } from '../../../src/visits/types';
|
2020-08-27 18:56:48 +03:00
|
|
|
|
|
|
|
describe('visitCreationReducer', () => {
|
2020-09-12 12:31:44 +03:00
|
|
|
describe('createNewVisits', () => {
|
2023-08-06 22:27:57 +03:00
|
|
|
const shortUrl = fromPartial<ShlinkShortUrl>({});
|
2023-04-14 10:28:53 +03:00
|
|
|
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', () => {
|
2023-03-18 14:35:33 +03:00
|
|
|
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
|
|
|
});
|
|
|
|
});
|