Files
cozsweet-frontend-nextjs/e2e/specs/mock/chat/commercial-action-navigation.spec.ts
T

32 lines
947 B
TypeScript

import { expect, test } from "@playwright/test";
import { mockCoreApis } from "@e2e/fixtures/api-mocks";
import {
clearBrowserState,
enterChatFromSplash,
} from "@e2e/fixtures/test-helpers";
test.beforeEach(async ({ baseURL, context, page }) => {
await clearBrowserState(context, page, baseURL);
await mockCoreApis(page);
});
test("renders a backend commercial action and opens the private zone", async ({
page,
}) => {
await enterChatFromSplash(page);
const input = page.getByRole("textbox", { name: "Message" });
await expect(input).toBeEnabled();
await input.fill("private album offer test");
await input.press("Enter");
const offer = page.getByLabel("Open private zone");
await expect(offer).toContainText(
"There are more private photos waiting for you.",
);
await offer.getByRole("button", { name: "Open private zone" }).click();
await expect(page).toHaveURL(/\/characters\/elio\/private-zone$/);
});