feat(private-zone): default to albums tab

This commit is contained in:
Codex
2026-07-27 18:55:58 +08:00
parent e36f94add3
commit 54ce485f41
3 changed files with 37 additions and 19 deletions
+22 -4
View File
@@ -17,7 +17,7 @@ test.beforeEach(async ({ baseURL, context, page }) => {
await registerPrivateZoneVideoMocks(page);
});
test("Private Zone defaults to Moments and reveals video only after one credit unlock", async ({
test("Private Zone defaults to Albums and reveals video after switching to Moments", async ({
page,
}) => {
await seedEmailSession(page);
@@ -32,6 +32,11 @@ test("Private Zone defaults to Moments and reveals video only after one credit u
await page.goto("/characters/maya/private-zone");
await listRequest;
await expect(
page.getByRole("heading", { name: "Private albums" }),
).toBeVisible();
await expect(page.getByText("Maya archive")).toBeVisible();
await page.getByRole("tab", { name: "Moments" }).click();
await expect(
page.getByRole("heading", { name: "Private moments" }),
).toBeVisible();
@@ -53,16 +58,29 @@ test("Private Zone defaults to Moments and reveals video only after one credit u
await expect(page.getByRole("alertdialog")).toHaveCount(0);
});
test("Albums remain available behind the second tab", async ({ page }) => {
test("Albums render first and Moments remain available behind the second tab", async ({ page }) => {
await seedEmailSession(page);
await page.goto("/characters/maya/private-zone");
await page.getByRole("tab", { name: "Albums" }).click();
const tabs = page.getByRole("tab");
await expect(tabs).toHaveText(["Albums", "Moments"]);
await expect(page.getByRole("tab", { name: "Albums" })).toHaveAttribute(
"aria-selected",
"true",
);
await expect(
page.getByRole("heading", { name: "Private albums" }),
).toBeVisible();
await expect(page.getByText("Maya archive")).toBeVisible();
await page.getByRole("tab", { name: "Moments" }).click();
await expect(page.getByRole("tab", { name: "Moments" })).toHaveAttribute(
"aria-selected",
"true",
);
await expect(
page.getByRole("heading", { name: "Private moments" }),
).toBeVisible();
});
async function registerPrivateZoneVideoMocks(page: Page): Promise<void> {