refactor(e2e): organize fixtures by feature
This commit is contained in:
@@ -10,6 +10,10 @@ import {
|
||||
signInWithEmailAndOpenChat,
|
||||
} from "@e2e/fixtures/test-helpers";
|
||||
|
||||
const paidImageOverlayUrl = new RegExp(
|
||||
`/chat\\?image=${paidImageMessageId}$`,
|
||||
);
|
||||
|
||||
test.beforeEach(async ({ baseURL, context, page }) => {
|
||||
await clearBrowserState(context, page, baseURL);
|
||||
await mockCoreApis(page, {
|
||||
@@ -29,7 +33,7 @@ test("user sees insufficient credits when unlocking a paid image from fullscreen
|
||||
await expect(paidImageButton).toBeVisible({ timeout: 10_000 });
|
||||
|
||||
await paidImageButton.click();
|
||||
await expect(page).toHaveURL(new RegExp(`/chat/image/${paidImageMessageId}$`));
|
||||
await expect(page).toHaveURL(paidImageOverlayUrl);
|
||||
|
||||
const lockedImageDialog = page.getByRole("dialog", {
|
||||
name: "Locked fullscreen image",
|
||||
|
||||
@@ -21,7 +21,7 @@ test("user sees insufficient credits when unlocking a paid voice message and can
|
||||
}) => {
|
||||
await signInWithEmailAndOpenChat(page);
|
||||
await expect(
|
||||
page.getByText("Unlock this voice message with credits."),
|
||||
page.getByText("Elio has a locked voice message for you."),
|
||||
).toBeVisible({ timeout: 10_000 });
|
||||
|
||||
const unlockButton = page.getByRole("button", {
|
||||
|
||||
Reference in New Issue
Block a user