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

18 lines
616 B
TypeScript
Raw Normal View History

2020-08-27 18:56:48 +03:00
import { Mock } from 'ts-mockery';
import { CREATE_VISITS, createNewVisits } from '../../../src/visits/reducers/visitCreation';
2020-08-27 18:56:48 +03:00
import { ShortUrl } from '../../../src/short-urls/data';
import { Visit } from '../../../src/visits/types';
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: CREATE_VISITS, createdVisits: [{ shortUrl, visit }] },
2022-03-26 14:17:42 +03:00
);
});
2020-08-27 18:56:48 +03:00
});
});