From 5ab9ae526c9d7872df6b37154cefc20de2ced7aa Mon Sep 17 00:00:00 2001 From: Eddie Maldonado Date: Mon, 23 Oct 2023 09:20:13 -0400 Subject: [PATCH] refactor(tests): clean up default mocks in mapPage.test.tsx --- assets/tests/components/mapPage.test.tsx | 58 +++++------------------- 1 file changed, 11 insertions(+), 47 deletions(-) diff --git a/assets/tests/components/mapPage.test.tsx b/assets/tests/components/mapPage.test.tsx index d4aab031f..f1d879e66 100644 --- a/assets/tests/components/mapPage.test.tsx +++ b/assets/tests/components/mapPage.test.tsx @@ -84,29 +84,15 @@ import userInTestGroup, { TestGroups } from "../../src/userInTestGroup" import { useMinischeduleRun } from "../../src/hooks/useMinischedule" import pieceFactory from "../factories/piece" -jest.mock("../../src/hooks/useLocationSearchResults", () => ({ - __esModule: true, - useLocationSearchResults: jest.fn(() => null), -})) +jest.mock("../../src/hooks/useLocationSearchResults") -jest.mock("../../src/hooks/useLocationSearchSuggestions", () => ({ - __esModule: true, - useLocationSearchSuggestions: jest.fn(() => null), -})) +jest.mock("../../src/hooks/useLocationSearchSuggestions") -jest.mock("../../src/hooks/useLocationSearchResultById", () => ({ - __esModule: true, - default: jest.fn(() => null), - useLocationSearchResultById: jest.fn(() => null), -})) +jest.mock("../../src/hooks/useLocationSearchResultById") -jest.mock("../../src/hooks/usePatternsByIdForRoute", () => ({ - __esModule: true, - default: jest.fn(() => null), -})) +jest.mock("../../src/hooks/usePatternsByIdForRoute") jest.mock("../../src/hooks/useNearestIntersection", () => ({ - __esModule: true, useNearestIntersection: jest.fn(() => { return { is_loading: true, @@ -114,41 +100,19 @@ jest.mock("../../src/hooks/useNearestIntersection", () => ({ }), })) -jest.mock("../../src/hooks/useVehicleForId", () => ({ - __esModule: true, - default: jest.fn(() => null), -})) +jest.mock("../../src/hooks/useVehicleForId") -jest.mock("../../src/hooks/useVehiclesForRoute", () => ({ - __esModule: true, - default: jest.fn(() => null), -})) +jest.mock("../../src/hooks/useVehiclesForRoute") -jest.mock("../../src/hooks/useAllStops", () => ({ - __esModule: true, - useAllStops: jest.fn(() => []), -})) +jest.mock("../../src/hooks/useAllStops") -jest.mock("../../src/hooks/useStations", () => ({ - __esModule: true, - useStations: jest.fn(() => []), -})) +jest.mock("../../src/hooks/useStations") -jest.mock("../../src/hooks/useMinischedule", () => ({ - __esModule: true, - useMinischeduleRun: jest.fn(), - useMinischeduleBlock: jest.fn(), -})) +jest.mock("../../src/hooks/useMinischedule") -jest.mock("../../src/tilesetUrls", () => ({ - __esModule: true, - tilesetUrlForType: jest.fn(() => null), -})) +jest.mock("../../src/tilesetUrls") -jest.mock("../../src/hooks/useSearchResultsByCategory", () => ({ - __esModule: true, - default: jest.fn(() => null), -})) +jest.mock("../../src/hooks/useSearchResultsByCategory") jest.mock("../../src/helpers/fullStory")