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:
9
src/testUtils/__mocks__/axios.js
Normal file
9
src/testUtils/__mocks__/axios.js
Normal 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;
|
@ -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});
|
||||
|
@ -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", () => ({}));
|
||||
|
Reference in New Issue
Block a user