mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-02-27 12:16:36 +00:00
Defined visits TS types
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
import { CREATE_VISIT, createNewVisit } from '../../../src/visits/reducers/visitCreation';
|
||||
|
||||
describe('visitCreationReducer', () => {
|
||||
describe('createNewVisit', () => {
|
||||
it('just returns the action with proper type', () =>
|
||||
expect(createNewVisit({ shortUrl: {}, visit: {} })).toEqual(
|
||||
{ type: CREATE_VISIT, shortUrl: {}, visit: {} },
|
||||
));
|
||||
});
|
||||
});
|
||||
16
test/visits/reducers/visitCreation.test.ts
Normal file
16
test/visits/reducers/visitCreation.test.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Mock } from 'ts-mockery';
|
||||
import { CREATE_VISIT, createNewVisit } from '../../../src/visits/reducers/visitCreation';
|
||||
import { ShortUrl } from '../../../src/short-urls/data';
|
||||
import { Visit } from '../../../src/visits/types';
|
||||
|
||||
describe('visitCreationReducer', () => {
|
||||
describe('createNewVisit', () => {
|
||||
const shortUrl = Mock.all<ShortUrl>();
|
||||
const visit = Mock.all<Visit>();
|
||||
|
||||
it('just returns the action with proper type', () =>
|
||||
expect(createNewVisit({ shortUrl, visit })).toEqual(
|
||||
{ type: CREATE_VISIT, shortUrl, visit },
|
||||
));
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user