Hide board number in flight details

This commit is contained in:
2026-05-19 16:12:09 +03:00
parent 9345eb162a
commit 80087ded8b
3 changed files with 15 additions and 18 deletions
@@ -67,22 +67,12 @@ describe("AircraftPanel", () => {
expect(screen.getByTestId("aircraft-panel")).toBeTruthy();
});
// §4.1.15.4: tail number (registration mark) in aircraft panel
it("4.1.15.4-TailNumber: renders tail number when aircraft.registration is present", () => {
it("TIRREDESIGN-29: omits tail number when aircraft.registration is present", () => {
const eq: IEquipmentFull = {
aircraft: { actual: { title: "Airbus A320", registration: "VP-BQS" } },
};
render(<AircraftPanel equipment={eq} />);
expect(screen.getByText("VP-BQS")).toBeTruthy();
// label key is AIRPLANE.TAIL-NUMBER (t mock returns key)
expect(screen.getByText("AIRPLANE.TAIL-NUMBER")).toBeTruthy();
});
it("4.1.15.4-TailNumber-Absent: omits tail-number row when registration is not present", () => {
const eq: IEquipmentFull = {
aircraft: { actual: { title: "Airbus A320" } },
};
render(<AircraftPanel equipment={eq} />);
expect(screen.queryByText("VP-BQS")).toBeNull();
expect(screen.queryByText("AIRPLANE.TAIL-NUMBER")).toBeNull();
});
@@ -112,11 +112,6 @@ export const AircraftPanel: FC<AircraftPanelProps> = ({
className?: string;
}> = [];
if (aircraft?.name) props.push({ label: t("AIRPLANE.NAME"), value: aircraft.name });
// §4.1.15.4: tail number (registration mark, e.g. "VP-BQS") from the
// aircraft.actual.registration field. Shown when present.
if (aircraft?.registration) {
props.push({ label: t("AIRPLANE.TAIL-NUMBER"), value: aircraft.registration });
}
if (total > 0) props.push({ label: t("AIRPLANE.SEATS-TOTAL"), value: total });
if (economy > 0) props.push({ label: t("AIRPLANE.SEATS-ECONOMY"), value: economy });
if (comfort > 0) props.push({ label: t("AIRPLANE.SEATS-COMFORT"), value: comfort });
+13 -1
View File
@@ -8,6 +8,9 @@ import { nextOnlineboardDetailsFixture } from "./helpers/onlineboard-fixtures";
// title under "Борт" must be a clickable external link that opens in a new tab.
// Angular renders:
// http://www.aeroflot.ru/cms/{language}/flight/plane_park
//
// TIRREDESIGN-29 — Angular does not show the aircraft tail/board number in
// this online-board details card, even when the API payload contains it.
const FIXTURE_DIR = path.resolve(
path.dirname(fileURLToPath(import.meta.url)),
@@ -24,12 +27,19 @@ test("Onlineboard details aircraft title opens Aeroflot plane park in a new tab"
consoleMessages,
}) => {
const details = nextOnlineboardDetailsFixture(onlineboardDetails);
const detailsPayload = JSON.parse(details.body);
detailsPayload.data.routes[0].leg.equipment.aircraft.actual = {
type: "SU9",
title: "Sukhoi SuperJet 100",
registration: "89104",
name: "Ессентуки",
};
await page.route("**/api/flights/v1.1/ru/onlineboard/details?**", async (route) => {
await route.fulfill({
status: 200,
contentType: "application/json",
body: details.body,
body: JSON.stringify(detailsPayload),
});
});
@@ -49,6 +59,8 @@ test("Onlineboard details aircraft title opens Aeroflot plane park in a new tab"
const link = aircraftRow.locator("a.details-row__subtitle-link");
await expect(link).toHaveText("Sukhoi SuperJet 100");
await expect(aircraftRow.getByText("Бортовой номер")).toHaveCount(0);
await expect(aircraftRow.getByText("89104")).toHaveCount(0);
await expect(link).toHaveAttribute(
"href",
"http://www.aeroflot.ru/cms/ru/flight/plane_park",