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:
@@ -10,7 +10,7 @@
|
||||
import { describe, it, expect, vi, beforeEach } from "vitest";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
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";
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -49,7 +49,7 @@ const FLIGHT_ID: IParsedFlightId = {
|
||||
date: "20250115",
|
||||
};
|
||||
|
||||
function setupWithFlight(flight = DIRECT_FLIGHT) {
|
||||
function setupWithFlight(flight: ISimpleFlight = DIRECT_FLIGHT) {
|
||||
mockUseFlightDetails.mockReturnValue({
|
||||
flight,
|
||||
loading: false,
|
||||
|
||||
Reference in New Issue
Block a user