2023-04-14 09:28:53 +02:00
|
|
|
import { fromPartial } from '@total-typescript/shoehorn';
|
2023-02-18 10:40:37 +01:00
|
|
|
import type { ShortUrl } from '../../../src/short-urls/data';
|
2023-02-18 11:11:01 +01:00
|
|
|
import { createNewVisits } from '../../../src/visits/reducers/visitCreation';
|
2023-02-18 10:40:37 +01:00
|
|
|
import type { Visit } from '../../../src/visits/types';
|
2020-08-27 17:56:48 +02:00
|
|
|
|
|
|
|
describe('visitCreationReducer', () => {
|
2020-09-12 11:31:44 +02:00
|
|
|
describe('createNewVisits', () => {
|
2023-04-14 09:28:53 +02:00
|
|
|
const shortUrl = fromPartial<ShortUrl>({});
|
|
|
|
const visit = fromPartial<Visit>({});
|
2020-08-27 17:56:48 +02:00
|
|
|
|
2022-03-26 12:17:42 +01:00
|
|
|
it('just returns the action with proper type', () => {
|
2023-03-18 12:35:33 +01:00
|
|
|
const { payload } = createNewVisits([{ shortUrl, visit }]);
|
|
|
|
expect(payload).toEqual({ createdVisits: [{ shortUrl, visit }] });
|
2022-03-26 12:17:42 +01:00
|
|
|
});
|
2020-08-27 17:56:48 +02:00
|
|
|
});
|
|
|
|
});
|