From 4b58ea0e996fd249cb3b1e1b4e488a3328651078 Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Tue, 27 Aug 2024 16:19:34 -0400 Subject: [PATCH] refactor: Explicitly export vehicleFactory --- assets/tests/components/app.test.tsx | 2 +- assets/tests/components/groupedAutocomplete.test.tsx | 2 +- assets/tests/components/incomingBox.test.tsx | 2 +- assets/tests/components/ladder.test.tsx | 2 +- assets/tests/components/ladderPage.test.tsx | 2 +- assets/tests/components/lateView.test.tsx | 2 +- assets/tests/components/map.test.tsx | 2 +- assets/tests/components/mapMarkers.test.tsx | 2 +- assets/tests/components/mapPage.test.tsx | 3 ++- assets/tests/components/mapPage/mapDisplay.test.tsx | 3 ++- .../tests/components/mapPage/searchResultsByCategory.test.tsx | 2 +- .../tests/components/mapPage/vehiclePropertiesCard.test.tsx | 2 +- assets/tests/components/propertiesList.test.tsx | 2 +- assets/tests/components/propertiesPanel.test.tsx | 2 +- assets/tests/components/propertiesPanel/header.test.tsx | 2 +- assets/tests/components/propertiesPanel/miniMap.test.tsx | 2 +- assets/tests/components/propertiesPanel/minischedule.test.tsx | 2 +- .../propertiesPanel/staleDataPropertiesPanel.test.tsx | 2 +- assets/tests/components/propertiesPanel/tab_panels.test.tsx | 2 +- .../propertiesPanel/vehiclePropertiesPanel.test.tsx | 2 +- assets/tests/components/rightPanel.test.tsx | 2 +- assets/tests/components/routeLadder.test.tsx | 2 +- assets/tests/components/routeVariantName.test.tsx | 2 +- assets/tests/components/searchForm.test.tsx | 2 +- assets/tests/components/searchResults.test.tsx | 2 +- assets/tests/components/shuttlePicker.test.tsx | 2 +- assets/tests/components/swingsView.test.tsx | 2 +- assets/tests/components/vehicleRouteSummary.test.tsx | 3 ++- assets/tests/contexts/notificationsContext.test.tsx | 2 +- assets/tests/factories/pagePanelStateFactory.ts | 2 +- assets/tests/factories/vehicle.ts | 4 +--- assets/tests/helpers/vehicleLabel.test.ts | 2 +- assets/tests/hooks/useMostRecentVehicleById.test.ts | 2 +- assets/tests/hooks/usePanelState.test.tsx | 2 +- assets/tests/hooks/useSearchResultsByCategory.test.ts | 2 +- assets/tests/models/vehicle.test.ts | 2 +- assets/tests/models/vehicleStatus.test.ts | 2 +- assets/tests/models/vehiclesByPosition.test.ts | 2 +- assets/tests/state.test.ts | 2 +- assets/tests/state/pagePanelState.test.ts | 2 +- assets/tests/util/operatorFormatting.test.ts | 2 +- 41 files changed, 44 insertions(+), 43 deletions(-) diff --git a/assets/tests/components/app.test.tsx b/assets/tests/components/app.test.tsx index 00b1c3964..42f33a9d2 100644 --- a/assets/tests/components/app.test.tsx +++ b/assets/tests/components/app.test.tsx @@ -18,7 +18,7 @@ import { ConnectionStatus } from "../../src/hooks/useSocket" import { initialState } from "../../src/state" import routeTabFactory from "../factories/routeTab" import useVehicles from "../../src/hooks/useVehicles" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import { MemoryRouter } from "react-router-dom" import { vehiclePropertiesPanelHeader } from "../testHelpers/selectors/components/vehiclePropertiesPanel" import stateFactory from "../factories/applicationState" diff --git a/assets/tests/components/groupedAutocomplete.test.tsx b/assets/tests/components/groupedAutocomplete.test.tsx index 84b1d733c..c95a0cf5d 100644 --- a/assets/tests/components/groupedAutocomplete.test.tsx +++ b/assets/tests/components/groupedAutocomplete.test.tsx @@ -18,7 +18,7 @@ import { SearchProperties, searchPropertyDisplayConfig, } from "../../src/models/searchQuery" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import { formatOperatorNameFromVehicle } from "../../src/util/operatorFormatting" import { listbox, diff --git a/assets/tests/components/incomingBox.test.tsx b/assets/tests/components/incomingBox.test.tsx index 6ad935b98..f36c85615 100644 --- a/assets/tests/components/incomingBox.test.tsx +++ b/assets/tests/components/incomingBox.test.tsx @@ -7,7 +7,7 @@ import { LadderDirection } from "../../src/models/ladderDirection" import { Ghost, VehicleInScheduledService } from "../../src/realtime" import { initialState } from "../../src/state" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import ghostFactory from "../factories/ghost" import { render } from "@testing-library/react" import userEvent from "@testing-library/user-event" diff --git a/assets/tests/components/ladder.test.tsx b/assets/tests/components/ladder.test.tsx index 78772ec5d..717ef53ff 100644 --- a/assets/tests/components/ladder.test.tsx +++ b/assets/tests/components/ladder.test.tsx @@ -13,7 +13,7 @@ import { import { Timepoint } from "../../src/schedule.d" import { initialState } from "../../src/state" import * as dateTime from "../../src/util/dateTime" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import ghostFactory from "../factories/ghost" import { render } from "@testing-library/react" import userEvent from "@testing-library/user-event" diff --git a/assets/tests/components/ladderPage.test.tsx b/assets/tests/components/ladderPage.test.tsx index ed1bb2168..a0ff9c00c 100644 --- a/assets/tests/components/ladderPage.test.tsx +++ b/assets/tests/components/ladderPage.test.tsx @@ -25,7 +25,7 @@ import { import { tagManagerEvent } from "../../src/helpers/googleTagManager" import routeFactory from "../factories/route" import routeTabFactory, { routeTabPresetFactory } from "../factories/routeTab" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import userEvent from "@testing-library/user-event" import { VehiclesByRouteIdProvider } from "../../src/contexts/vehiclesByRouteIdContext" import stateFactory from "../factories/applicationState" diff --git a/assets/tests/components/lateView.test.tsx b/assets/tests/components/lateView.test.tsx index 8b61f5285..026155601 100644 --- a/assets/tests/components/lateView.test.tsx +++ b/assets/tests/components/lateView.test.tsx @@ -10,7 +10,7 @@ import { StateDispatchProvider } from "../../src/contexts/stateDispatchContext" import { VehiclesByRouteIdProvider } from "../../src/contexts/vehiclesByRouteIdContext" import { State } from "../../src/state" import blockWaiverFactory from "../factories/blockWaiver" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import ghostFactory from "../factories/ghost" import { tagManagerEvent } from "../../src/helpers/googleTagManager" import userEvent from "@testing-library/user-event" diff --git a/assets/tests/components/map.test.tsx b/assets/tests/components/map.test.tsx index e55ce8439..ec9be887d 100644 --- a/assets/tests/components/map.test.tsx +++ b/assets/tests/components/map.test.tsx @@ -21,7 +21,7 @@ import Map, { } from "../../src/components/map" import { autoCenter } from "../../src/components/map/follower" import { TrainVehicle, VehicleInScheduledService } from "../../src/realtime" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import stopFactory from "../factories/stop" import userEvent from "@testing-library/user-event" diff --git a/assets/tests/components/mapMarkers.test.tsx b/assets/tests/components/mapMarkers.test.tsx index d4f9340ac..e69b65ba8 100644 --- a/assets/tests/components/mapMarkers.test.tsx +++ b/assets/tests/components/mapMarkers.test.tsx @@ -10,7 +10,7 @@ import { VehicleMarker, } from "../../src/components/mapMarkers" import stopFactory from "../factories/stop" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import trainVehicleFactory from "../factories/trainVehicle" import { render, screen } from "@testing-library/react" import React from "react" diff --git a/assets/tests/components/mapPage.test.tsx b/assets/tests/components/mapPage.test.tsx index b9330a8f0..7c8145af0 100644 --- a/assets/tests/components/mapPage.test.tsx +++ b/assets/tests/components/mapPage.test.tsx @@ -42,7 +42,8 @@ import { searchQueryVehicleFactory, } from "../factories/searchQuery" import stopFactory from "../factories/stop" -import vehicleFactory, { +import { + vehicleFactory, randomLocationVehicle, shuttleFactory, } from "../factories/vehicle" diff --git a/assets/tests/components/mapPage/mapDisplay.test.tsx b/assets/tests/components/mapPage/mapDisplay.test.tsx index df58b6e6a..9e910ad62 100644 --- a/assets/tests/components/mapPage/mapDisplay.test.tsx +++ b/assets/tests/components/mapPage/mapDisplay.test.tsx @@ -28,7 +28,8 @@ import routeFactory from "../../factories/route" import { routePatternFactory } from "../../factories/routePattern" import { runIdFactory } from "../../factories/run" import stopFactory from "../../factories/stop" -import vehicleFactory, { +import { + vehicleFactory, randomLocationVehicle, shuttleFactory, } from "../../factories/vehicle" diff --git a/assets/tests/components/mapPage/searchResultsByCategory.test.tsx b/assets/tests/components/mapPage/searchResultsByCategory.test.tsx index 7c5ec84c3..75cf558cf 100644 --- a/assets/tests/components/mapPage/searchResultsByCategory.test.tsx +++ b/assets/tests/components/mapPage/searchResultsByCategory.test.tsx @@ -10,7 +10,7 @@ import React from "react" import { render, screen, within } from "@testing-library/react" import "@testing-library/jest-dom/jest-globals" import SearchResultsByCategory from "../../../src/components/mapPage/searchResultsByCategory" -import vehicleFactory from "../../factories/vehicle" +import { vehicleFactory } from "../../factories/vehicle" import { StateDispatchProvider } from "../../../src/contexts/stateDispatchContext" import stateFactory from "../../factories/applicationState" import { searchPageStateFactory } from "../../factories/searchPageState" diff --git a/assets/tests/components/mapPage/vehiclePropertiesCard.test.tsx b/assets/tests/components/mapPage/vehiclePropertiesCard.test.tsx index 2edbe2960..74dbecd19 100644 --- a/assets/tests/components/mapPage/vehiclePropertiesCard.test.tsx +++ b/assets/tests/components/mapPage/vehiclePropertiesCard.test.tsx @@ -3,7 +3,7 @@ import React from "react" import { render, screen, waitFor } from "@testing-library/react" import "@testing-library/jest-dom/jest-globals" import * as dateTime from "../../../src/util/dateTime" -import vehicleFactory, { shuttleFactory } from "../../factories/vehicle" +import { vehicleFactory, shuttleFactory } from "../../factories/vehicle" import routeFactory from "../../factories/route" import VehiclePropertiesCard from "../../../src/components/mapPage/vehiclePropertiesCard" import { useNearestIntersectionFetchResult } from "../../../src/hooks/useNearestIntersection" diff --git a/assets/tests/components/propertiesList.test.tsx b/assets/tests/components/propertiesList.test.tsx index 01885e611..67b8267f5 100644 --- a/assets/tests/components/propertiesList.test.tsx +++ b/assets/tests/components/propertiesList.test.tsx @@ -9,7 +9,7 @@ import PropertiesList, { } from "../../src/components/propertiesList" import { Ghost, VehicleInScheduledService } from "../../src/realtime" import * as dateTime from "../../src/util/dateTime" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import ghostFactory from "../factories/ghost" import { render } from "@testing-library/react" diff --git a/assets/tests/components/propertiesPanel.test.tsx b/assets/tests/components/propertiesPanel.test.tsx index bf80db00f..784891a17 100644 --- a/assets/tests/components/propertiesPanel.test.tsx +++ b/assets/tests/components/propertiesPanel.test.tsx @@ -17,7 +17,7 @@ import { RoutesProvider } from "../../src/contexts/routesContext" import { Ghost, Vehicle, VehicleInScheduledService } from "../../src/realtime" import { Route } from "../../src/schedule" import * as dateTime from "../../src/util/dateTime" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import ghostFactory from "../factories/ghost" import routeFactory from "../factories/route" import useVehicleForId from "../../src/hooks/useVehicleForId" diff --git a/assets/tests/components/propertiesPanel/header.test.tsx b/assets/tests/components/propertiesPanel/header.test.tsx index 81043b111..11420ce2f 100644 --- a/assets/tests/components/propertiesPanel/header.test.tsx +++ b/assets/tests/components/propertiesPanel/header.test.tsx @@ -18,7 +18,7 @@ import { } from "../../../src/realtime" import { Route } from "../../../src/schedule" import { initialState } from "../../../src/state" -import vehicleFactory from "../../factories/vehicle" +import { vehicleFactory } from "../../factories/vehicle" import ghostFactory from "../../factories/ghost" import routeFactory from "../../factories/route" import routeTabFactory from "../../factories/routeTab" diff --git a/assets/tests/components/propertiesPanel/miniMap.test.tsx b/assets/tests/components/propertiesPanel/miniMap.test.tsx index 8659d33c3..e53b363f6 100644 --- a/assets/tests/components/propertiesPanel/miniMap.test.tsx +++ b/assets/tests/components/propertiesPanel/miniMap.test.tsx @@ -8,7 +8,7 @@ import { } from "@jest/globals" import React from "react" import { VehicleInScheduledService } from "../../../src/realtime" -import vehicleFactory from "../../factories/vehicle" +import { vehicleFactory } from "../../factories/vehicle" import { render, screen } from "@testing-library/react" import "@testing-library/jest-dom/jest-globals" import MiniMap from "../../../src/components/propertiesPanel/miniMap" diff --git a/assets/tests/components/propertiesPanel/minischedule.test.tsx b/assets/tests/components/propertiesPanel/minischedule.test.tsx index 58b883cbf..232d6071a 100644 --- a/assets/tests/components/propertiesPanel/minischedule.test.tsx +++ b/assets/tests/components/propertiesPanel/minischedule.test.tsx @@ -21,7 +21,7 @@ import { initialState } from "../../../src/state" import pieceFactory from "../../factories/piece" import { RunFactory } from "../../factories/run" import { DeadheadTripFactory, TripFactory } from "../../factories/trip" -import vehicleFactory from "../../factories/vehicle" +import { vehicleFactory } from "../../factories/vehicle" import { mockUseStateOnce } from "../../testHelpers/mockHelpers" jest.mock("../../../src/hooks/useMinischedule", () => ({ diff --git a/assets/tests/components/propertiesPanel/staleDataPropertiesPanel.test.tsx b/assets/tests/components/propertiesPanel/staleDataPropertiesPanel.test.tsx index a8c72001f..5bd533210 100644 --- a/assets/tests/components/propertiesPanel/staleDataPropertiesPanel.test.tsx +++ b/assets/tests/components/propertiesPanel/staleDataPropertiesPanel.test.tsx @@ -2,7 +2,7 @@ import { describe, test, expect, jest } from "@jest/globals" import React from "react" import { render, screen } from "@testing-library/react" import StaleDataPropertiesPanel from "../../../src/components/propertiesPanel/staleDataPropertiesPanel" -import vehicleFactory from "../../factories/vehicle" +import { vehicleFactory } from "../../factories/vehicle" import blockWaiverFactory from "../../factories/blockWaiver" import { useMinischeduleBlock, diff --git a/assets/tests/components/propertiesPanel/tab_panels.test.tsx b/assets/tests/components/propertiesPanel/tab_panels.test.tsx index fea743d2a..6ca7fbd45 100644 --- a/assets/tests/components/propertiesPanel/tab_panels.test.tsx +++ b/assets/tests/components/propertiesPanel/tab_panels.test.tsx @@ -3,7 +3,7 @@ import React from "react" import { render } from "@testing-library/react" import TabPanels from "../../../src/components/propertiesPanel/tabPanels" import { VehicleInScheduledService } from "../../../src/realtime" -import vehicleFactory from "../../factories/vehicle" +import { vehicleFactory } from "../../factories/vehicle" const vehicle: VehicleInScheduledService = vehicleFactory.build({ id: "vehicleId", diff --git a/assets/tests/components/propertiesPanel/vehiclePropertiesPanel.test.tsx b/assets/tests/components/propertiesPanel/vehiclePropertiesPanel.test.tsx index 19b8b3287..5a8665604 100644 --- a/assets/tests/components/propertiesPanel/vehiclePropertiesPanel.test.tsx +++ b/assets/tests/components/propertiesPanel/vehiclePropertiesPanel.test.tsx @@ -17,7 +17,7 @@ import { } from "../../../src/realtime" import { Route } from "../../../src/schedule" import * as dateTime from "../../../src/util/dateTime" -import vehicleFactory, { invalidVehicleFactory } from "../../factories/vehicle" +import { vehicleFactory, invalidVehicleFactory } from "../../factories/vehicle" import { render, screen } from "@testing-library/react" import "@testing-library/jest-dom/jest-globals" import { TabMode } from "../../../src/components/propertiesPanel/tabPanels" diff --git a/assets/tests/components/rightPanel.test.tsx b/assets/tests/components/rightPanel.test.tsx index 0874cc21c..882959d0d 100644 --- a/assets/tests/components/rightPanel.test.tsx +++ b/assets/tests/components/rightPanel.test.tsx @@ -8,7 +8,7 @@ import RightPanel from "../../src/components/rightPanel" import * as dateTime from "../../src/util/dateTime" import ghostFactory from "../factories/ghost" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import { RunFactory } from "../factories/run" import { OpenView } from "../../src/state/pagePanelState" diff --git a/assets/tests/components/routeLadder.test.tsx b/assets/tests/components/routeLadder.test.tsx index 4af04b6ee..5714bb337 100644 --- a/assets/tests/components/routeLadder.test.tsx +++ b/assets/tests/components/routeLadder.test.tsx @@ -18,7 +18,7 @@ import { } from "../../src/realtime.d" import { Route } from "../../src/schedule.d" import { initialState } from "../../src/state" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import ghostFactory from "../factories/ghost" import routeFactory from "../factories/route" import userEvent from "@testing-library/user-event" diff --git a/assets/tests/components/routeVariantName.test.tsx b/assets/tests/components/routeVariantName.test.tsx index 92d304ab6..0117163f8 100644 --- a/assets/tests/components/routeVariantName.test.tsx +++ b/assets/tests/components/routeVariantName.test.tsx @@ -6,7 +6,7 @@ import routeFactory from "../factories/route" import { RouteVariantName } from "../../src/components/routeVariantName" import { RoutesProvider } from "../../src/contexts/routesContext" import { Route } from "../../src/schedule" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" describe("RouteVariantName", () => { test("renders for a vehicle with variant and headsign", () => { diff --git a/assets/tests/components/searchForm.test.tsx b/assets/tests/components/searchForm.test.tsx index b13f8594c..54dd88f54 100644 --- a/assets/tests/components/searchForm.test.tsx +++ b/assets/tests/components/searchForm.test.tsx @@ -36,7 +36,7 @@ import { option as autocompleteOption, } from "../testHelpers/selectors/components/groupedAutocomplete" import { useAutocompleteResults } from "../../src/hooks/useAutocompleteResults" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import { SearchPropertyQuery } from "../../src/models/searchQuery" import { formatOperatorName } from "../../src/util/operatorFormatting" import locationSearchSuggestionFactory from "../factories/locationSearchSuggestion" diff --git a/assets/tests/components/searchResults.test.tsx b/assets/tests/components/searchResults.test.tsx index 8224fe221..10823037b 100644 --- a/assets/tests/components/searchResults.test.tsx +++ b/assets/tests/components/searchResults.test.tsx @@ -15,7 +15,7 @@ import * as dateTime from "../../src/util/dateTime" import "@testing-library/jest-dom/jest-globals" import ghostFactory from "../factories/ghost" -import vehicleFactory, { shuttleFactory } from "../factories/vehicle" +import { vehicleFactory, shuttleFactory } from "../factories/vehicle" import { searchPageStateFactory } from "../factories/searchPageState" jest.mock("userTestGroups", () => ({ diff --git a/assets/tests/components/shuttlePicker.test.tsx b/assets/tests/components/shuttlePicker.test.tsx index adbd8eae2..70c1fe57c 100644 --- a/assets/tests/components/shuttlePicker.test.tsx +++ b/assets/tests/components/shuttlePicker.test.tsx @@ -18,7 +18,7 @@ import { selectShuttleRoute, selectShuttleRun, } from "../../src/state" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import { render } from "@testing-library/react" import userEvent from "@testing-library/user-event" diff --git a/assets/tests/components/swingsView.test.tsx b/assets/tests/components/swingsView.test.tsx index 0d2f234c3..c4b585d54 100644 --- a/assets/tests/components/swingsView.test.tsx +++ b/assets/tests/components/swingsView.test.tsx @@ -4,7 +4,7 @@ import { render } from "@testing-library/react" import "@testing-library/jest-dom/jest-globals" import renderer from "react-test-renderer" import ghostFactory from "../factories/ghost" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import routeFactory from "../factories/route" import swingFactory from "../factories/swing" import SwingsView from "../../src/components/swingsView" diff --git a/assets/tests/components/vehicleRouteSummary.test.tsx b/assets/tests/components/vehicleRouteSummary.test.tsx index a5d03294c..b3b5604c1 100644 --- a/assets/tests/components/vehicleRouteSummary.test.tsx +++ b/assets/tests/components/vehicleRouteSummary.test.tsx @@ -7,7 +7,8 @@ import { VehicleRouteSummary } from "../../src/components/vehicleRouteSummary" import { RoutesProvider } from "../../src/contexts/routesContext" import ghostFactory from "../factories/ghost" import routeFactory from "../factories/route" -import vehicleFactory, { +import { + vehicleFactory, invalidVehicleFactory, shuttleFactory, } from "../factories/vehicle" diff --git a/assets/tests/contexts/notificationsContext.test.tsx b/assets/tests/contexts/notificationsContext.test.tsx index 4a4f46142..b4a2458ff 100644 --- a/assets/tests/contexts/notificationsContext.test.tsx +++ b/assets/tests/contexts/notificationsContext.test.tsx @@ -10,7 +10,7 @@ import { StateDispatchProvider } from "../../src/contexts/stateDispatchContext" import useCurrentTime from "../../src/hooks/useCurrentTime" import { Notification, NotificationState } from "../../src/realtime.d" import { initialState } from "../../src/state" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import { tagManagerEvent } from "../../src/helpers/googleTagManager" import { useNotifications } from "../../src/hooks/useNotifications" import notificationFactory from "../factories/notification" diff --git a/assets/tests/factories/pagePanelStateFactory.ts b/assets/tests/factories/pagePanelStateFactory.ts index 8f66db59a..433ebc599 100644 --- a/assets/tests/factories/pagePanelStateFactory.ts +++ b/assets/tests/factories/pagePanelStateFactory.ts @@ -5,7 +5,7 @@ import { initialPageViewState, } from "../../src/state/pagePanelState" import { DeepPartial, Factory } from "fishery" -import vehicleFactory from "./vehicle" +import { vehicleFactory } from "./vehicle" class ViewFactory extends Factory { currentState(currentState: DeepPartial) { diff --git a/assets/tests/factories/vehicle.ts b/assets/tests/factories/vehicle.ts index 7cfd617b3..b23d3f9d6 100644 --- a/assets/tests/factories/vehicle.ts +++ b/assets/tests/factories/vehicle.ts @@ -93,9 +93,7 @@ export const centerLocationVehicle = randomLocationVehicle.params({ longitude: defaultCenter.lng, }) -const vehicleFactory = centerLocationVehicle - -export default vehicleFactory +export const vehicleFactory = centerLocationVehicle export const shuttleFactory = vehicleFactory.params({ isShuttle: true, diff --git a/assets/tests/helpers/vehicleLabel.test.ts b/assets/tests/helpers/vehicleLabel.test.ts index daeb232c6..f00550cf1 100644 --- a/assets/tests/helpers/vehicleLabel.test.ts +++ b/assets/tests/helpers/vehicleLabel.test.ts @@ -5,7 +5,7 @@ import vehicleLabel, { } from "../../src/helpers/vehicleLabel" import { VehicleInScheduledService } from "../../src/realtime" import { UserSettings, VehicleLabelSetting } from "../../src/userSettings" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import ghostFactory from "../factories/ghost" const vehicle: VehicleInScheduledService = vehicleFactory.build({ diff --git a/assets/tests/hooks/useMostRecentVehicleById.test.ts b/assets/tests/hooks/useMostRecentVehicleById.test.ts index 046069a6b..76e8511e7 100644 --- a/assets/tests/hooks/useMostRecentVehicleById.test.ts +++ b/assets/tests/hooks/useMostRecentVehicleById.test.ts @@ -3,7 +3,7 @@ import { makeMockSocket } from "../testHelpers/socketHelpers" import { renderHook } from "@testing-library/react" import useVehicleForId from "../../src/hooks/useVehicleForId" import useMostRecentVehicleById from "../../src/hooks/useMostRecentVehicleById" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import { Ghost, Vehicle, VehicleId } from "../../src/realtime" jest.mock("../../src/hooks/useVehicleForId", () => ({ diff --git a/assets/tests/hooks/usePanelState.test.tsx b/assets/tests/hooks/usePanelState.test.tsx index 1b0b74bef..4ea51d1f5 100644 --- a/assets/tests/hooks/usePanelState.test.tsx +++ b/assets/tests/hooks/usePanelState.test.tsx @@ -3,7 +3,7 @@ import { usePanelStateForViewState, usePanelStateFromStateDispatchContext, } from "../../src/hooks/usePanelState" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import { OpenView, PagePath, diff --git a/assets/tests/hooks/useSearchResultsByCategory.test.ts b/assets/tests/hooks/useSearchResultsByCategory.test.ts index 1c55e389e..ce235bfd8 100644 --- a/assets/tests/hooks/useSearchResultsByCategory.test.ts +++ b/assets/tests/hooks/useSearchResultsByCategory.test.ts @@ -2,7 +2,7 @@ import { jest, describe, test, expect, afterEach } from "@jest/globals" import { renderHook } from "@testing-library/react" import { useSearchResults } from "../../src/hooks/useSearchResults" import { makeMockSocket } from "../testHelpers/socketHelpers" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import useSearchResultsByCategory, { VehicleResultType, } from "../../src/hooks/useSearchResultsByCategory" diff --git a/assets/tests/models/vehicle.test.ts b/assets/tests/models/vehicle.test.ts index b99f756e0..57097df05 100644 --- a/assets/tests/models/vehicle.test.ts +++ b/assets/tests/models/vehicle.test.ts @@ -9,7 +9,7 @@ import { } from "../../src/models/vehicle" import { Ghost, VehicleInScheduledService } from "../../src/realtime" import * as dateTime from "../../src/util/dateTime" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import ghostFactory from "../factories/ghost" import routeFactory from "../factories/route" diff --git a/assets/tests/models/vehicleStatus.test.ts b/assets/tests/models/vehicleStatus.test.ts index 950ad9966..dafa73c42 100644 --- a/assets/tests/models/vehicleStatus.test.ts +++ b/assets/tests/models/vehicleStatus.test.ts @@ -10,7 +10,7 @@ import { defaultUserSettings, VehicleAdherenceColorsSetting, } from "../../src/userSettings" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" describe("onTimeStatus", () => { test("returns on-time", () => { diff --git a/assets/tests/models/vehiclesByPosition.test.ts b/assets/tests/models/vehiclesByPosition.test.ts index 790558e09..55cb1c17a 100644 --- a/assets/tests/models/vehiclesByPosition.test.ts +++ b/assets/tests/models/vehiclesByPosition.test.ts @@ -6,7 +6,7 @@ import { Ghost, VehicleInScheduledService, } from "../../src/realtime.d" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import ghostFactory from "../factories/ghost" describe("groupByPosition", () => { diff --git a/assets/tests/state.test.ts b/assets/tests/state.test.ts index 86f2f4f07..d8e7d540e 100644 --- a/assets/tests/state.test.ts +++ b/assets/tests/state.test.ts @@ -7,7 +7,7 @@ import { } from "../src/userSettings" import { RouteTab } from "../src/models/routeTab" -import vehicleFactory from "./factories/vehicle" +import { vehicleFactory } from "./factories/vehicle" import routeTabFactory from "./factories/routeTab" import stateFactory from "./factories/applicationState" import { diff --git a/assets/tests/state/pagePanelState.test.ts b/assets/tests/state/pagePanelState.test.ts index 72a1ebefb..08c1ec959 100644 --- a/assets/tests/state/pagePanelState.test.ts +++ b/assets/tests/state/pagePanelState.test.ts @@ -1,5 +1,5 @@ import { expect, describe, test } from "@jest/globals" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" import { OpenView, PagePath, diff --git a/assets/tests/util/operatorFormatting.test.ts b/assets/tests/util/operatorFormatting.test.ts index 50f2d11cc..0e40d4982 100644 --- a/assets/tests/util/operatorFormatting.test.ts +++ b/assets/tests/util/operatorFormatting.test.ts @@ -4,7 +4,7 @@ import { formatOperatorName, formatOperatorNameFromVehicle, } from "../../src/util/operatorFormatting" -import vehicleFactory from "../factories/vehicle" +import { vehicleFactory } from "../factories/vehicle" describe("formatOperatorName", () => { test("when given non-null data, should return formatted operator name", () => {