Fixed TS compilation in tests

This commit is contained in:
Alejandro Celaya 2020-12-08 19:31:09 +01:00
parent 60282281a3
commit 3e6aee47e5
4 changed files with 6 additions and 2 deletions

View file

@ -11,11 +11,11 @@ import './CreateShortUrlResult.scss';
export interface CreateShortUrlResultProps extends ShortUrlCreation { export interface CreateShortUrlResultProps extends ShortUrlCreation {
resetCreateShortUrl: () => void; resetCreateShortUrl: () => void;
canBeClosed: boolean; canBeClosed?: boolean;
} }
const CreateShortUrlResult = (useStateFlagTimeout: StateFlagTimeout) => ( const CreateShortUrlResult = (useStateFlagTimeout: StateFlagTimeout) => (
{ error, result, resetCreateShortUrl, canBeClosed }: CreateShortUrlResultProps, { error, result, resetCreateShortUrl, canBeClosed = false }: CreateShortUrlResultProps,
) => { ) => {
const [ showCopyTooltip, setShowCopyTooltip ] = useStateFlagTimeout(); const [ showCopyTooltip, setShowCopyTooltip ] = useStateFlagTimeout();

View file

@ -16,6 +16,7 @@ describe('<Paginator />', () => {
const paginator = { const paginator = {
currentPage: 1, currentPage: 1,
pagesCount: 5, pagesCount: 5,
totalItems: 10,
}; };
const extraPagesPrevNext = 2; const extraPagesPrevNext = 2;
const expectedItems = paginator.pagesCount + extraPagesPrevNext; const expectedItems = paginator.pagesCount + extraPagesPrevNext;

View file

@ -125,6 +125,7 @@ describe('shortUrlVisitsReducer', () => {
pagination: { pagination: {
currentPage: 1, currentPage: 1,
pagesCount: 1, pagesCount: 1,
totalItems: 1,
}, },
})); }));
@ -144,6 +145,7 @@ describe('shortUrlVisitsReducer', () => {
pagination: { pagination: {
currentPage: page, currentPage: page,
pagesCount: expectedRequests, pagesCount: expectedRequests,
totalItems: 1,
}, },
})); }));

View file

@ -124,6 +124,7 @@ describe('tagVisitsReducer', () => {
pagination: { pagination: {
currentPage: 1, currentPage: 1,
pagesCount: 1, pagesCount: 1,
totalItems: 1,
}, },
})); }));