mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-17 07:31:42 +03:00
2b4c3ecbbc
* feat: add Knowledge tab * feat: use tanstack query for knowledges fetching * feat: update header * feat: remove upload page * feat: make chat page the default redirection page * feat(homePage): redirect user to chat page when already authenticated
37 lines
858 B
TypeScript
37 lines
858 B
TypeScript
import { render, screen } from "@testing-library/react";
|
|
import { describe, expect, it, vi } from "vitest";
|
|
|
|
import { getProcessEnvManager } from "@/lib/helpers/getProcessEnvManager";
|
|
|
|
import HomePage from "../page";
|
|
|
|
const mockUseSupabase = vi.fn(() => ({
|
|
session: {
|
|
user: {},
|
|
},
|
|
}));
|
|
|
|
vi.mock("@/lib/context/SupabaseProvider", () => ({
|
|
useSupabase: () => mockUseSupabase(),
|
|
}));
|
|
|
|
vi.mock("next/navigation", () => ({
|
|
redirect: (url: string) => url,
|
|
}));
|
|
|
|
describe("HomePage", () => {
|
|
it("should render HomePage component properly", () => {
|
|
const { overwriteEnvValuesWith, resetEnvValues } = getProcessEnvManager();
|
|
|
|
overwriteEnvValuesWith({
|
|
NEXT_PUBLIC_ENV: "not-local",
|
|
});
|
|
|
|
render(<HomePage />);
|
|
const homePage = screen.getByTestId("home-page");
|
|
expect(homePage).toBeDefined();
|
|
|
|
resetEnvValues();
|
|
});
|
|
});
|