2019-08-23 15:20:22 +02:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* eslint import/export: "off" */
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import {UIDReset} from 'react-uid';
|
|
|
|
import {render} from '@testing-library/react'
|
|
|
|
|
|
|
|
Wrapper.propTypes = {
|
|
|
|
children: PropTypes.oneOfType([
|
|
|
|
PropTypes.arrayOf(PropTypes.node),
|
|
|
|
PropTypes.node
|
|
|
|
])
|
|
|
|
};
|
|
|
|
|
|
|
|
function Wrapper({children}) {
|
2019-08-27 14:07:34 +02:00
|
|
|
return <UIDReset>
|
|
|
|
{children}
|
|
|
|
</UIDReset>
|
2019-08-23 15:20:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const customTestRender = (ui, options) => render(ui, {wrapper: Wrapper, ...options});
|
|
|
|
|
|
|
|
// re-export everything
|
|
|
|
export * from '@testing-library/react'
|
|
|
|
|
|
|
|
// override render method
|
|
|
|
export {customTestRender as render}
|