Fix type error in flight-details integration test

Use ISimpleFlight union type for setupWithFlight parameter to accept
both IDirectFlight and IMultiLegFlight fixtures.
This commit is contained in:
2026-04-15 08:56:42 +03:00
parent 008bc3339c
commit 969281c71a
@@ -10,7 +10,7 @@
import { describe, it, expect, vi, beforeEach } from "vitest"; import { describe, it, expect, vi, beforeEach } from "vitest";
import { render, screen } from "@testing-library/react"; import { render, screen } from "@testing-library/react";
import { OnlineBoardDetailsPage } from "@/features/online-board/components/OnlineBoardDetailsPage.js"; import { OnlineBoardDetailsPage } from "@/features/online-board/components/OnlineBoardDetailsPage.js";
import type { IParsedFlightId } from "@/features/online-board/types.js"; import type { IParsedFlightId, ISimpleFlight } from "@/features/online-board/types.js";
import { DIRECT_FLIGHT, MULTI_LEG_FLIGHT } from "./fixtures.js"; import { DIRECT_FLIGHT, MULTI_LEG_FLIGHT } from "./fixtures.js";
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -49,7 +49,7 @@ const FLIGHT_ID: IParsedFlightId = {
date: "20250115", date: "20250115",
}; };
function setupWithFlight(flight = DIRECT_FLIGHT) { function setupWithFlight(flight: ISimpleFlight = DIRECT_FLIGHT) {
mockUseFlightDetails.mockReturnValue({ mockUseFlightDetails.mockReturnValue({
flight, flight,
loading: false, loading: false,