= {};
for (let i = keys.length; i--; ) {
- const k = keys[i]!;
- const v = values[i]!;
+ const k = keys[i];
+ const v = values[i];
+ if (k === undefined || v === undefined) continue;
full[k.toUpperCase()] = v.toUpperCase();
full[k] = v;
}
diff --git a/src/ui/flights/FlightCard.test.tsx b/src/ui/flights/FlightCard.test.tsx
index a89e79f0..9a5572a8 100644
--- a/src/ui/flights/FlightCard.test.tsx
+++ b/src/ui/flights/FlightCard.test.tsx
@@ -51,25 +51,6 @@ function makeTimesSet(local: string, dayChangeValue = 0) {
};
}
-function makeStation(
- airportCode: string,
- city: string,
- airport: string,
- terminal?: string,
-) {
- return {
- scheduled: {
- airport,
- airportCode,
- city,
- cityCode: airportCode,
- countryCode: "RU",
- },
- terminal,
- times: undefined as never, // overridden per dep/arr below
- };
-}
-
function makeLeg(overrides: {
depCode?: string;
depCity?: string;
@@ -426,11 +407,10 @@ describe("4.1.23 — Уточняется fallback for missing station fields",
it("T23-fallback: shows SHARED.UNSPECIFIED fallback when departure city is empty string", () => {
render(
);
- // The useCityName mock returns "" for unknown codes when city is empty
- // StationDisplay should render "SHARED.UNSPECIFIED" for empty city
+ // The useCityName mock returns "" for unknown codes when city is empty.
+ // StationDisplay should emit either SHARED.UNSPECIFIED or real text — at
+ // minimum, at least one station element is rendered.
const stationEls = document.querySelectorAll(".station__city--bold");
- const emptyCity = Array.from(stationEls).find((el) => el.textContent === "" || el.textContent === "SHARED.UNSPECIFIED");
- // At minimum, no empty-string content is emitted without fallback
expect(stationEls.length).toBeGreaterThan(0);
});
diff --git a/src/ui/flights/TimeGroup.tsx b/src/ui/flights/TimeGroup.tsx
index 1eae1204..2d5ef15f 100644
--- a/src/ui/flights/TimeGroup.tsx
+++ b/src/ui/flights/TimeGroup.tsx
@@ -81,14 +81,14 @@ export const TimeGroup: FC
= ({
{label ?
{label} : null}
- {hasDelay ? (
+ {hasDelay && actual !== undefined ? (
<>
{actualTime}
{actBadge ? (
{actBadge}
@@ -99,7 +99,7 @@ export const TimeGroup: FC = ({
{schedBadge ? (
{schedBadge}
@@ -112,7 +112,7 @@ export const TimeGroup: FC = ({
{schedBadge ? (
{schedBadge}