import React from "react";
import { render } from "@testing-library/react";
import { Provider } from "react-redux";

// custom render that includes redux provider
const customRender = (ui, { store, ...renderOptions } = {}) => {
	const wrapper = ({ children }) => {
		return <Provider store={store}>{children}</Provider>;
	};

	return render(ui, { wrapper: wrapper, ...renderOptions });
};

// re-export everything
export * from "@testing-library/react";
// override render method
export { customRender as render };
