From 80087ded8bf9d0e294df5bbb730be36166b9e29a Mon Sep 17 00:00:00 2001 From: gnezim Date: Tue, 19 May 2026 16:12:09 +0300 Subject: [PATCH] Hide board number in flight details --- .../details-panels/AircraftPanel.test.tsx | 14 ++------------ .../components/details-panels/AircraftPanel.tsx | 5 ----- tests/e2e/onlineboard-aircraft-link.spec.ts | 14 +++++++++++++- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/features/online-board/components/details-panels/AircraftPanel.test.tsx b/src/features/online-board/components/details-panels/AircraftPanel.test.tsx index dbb3eef8..619b2f00 100644 --- a/src/features/online-board/components/details-panels/AircraftPanel.test.tsx +++ b/src/features/online-board/components/details-panels/AircraftPanel.test.tsx @@ -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(); - 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(); + expect(screen.queryByText("VP-BQS")).toBeNull(); expect(screen.queryByText("AIRPLANE.TAIL-NUMBER")).toBeNull(); }); diff --git a/src/features/online-board/components/details-panels/AircraftPanel.tsx b/src/features/online-board/components/details-panels/AircraftPanel.tsx index 32f8d880..0d9c25f5 100644 --- a/src/features/online-board/components/details-panels/AircraftPanel.tsx +++ b/src/features/online-board/components/details-panels/AircraftPanel.tsx @@ -112,11 +112,6 @@ export const AircraftPanel: FC = ({ 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 }); diff --git a/tests/e2e/onlineboard-aircraft-link.spec.ts b/tests/e2e/onlineboard-aircraft-link.spec.ts index b91d319c..4a75adf8 100644 --- a/tests/e2e/onlineboard-aircraft-link.spec.ts +++ b/tests/e2e/onlineboard-aircraft-link.spec.ts @@ -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",