feat(profile)!: replace sidebar and add avatar navigation
Rename the global Sidebar route, UI, assets, analytics, and payment return context to Profile. Add accessible message-avatar navigation and preserve the source character across auth and logout flows. BREAKING CHANGE: /sidebar has been removed; use /profile instead.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
import { mockCoreApis } from "@e2e/fixtures/api-mocks";
|
||||
import {
|
||||
clearBrowserState,
|
||||
defaultCharacterProfilePath,
|
||||
defaultCharacterSplashPath,
|
||||
defaultCharacterChatUrl,
|
||||
enterChatFromSplash,
|
||||
getSplashStartChatButton,
|
||||
submitEmailLogin,
|
||||
switchToEmailSignIn,
|
||||
} from "@e2e/fixtures/test-helpers";
|
||||
|
||||
test.beforeEach(async ({ baseURL, context, page }) => {
|
||||
await clearBrowserState(context, page, baseURL);
|
||||
await mockCoreApis(page);
|
||||
});
|
||||
|
||||
test("user can log out from the profile after email login", 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);
|
||||
await submitEmailLogin(page, { expectedUrl: defaultCharacterChatUrl });
|
||||
await expect(page.getByRole("button", { name: "Profile" })).toBeVisible();
|
||||
|
||||
await page.getByRole("button", { name: "Profile" }).click();
|
||||
await expect(page).toHaveURL(
|
||||
new RegExp(defaultCharacterProfilePath.replace("?", "\\?") + "$"),
|
||||
);
|
||||
|
||||
const logoutRequestPromise = page.waitForRequest("**/api/auth/logout");
|
||||
await page.getByRole("button", { name: /Log out/i }).click();
|
||||
|
||||
const logoutRequest = await logoutRequestPromise;
|
||||
expect(logoutRequest.method()).toBe("POST");
|
||||
|
||||
await expect(page).toHaveURL(new RegExp(`${defaultCharacterSplashPath}$`));
|
||||
await expect(getSplashStartChatButton(page)).toBeVisible();
|
||||
});
|
||||
Reference in New Issue
Block a user