quivr/frontend/lib/context/SupabaseProvider/mocks/SupabaseProviderMock.tsx
Mamadou DICKO 9bb7ccf651
Frontend/test/chat 1 (#508)
* feat: add providers mocks

* test(<ChatPage/>: add render test using providers
2023-07-05 09:30:22 +02:00

25 lines
629 B
TypeScript

import { createContext, PropsWithChildren } from "react";
import { SupabaseContextType } from "../types";
export const SupabaseContextMock = createContext<
SupabaseContextType | undefined
>(undefined);
export const SupabaseProviderMock = ({
children,
}: PropsWithChildren): JSX.Element => {
return (
<SupabaseContextMock.Provider
value={{
// @ts-ignore - we are not actually using these values in the tests
supabase: {},
// @ts-ignore - we are not actually using these values in the tests
session: {},
}}
>
{children}
</SupabaseContextMock.Provider>
);
};