test(e2e): stabilize fixture imports

This commit is contained in:
2026-07-03 14:43:45 +08:00
parent 873a0a8bce
commit e22c5dfb78
9 changed files with 20 additions and 19 deletions
@@ -0,0 +1,34 @@
import { expect, test } from "@playwright/test";
import { mockCoreApis } from "@e2e/fixtures/api-mocks";
import {
clearBrowserState,
enterChatFromSplash,
submitEmailLogin,
switchToEmailSignIn,
} from "@e2e/fixtures/test-helpers";
test.beforeEach(async ({ baseURL, context, page }) => {
await clearBrowserState(context, page, baseURL);
await mockCoreApis(page);
});
test("user can email login from other sign-in options and return to chat", async ({
page,
}) => {
await enterChatFromSplash(page);
await page
.getByRole("button", { name: "Sign up to unlock more features" })
.click();
await expect(page).toHaveURL(/\/auth$/);
await switchToEmailSignIn(page);
const loginRequest = await submitEmailLogin(page, { expectedUrl: /\/chat$/ });
expect(loginRequest?.postDataJSON()).toMatchObject({
platform: "desktop",
});
await expect(page.getByRole("textbox", { name: "Message" })).toBeVisible();
await expect(page.getByRole("button", { name: "Menu" })).toBeVisible();
});