61 lines
1.7 KiB
TypeScript
61 lines
1.7 KiB
TypeScript
import { test, expect } from "./fixtures/console-gate";
|
|
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const FIXTURE_DIR = path.resolve(
|
|
path.dirname(fileURLToPath(import.meta.url)),
|
|
"../fixtures/api",
|
|
);
|
|
|
|
const baseDetails = JSON.parse(
|
|
fs.readFileSync(path.join(FIXTURE_DIR, "onlineboard-details.json"), "utf8"),
|
|
);
|
|
|
|
test("TIRREDESIGN-7: onlineboard details shows non-scheduled transition even when isActual=false", async ({
|
|
page,
|
|
consoleMessages,
|
|
}) => {
|
|
const details = structuredClone(baseDetails);
|
|
const flight = details.data.routes[0];
|
|
const leg = flight.leg;
|
|
|
|
flight.status = "InFlight";
|
|
leg.status = "InFlight";
|
|
leg.transition = {
|
|
registration: {
|
|
start: {
|
|
utc: "2026-05-14T07:00:00Z",
|
|
local: "2026-05-14T10:00:00+03:00",
|
|
dayChange: { value: 0, title: "" },
|
|
localTime: "10:00",
|
|
tzOffset: 180,
|
|
},
|
|
end: {
|
|
utc: "2026-05-14T07:30:00Z",
|
|
local: "2026-05-14T10:30:00+03:00",
|
|
dayChange: { value: 0, title: "" },
|
|
localTime: "10:30",
|
|
tzOffset: 180,
|
|
},
|
|
status: "InProgress",
|
|
isActual: false,
|
|
},
|
|
};
|
|
|
|
await page.route("**/api/flights/v1.1/ru/onlineboard/details?**", async (route) => {
|
|
await route.fulfill({
|
|
status: 200,
|
|
contentType: "application/json",
|
|
body: JSON.stringify(details),
|
|
});
|
|
});
|
|
|
|
await page.goto("/ru-ru/onlineboard/SU6951-20260514");
|
|
|
|
const registrationRow = page.locator('[data-testid="details-row-registration"]');
|
|
await expect(registrationRow).toBeVisible({ timeout: 15000 });
|
|
await expect(registrationRow.getByText("Регистрация")).toBeVisible();
|
|
await expect(registrationRow.getByText("Идет")).toBeVisible();
|
|
});
|