feat(e2e): add email login flow tests and mock responses for email user
This commit is contained in:
@@ -3,9 +3,12 @@ import type { Page } from "@playwright/test";
|
||||
import {
|
||||
apiEnvelope,
|
||||
chatSendResponse,
|
||||
e2eEmailUser,
|
||||
emptyChatHistoryResponse,
|
||||
emailLoginResponse,
|
||||
guestLoginResponse,
|
||||
paymentPlansResponse,
|
||||
userEntitlementsResponse,
|
||||
vipStatusResponse,
|
||||
} from "./test-data";
|
||||
|
||||
@@ -14,6 +17,18 @@ export async function mockCoreApis(page: Page): Promise<void> {
|
||||
await route.fulfill({ json: apiEnvelope(guestLoginResponse) });
|
||||
});
|
||||
|
||||
await page.route("**/api/auth/login", async (route) => {
|
||||
await route.fulfill({ json: apiEnvelope(emailLoginResponse) });
|
||||
});
|
||||
|
||||
await page.route("**/api/user/profile", async (route) => {
|
||||
await route.fulfill({ json: apiEnvelope(e2eEmailUser) });
|
||||
});
|
||||
|
||||
await page.route("**/api/user/entitlements", async (route) => {
|
||||
await route.fulfill({ json: apiEnvelope(userEntitlementsResponse) });
|
||||
});
|
||||
|
||||
await page.route("**/api/chat/history**", async (route) => {
|
||||
await route.fulfill({ json: apiEnvelope(emptyChatHistoryResponse) });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user