Initial PHP rebuild of the app
This commit is contained in:
690 files changed
+33944
-12046
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
vi.mock("next/navigation", () => ({
|
||||
redirect: (location: string) => {
|
||||
throw new Error(`redirect:${location}`);
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock("@/lib/db/prisma", () => {
|
||||
throw new Error("Business Prisma must not load while importing the Manager root.");
|
||||
});
|
||||
|
||||
vi.mock("@/features/welcome/pages/business-welcome-page", () => {
|
||||
throw new Error("Business welcome page must not load while importing the Manager root.");
|
||||
});
|
||||
|
||||
import RootPage from "@/app/page";
|
||||
|
||||
describe("root deployment entry point", () => {
|
||||
const originalManagerMode = process.env.MANAGER_MODE;
|
||||
|
||||
afterEach(() => {
|
||||
if (originalManagerMode === undefined) delete process.env.MANAGER_MODE;
|
||||
else process.env.MANAGER_MODE = originalManagerMode;
|
||||
});
|
||||
|
||||
it("redirects Manager root without evaluating business page or Prisma", async () => {
|
||||
process.env.MANAGER_MODE = "true";
|
||||
|
||||
await expect(RootPage()).rejects.toThrow("redirect:/manager");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user