test(e2e): stabilize fixture imports
This commit is contained in:
@@ -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();
|
||||
});
|
||||
Reference in New Issue
Block a user