修改登录逻辑
This commit is contained in:
@@ -11,4 +11,16 @@ describe("AuthLoginPanel", () => {
|
||||
expect(source).not.toContain("/api/auth/captcha");
|
||||
expect(source).not.toContain("randomStr");
|
||||
});
|
||||
|
||||
it("supports switching between normal and admin login pages", async () => {
|
||||
const panelSource = await readFile(join(process.cwd(), "components", "auth-login-panel.tsx"), "utf8");
|
||||
const loginPageSource = await readFile(join(process.cwd(), "app", "auth", "login", "page.tsx"), "utf8");
|
||||
const adminPageSource = await readFile(join(process.cwd(), "app", "auth", "admin-login", "page.tsx"), "utf8").catch(() => "");
|
||||
|
||||
expect(panelSource).toContain("authMode");
|
||||
expect(panelSource).toContain("alternateHref");
|
||||
expect(loginPageSource).toContain("/auth/admin-login");
|
||||
expect(adminPageSource).toContain('authMode="admin"');
|
||||
expect(adminPageSource).toContain("/auth/login");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user