test(e2e): add playwright smoke coverage
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
|
||||
import {
|
||||
apiEnvelope,
|
||||
chatSendResponse,
|
||||
emptyChatHistoryResponse,
|
||||
guestLoginResponse,
|
||||
paymentPlansResponse,
|
||||
vipStatusResponse,
|
||||
} from "./test-data";
|
||||
|
||||
export async function mockCoreApis(page: Page): Promise<void> {
|
||||
await page.route("**/api/auth/guest", async (route) => {
|
||||
await route.fulfill({ json: apiEnvelope(guestLoginResponse) });
|
||||
});
|
||||
|
||||
await page.route("**/api/chat/history**", async (route) => {
|
||||
await route.fulfill({ json: apiEnvelope(emptyChatHistoryResponse) });
|
||||
});
|
||||
|
||||
await page.route("**/api/chat/send", async (route) => {
|
||||
await route.fulfill({ json: apiEnvelope(chatSendResponse) });
|
||||
});
|
||||
|
||||
await page.route("**/api/payment/plans**", async (route) => {
|
||||
await route.fulfill({ json: apiEnvelope(paymentPlansResponse) });
|
||||
});
|
||||
|
||||
await page.route("**/api/payment/vip-status**", async (route) => {
|
||||
await route.fulfill({ json: apiEnvelope(vipStatusResponse) });
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user