mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-01 13:47:50 +03:00
9bb7ccf651
* feat: add providers mocks * test(<ChatPage/>: add render test using providers
25 lines
629 B
TypeScript
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>
|
|
);
|
|
};
|