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

19 lines
643 B
TypeScript
Raw Normal View History

2020-08-27 18:56:48 +03:00
import { Mock } from 'ts-mockery';
import { createNewVisits } from '../../../src/visits/reducers/visitCreation';
2023-02-18 12:40:37 +03:00
import type { ShortUrl } from '../../../src/short-urls/data';
import type { Visit } from '../../../src/visits/types';
2020-08-27 18:56:48 +03:00
describe('visitCreationReducer', () => {
describe('createNewVisits', () => {
2020-08-27 18:56:48 +03:00
const shortUrl = Mock.all<ShortUrl>();
const visit = Mock.all<Visit>();
2022-03-26 14:17:42 +03:00
it('just returns the action with proper type', () => {
expect(createNewVisits([{ shortUrl, visit }])).toEqual({
type: createNewVisits.toString(),
payload: { createdVisits: [{ shortUrl, visit }] },
});
2022-03-26 14:17:42 +03:00
});
2020-08-27 18:56:48 +03:00
});
});