Fix share button URL parity

This commit is contained in:
2026-05-28 12:55:34 +03:00
parent 5e33debfb4
commit 02ee9b5cfd
15 changed files with 338 additions and 46 deletions
+46
View File
@@ -0,0 +1,46 @@
import { test, expect } from "./fixtures/console-gate";
import { routeScheduleVvoMjzFixtures } from "./helpers/api-fixtures";
import { vvoMjzDetailsUrl } from "./helpers/dates";
test("TIRREDESIGN-32: schedule share button uses clean details URL", async ({
page,
consoleMessages,
}) => {
const detailsUrl = vvoMjzDetailsUrl();
const cleanPath = detailsUrl.split("?")[0] ?? detailsUrl;
await routeScheduleVvoMjzFixtures(page);
await page.goto(detailsUrl);
await expect(page.getByTestId("schedule-details")).toBeVisible({
timeout: 15000,
});
await page.getByTestId("share-button").first().click();
const vk = page.getByTestId("share-vk");
await expect(vk).toBeVisible();
const href = await vk.getAttribute("href");
expect(href).toBeTruthy();
const decoded = decodeURIComponent(href ?? "");
expect(decoded).toContain(`${new URL(page.url()).origin}${cleanPath}`);
expect(decoded).not.toContain("request=schedule-route");
});
test("TIRREDESIGN-32: China locale shows Weibo-only share panel", async ({
page,
consoleMessages,
}) => {
const detailsUrl = vvoMjzDetailsUrl().replace("/ru-ru/", "/cn-zh/");
await routeScheduleVvoMjzFixtures(page);
await page.goto(detailsUrl);
await expect(page.getByTestId("schedule-details")).toBeVisible({
timeout: 15000,
});
await page.getByTestId("share-button").first().click();
await expect(page.getByTestId("share-weibo")).toBeVisible();
await expect(page.getByTestId("share-facebook")).toHaveCount(0);
await expect(page.getByTestId("share-vk")).toHaveCount(0);
await expect(page.getByTestId("share-twitter")).toHaveCount(0);
});