1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2025-06-16 13:46:16 +02:00

Set tests.

This commit is contained in:
Bogdan Bodnar
2019-08-27 15:28:29 +02:00
parent 39a8c16824
commit 18e8e20206
18 changed files with 215 additions and 199 deletions

View File

@ -0,0 +1,9 @@
/*
* Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/)
*
* This is free software, licensed under the GNU General Public License v3.
* See /LICENSE for more information.
*/
import mockAxios from "jest-mock-axios";
export default mockAxios;

View File

@ -10,6 +10,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import {UIDReset} from 'react-uid';
import {StaticRouter} from 'react-router';
import {render} from '@testing-library/react'
Wrapper.propTypes = {
@ -20,9 +21,11 @@ Wrapper.propTypes = {
};
function Wrapper({children}) {
return <UIDReset>
{children}
</UIDReset>
return <StaticRouter>
<UIDReset>
{children}
</UIDReset>
</StaticRouter>
}
const customTestRender = (ui, options) => render(ui, {wrapper: Wrapper, ...options});

View File

@ -28,5 +28,3 @@ jest.doMock('moment', () => {
});
Date.now = jest.fn(() => new Date(Date.UTC(2019, 1, 1, 12, 13, 14)).valueOf());
jest.doMock("utils/vfs_fonts", () => ({}));