Mirror Angular shell placeholders

This commit is contained in:
2026-05-20 16:30:07 +03:00
parent ee08795811
commit 1832b80374
6 changed files with 136 additions and 544 deletions
+18 -25
View File
@@ -1,7 +1,7 @@
import { test, expect } from "./fixtures/console-gate";
test.describe("TIRREDESIGN-30 — standalone header and footer", () => {
test("Russian standalone pages render Aeroflot shell around React content", async ({
test("Russian standalone pages render Angular-style Aeroflot shell placeholders", async ({
page,
consoleMessages,
}) => {
@@ -9,38 +9,31 @@ test.describe("TIRREDESIGN-30 — standalone header and footer", () => {
await page.waitForLoadState("domcontentloaded");
const header = page.getByTestId("standalone-header");
await expect(header).toBeVisible();
await expect(header).toContainText("Купить билет");
await expect(header).toContainText("Аэроэкспресс");
await expect(header).toContainText("Тестовая версия");
await expect(header.locator('afl-component.header[data-component="Header"]')).toHaveCount(1);
await expect(page.locator("#main-content h1")).toHaveText("Страница проверки");
await expect(page.locator("h1")).toHaveText("Страница проверки");
const footer = page.getByTestId("standalone-footer");
await expect(footer).toBeVisible();
await expect(footer).toContainText("Контакты");
await expect(footer).toContainText("8 (800) 444-55-55");
await expect(footer).toContainText("© Авиакомпания «Аэрофлот» 2008-2026");
await expect(page.locator('afl-component.footer[data-component="Footer"]')).toHaveCount(1);
await expect(
page.locator('.banner--top afl-component[data-component="BannersOffers"] afl-item[data-item="positionId"]'),
).toHaveText("383");
await expect(
page.locator('.banner--bottom afl-component[data-component="BannersOffers"] afl-item[data-item="positionId"]'),
).toHaveText("384");
});
test("English standalone pages localize shell chrome", async ({
test("local dev uses Angular-style placeholder loader mode", async ({
page,
consoleMessages,
}) => {
await page.goto("/en/smoke");
await page.goto("/ru/smoke");
await page.waitForLoadState("domcontentloaded");
const header = page.getByTestId("standalone-header");
await expect(header).toBeVisible();
await expect(header).toContainText("Book a flight");
await expect(header).toContainText("Aeroexpress");
await expect(header).toContainText("Test version");
await expect(page.locator("#main-content h1")).toHaveText("Smoke test page");
const footer = page.getByTestId("standalone-footer");
await expect(footer).toBeVisible();
await expect(footer).toContainText("Contacts");
await expect(footer).toContainText("© Aeroflot 2008-2026");
await expect(
page.locator('meta[name="aeroflot-shell-loader"][content="placeholder"]'),
).toHaveCount(1);
await expect(
page.locator('script[src="https://www.aeroflot.ru/frontend/static/js/afl-frontend-loader.bundle.js"]'),
).toHaveCount(0);
});
});