Diff comments:
> diff --git a/src/test-utils.tsx b/src/test-utils.tsx
> new file mode 100644
> index 0000000..419ac79
> --- /dev/null
> +++ b/src/test-utils.tsx
> @@ -0,0 +1,26 @@
> +import React, { ReactElement } from "react";
> +import { render, RenderOptions } from "@testing-library/react";
> +
> +import { QueryClient, QueryClientProvider } from "react-query";
> +
Absolutely, will do!
> +const queryClient = new QueryClient({
> + defaultOptions: {
> + queries: {
> + retry: false,
> + },
> + },
> +});
> +
> +const Providers = ({ children }: { children: React.ReactNode }) => {
> + return (
> + <QueryClientProvider
> client={queryClient}>{children}</QueryClientProvider>
> + );
> +};
> +
> +const customRender = (
> + ui: ReactElement,
> + options?: Omit<RenderOptions, "wrapper">
> +) => render(ui, { wrapper: Providers, ...options });
> +
> +export * from "@testing-library/react";
> +export { customRender as render };
--
https://code.launchpad.net/~maas-committers/maas-site-manager/+git/maas-site-manager-frontend/+merge/437798
Your team MAAS Committers is subscribed to branch
~maas-committers/maas-site-manager/+git/maas-site-manager-frontend:main.
--
Mailing list: https://launchpad.net/~sts-sponsors
Post to : [email protected]
Unsubscribe : https://launchpad.net/~sts-sponsors
More help : https://help.launchpad.net/ListHelp