test(e2e): update specs for multi-character routes

This commit is contained in:
2026-07-17 16:49:20 +08:00
parent 8a53a07e0e
commit 78e97c3612
10 changed files with 60 additions and 28 deletions
@@ -4,6 +4,7 @@ import { mockCoreApis } from "@e2e/fixtures/api-mocks";
import {
clearBrowserState,
completeVipPayment,
defaultCharacterChatUrl,
dismissChatInterruptions,
enterChatFromSplash,
expectAuthRedirectToVipChatSubscription,
@@ -29,9 +30,9 @@ test("guest uses the shared chat limit top-up flow", async ({ page }) => {
await dismissChatInterruptions(page);
const messageInput = page.getByRole("textbox", { name: "Message" });
const quantityLimitBanner = page
.getByRole("status")
.filter({ hasText: "Insufficient credits" });
const quantityLimitBanner = page.getByTestId(
"chat-insufficient-credits-banner",
);
let limitTriggeredAt: number | null = null;
let completedSendCount = 0;
@@ -79,9 +80,7 @@ test("guest uses the shared chat limit top-up flow", async ({ page }) => {
expect(limitTriggeredAt).toBe(mockedLimitTriggerAt);
await expect(quantityLimitBanner).toBeVisible();
await expect(
quantityLimitBanner.getByText("Free chats refresh every day."),
).toBeVisible();
await expect(quantityLimitBanner.getByText("Out of Daily Free Chats")).toBeVisible();
const topUpButton = quantityLimitBanner.getByRole("button", {
name: "Top up credits to continue",
});
@@ -97,7 +96,7 @@ test("guest uses the shared chat limit top-up flow", async ({ page }) => {
await completeVipPayment(page);
await expect(page).toHaveURL(/\/chat$/);
await expect(page).toHaveURL(defaultCharacterChatUrl);
await expect(page.getByRole("textbox", { name: "Message" })).toBeVisible();
});