test(e2e): update specs for multi-character routes
This commit is contained in:
@@ -5,6 +5,7 @@ import { paidImageMessageId } from "@e2e/fixtures/test-data";
|
||||
import {
|
||||
clearBrowserState,
|
||||
completeVipPayment,
|
||||
defaultCharacterChatPath,
|
||||
dismissChatInterruptions,
|
||||
enterChatFromSplash,
|
||||
expectInsufficientCreditsDialog,
|
||||
@@ -15,7 +16,7 @@ import {
|
||||
} from "@e2e/fixtures/test-helpers";
|
||||
|
||||
const paidImageOverlayUrl = new RegExp(
|
||||
`/chat\\?image=${paidImageMessageId}$`,
|
||||
`${defaultCharacterChatPath}\\?image=${paidImageMessageId}$`,
|
||||
);
|
||||
|
||||
test.beforeEach(async ({ baseURL, context, page }) => {
|
||||
@@ -62,7 +63,7 @@ test("guest can unlock a paid image after email login and subscription payment",
|
||||
|
||||
await expect(page).toHaveURL(/\/auth\?redirect=/);
|
||||
expect(new URL(page.url()).searchParams.get("redirect")).toBe(
|
||||
`/chat?image=${paidImageMessageId}`,
|
||||
`${defaultCharacterChatPath}?image=${paidImageMessageId}`,
|
||||
);
|
||||
|
||||
await switchToEmailSignIn(page);
|
||||
@@ -74,7 +75,7 @@ test("guest can unlock a paid image after email login and subscription payment",
|
||||
const unlockRequestPromise = page.waitForRequest(
|
||||
"**/api/chat/unlock-private",
|
||||
);
|
||||
await page.goto(`/chat?image=${paidImageMessageId}`);
|
||||
await page.goto(`${defaultCharacterChatPath}?image=${paidImageMessageId}`);
|
||||
|
||||
const unlockRequest = await unlockRequestPromise;
|
||||
expect(unlockRequest.postDataJSON()).toMatchObject({
|
||||
@@ -89,7 +90,11 @@ test("guest can unlock a paid image after email login and subscription payment",
|
||||
await expectVipChatSubscriptionUrl(page);
|
||||
await completeVipPayment(page);
|
||||
|
||||
await expect(page).toHaveURL(/\/chat(?:\?image=msg_photo_paywall_001)?$/);
|
||||
expect(new URL(page.url()).pathname).toBe("/chat");
|
||||
await expect(page).toHaveURL(
|
||||
new RegExp(
|
||||
`${defaultCharacterChatPath}(?:\\?image=msg_photo_paywall_001)?$`,
|
||||
),
|
||||
);
|
||||
expect(new URL(page.url()).pathname).toBe(defaultCharacterChatPath);
|
||||
await expect(page.getByRole("textbox", { name: "Message" })).toBeVisible();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user