import * as React from 'react';
import * as PropTypes from 'prop-types';
import { render } from '@testing-library/react';
import { SheetsRegistry } from '@fluent-ui/styles';
import { ThemeProvider } from '../ThemeProvider';
let sheets;

const Wrapper = ({
  children
}) => {
  sheets = new SheetsRegistry();
  return React.createElement(ThemeProvider, {
    theme: {},
    registry: sheets
  }, children);
};

Wrapper.propTypes = {
  children: PropTypes.node
};

const customRender = (ui, options) => ({ ...render(ui, {
    wrapper: Wrapper,
    ...options
  }),
  sheets
});

export { customRender as render };