diff --git a/src/Platform/Hosted/Components/ConnectExplorer.test.tsx b/src/Platform/Hosted/Components/ConnectExplorer.test.tsx index c37f6e841..9a6a7bcab 100644 --- a/src/Platform/Hosted/Components/ConnectExplorer.test.tsx +++ b/src/Platform/Hosted/Components/ConnectExplorer.test.tsx @@ -1,8 +1,5 @@ jest.mock("../../../hooks/useDirectories"); jest.mock("../../../Common/PortalBackendClient"); -// ScenarioMonitor subscribes to web-vitals on import, and onTTFB reads a navigation timing entry that -// jsdom never produces, throwing from a timer that lands on whichever test happens to be running. -jest.mock("web-vitals"); import "@testing-library/jest-dom"; import { fireEvent, render, screen } from "@testing-library/react"; import { extractFeatures } from "Platform/Hosted/extractFeatures"; @@ -16,8 +13,7 @@ const mockIsAccountRestricted = isAccountRestrictedForConnectionStringLogin as j typeof isAccountRestrictedForConnectionStringLogin >; -// fetchEncryptedToken rejects with the raw Response. jsdom implements no part of the fetch API, so -// there is no Response constructor to build one with. +// fetchEncryptedToken rejects with the raw Response. const rejectWithResponse = (status: number, body: string) => mockFetchEncryptedToken.mockRejectedValue({ status, text: async () => body } as Response); diff --git a/src/Platform/Hosted/Helpers/ConnectionStringParser.ts b/src/Platform/Hosted/Helpers/ConnectionStringParser.ts index f4a70f031..9730052ea 100644 --- a/src/Platform/Hosted/Helpers/ConnectionStringParser.ts +++ b/src/Platform/Hosted/Helpers/ConnectionStringParser.ts @@ -8,9 +8,7 @@ const DnsPort = "443"; const isPpeZone = (zone: string): boolean => zone === PpeDnsSuffix || zone.endsWith(`.${PpeDnsSuffix}`); // Picks the DNS zone matching the kind of account the connection string came from, since a PPE -// account's endpoints sit under PPE zones and every other account's do not. Returns undefined when the -// config carries no zone of that kind, so the caller can reject the connection string rather than build -// an endpoint the account does not own and send the account key there. +// account's endpoints sit under PPE zones and every other account's do not. export const selectEndpointZone = (zones: ReadonlyArray, isPpeAccount: boolean): string | undefined => zones.find((zone) => isPpeZone(zone) === isPpeAccount); diff --git a/src/setupTests.ts b/src/setupTests.ts index 720a385d8..9d2e6dfb3 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -6,6 +6,9 @@ import enableHooks from "jest-react-hooks-shallow"; import { TextDecoder, TextEncoder } from "util"; import i18n from "./i18n"; import enResources from "./Localization/en/Resources.json"; + +jest.mock("web-vitals"); + configure({ adapter: new Adapter() }); initializeIcons();