test(e2e): add frontend smoke coverage
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("未登录访问受保护页面时返回登录重定向", async ({ request }) => {
|
||||
const sessionResponse = await request.get("/api/auth/session");
|
||||
expect(await sessionResponse.json()).toEqual({});
|
||||
|
||||
const response = await request.get("/audit-logs", { maxRedirects: 0 });
|
||||
const body = await response.text();
|
||||
|
||||
expect(response.status()).toBe(200);
|
||||
expect(body).toContain("NEXT_REDIRECT;replace;/login;307;");
|
||||
});
|
||||
Reference in New Issue
Block a user