diff --git a/test/components/structures/auth/ForgotPassword-test.tsx b/test/components/structures/auth/ForgotPassword-test.tsx index a1bac390b34..6977fe9ec43 100644 --- a/test/components/structures/auth/ForgotPassword-test.tsx +++ b/test/components/structures/auth/ForgotPassword-test.tsx @@ -19,7 +19,6 @@ import { mocked } from "jest-mock"; import { act, render, RenderResult, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { MatrixClient, createClient } from "matrix-js-sdk/src/matrix"; -import { TooltipProvider } from "@vector-im/compound-web"; import ForgotPassword from "../../../../src/components/structures/auth/ForgotPassword"; import { ValidatedServerConfig } from "../../../../src/utils/ValidatedServerConfig"; @@ -103,7 +102,6 @@ describe("", () => { beforeEach(() => { renderResult = render( , - , ); }); diff --git a/test/components/views/avatars/DecoratedRoomAvatar-test.tsx b/test/components/views/avatars/DecoratedRoomAvatar-test.tsx index bf62355ce4c..d9a7b9b16ea 100644 --- a/test/components/views/avatars/DecoratedRoomAvatar-test.tsx +++ b/test/components/views/avatars/DecoratedRoomAvatar-test.tsx @@ -19,7 +19,6 @@ import { mocked } from "jest-mock"; import { JoinRule, MatrixClient, PendingEventOrdering, Room } from "matrix-js-sdk/src/matrix"; import React from "react"; import userEvent from "@testing-library/user-event"; -import { TooltipProvider } from "@vector-im/compound-web"; import { MatrixClientPeg } from "../../../../src/MatrixClientPeg"; import { stubClient } from "../../../test-utils"; @@ -39,9 +38,7 @@ describe("DecoratedRoomAvatar", () => { let room: Room; function renderComponent() { - return render(, { - wrapper: TooltipProvider, - }); + return render(); } beforeEach(() => { diff --git a/test/components/views/beacon/BeaconViewDialog-test.tsx b/test/components/views/beacon/BeaconViewDialog-test.tsx index 103ff2547d4..cee880c966e 100644 --- a/test/components/views/beacon/BeaconViewDialog-test.tsx +++ b/test/components/views/beacon/BeaconViewDialog-test.tsx @@ -19,7 +19,6 @@ import { act, fireEvent, render, RenderResult } from "@testing-library/react"; import { MatrixClient, MatrixEvent, Room, RoomMember, getBeaconInfoIdentifier } from "matrix-js-sdk/src/matrix"; import * as maplibregl from "maplibre-gl"; import { mocked } from "jest-mock"; -import { TooltipProvider } from "@vector-im/compound-web"; import BeaconViewDialog from "../../../../src/components/views/beacon/BeaconViewDialog"; import { diff --git a/test/components/views/beacon/DialogSidebar-test.tsx b/test/components/views/beacon/DialogSidebar-test.tsx index 0c14d334dfa..3f1e9194eb0 100644 --- a/test/components/views/beacon/DialogSidebar-test.tsx +++ b/test/components/views/beacon/DialogSidebar-test.tsx @@ -16,7 +16,6 @@ limitations under the License. import React, { ComponentProps } from "react"; import { act, fireEvent, render } from "@testing-library/react"; -import { TooltipProvider } from "@vector-im/compound-web"; import DialogSidebar from "../../../../src/components/views/beacon/DialogSidebar"; import MatrixClientContext from "../../../../src/contexts/MatrixClientContext"; @@ -53,9 +52,7 @@ describe("", () => { const getComponent = (props = {}) => ( - - - + ); diff --git a/test/components/views/dialogs/ShareDialog-test.tsx b/test/components/views/dialogs/ShareDialog-test.tsx index a78f4cf62ff..06d6c30de4c 100644 --- a/test/components/views/dialogs/ShareDialog-test.tsx +++ b/test/components/views/dialogs/ShareDialog-test.tsx @@ -17,7 +17,6 @@ limitations under the License. import React from "react"; import { EventTimeline, MatrixEvent, Room, RoomMember } from "matrix-js-sdk/src/matrix"; import { render, RenderOptions } from "@testing-library/react"; -import { TooltipProvider } from "@vector-im/compound-web"; import { MatrixClientPeg } from "../../../../src/MatrixClientPeg"; import SettingsStore from "../../../../src/settings/SettingsStore"; @@ -31,11 +30,7 @@ jest.mock("../../../../src/utils/ShieldUtils"); function getWrapper(): RenderOptions { return { wrapper: ({ children }) => ( - - - {children} - - + {children} ), }; } diff --git a/test/components/views/elements/InfoTooltip-test.tsx b/test/components/views/elements/InfoTooltip-test.tsx index 226497cea83..049fa878477 100644 --- a/test/components/views/elements/InfoTooltip-test.tsx +++ b/test/components/views/elements/InfoTooltip-test.tsx @@ -17,15 +17,12 @@ limitations under the License. import React from "react"; import userEvent from "@testing-library/user-event"; import { render, waitFor } from "@testing-library/react"; -import { TooltipProvider } from "@vector-im/compound-web"; import InfoTooltip from "../../../../src/components/views/elements/InfoTooltip"; describe("InfoTooltip", () => { it("should show tooltip on hover", async () => { - const { getByText, asFragment } = render(Trigger text, { - wrapper: TooltipProvider, - }); + const { getByText, asFragment } = render(Trigger text); const trigger = getByText("Trigger text"); expect(trigger).toBeVisible(); diff --git a/test/components/views/elements/Pill-test.tsx b/test/components/views/elements/Pill-test.tsx index 379ace39d76..cdde49cc560 100644 --- a/test/components/views/elements/Pill-test.tsx +++ b/test/components/views/elements/Pill-test.tsx @@ -19,7 +19,6 @@ import { act, render, RenderResult, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { mocked, Mocked } from "jest-mock"; import { MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; -import { TooltipProvider } from "@vector-im/compound-web"; import dis from "../../../../src/dispatcher/dispatcher"; import { Pill, PillProps, PillType } from "../../../../src/components/views/elements/Pill"; @@ -65,7 +64,6 @@ describe("", () => {
, - , ); }; diff --git a/test/components/views/elements/RoomFacePile-test.tsx b/test/components/views/elements/RoomFacePile-test.tsx index 29af3818978..8846187417f 100644 --- a/test/components/views/elements/RoomFacePile-test.tsx +++ b/test/components/views/elements/RoomFacePile-test.tsx @@ -14,7 +14,6 @@ limitations under the License. import { render } from "@testing-library/react"; import React from "react"; -import { TooltipProvider } from "@vector-im/compound-web"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { mkRoom, mkRoomMember, stubClient, withClientContextRenderOptions } from "../../../test-utils"; @@ -33,9 +32,7 @@ describe("", () => { ]); const { asFragment } = render( - - - , + , withClientContextRenderOptions(MatrixClientPeg.get()!), ); diff --git a/test/components/views/messages/CallEvent-test.tsx b/test/components/views/messages/CallEvent-test.tsx index 76f1b4bde5d..6c9585e7ebd 100644 --- a/test/components/views/messages/CallEvent-test.tsx +++ b/test/components/views/messages/CallEvent-test.tsx @@ -19,7 +19,6 @@ import { render, screen, act, cleanup, fireEvent, waitFor } from "@testing-libra import { mocked, Mocked } from "jest-mock"; import { Room, RoomStateEvent, MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/matrix"; import { ClientWidgetApi, Widget } from "matrix-widget-api"; -import { TooltipProvider } from "@vector-im/compound-web"; import type { RoomMember } from "matrix-js-sdk/src/matrix"; import { diff --git a/test/components/views/messages/MessageTimestamp-test.tsx b/test/components/views/messages/MessageTimestamp-test.tsx index 3e46dbcf102..05a1ca12c15 100644 --- a/test/components/views/messages/MessageTimestamp-test.tsx +++ b/test/components/views/messages/MessageTimestamp-test.tsx @@ -17,7 +17,6 @@ limitations under the License. import React from "react"; import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; -import { TooltipProvider } from "@vector-im/compound-web"; import MessageTimestamp from "../../../../src/components/views/messages/MessageTimestamp"; @@ -31,7 +30,7 @@ describe("MessageTimestamp", () => { const DAY_MS = HOUR_MS * 24; it("should render HH:MM", () => { - const { asFragment } = render(, ); + const { asFragment } = render(); expect(asFragment()).toMatchInlineSnapshot(` { }); it("should show full date & time on hover", async () => { - const { container } = render(, ); + const { container } = render(); await userEvent.hover(container.querySelector(".mx_MessageTimestamp")!); expect((await screen.findByRole("tooltip")).textContent).toMatchInlineSnapshot(`"Fri, Dec 17, 2021, 08:09:00"`); }); @@ -55,7 +54,6 @@ describe("MessageTimestamp", () => { it("should show sent & received time on hover if passed", async () => { const { container } = render( , - , ); await userEvent.hover(container.querySelector(".mx_MessageTimestamp")!); expect((await screen.findByRole("tooltip")).textContent).toMatchInlineSnapshot( diff --git a/test/components/views/polls/pollHistory/PollHistory-test.tsx b/test/components/views/polls/pollHistory/PollHistory-test.tsx index 054961cb2eb..2a5fc801685 100644 --- a/test/components/views/polls/pollHistory/PollHistory-test.tsx +++ b/test/components/views/polls/pollHistory/PollHistory-test.tsx @@ -17,7 +17,6 @@ limitations under the License. import React from "react"; import { act, fireEvent, render } from "@testing-library/react"; import { Filter, EventTimeline, Room, MatrixEvent, M_POLL_START } from "matrix-js-sdk/src/matrix"; -import { TooltipProvider } from "@vector-im/compound-web"; import { PollHistory } from "../../../../../src/components/views/polls/pollHistory/PollHistory"; import { @@ -68,9 +67,7 @@ describe("", () => { const getComponent = () => render(, { wrapper: ({ children }) => ( - - {children} - + {children} ), }); diff --git a/test/components/views/polls/pollHistory/PollListItemEnded-test.tsx b/test/components/views/polls/pollHistory/PollListItemEnded-test.tsx index 4aa923eb9ed..7bf27ee4471 100644 --- a/test/components/views/polls/pollHistory/PollListItemEnded-test.tsx +++ b/test/components/views/polls/pollHistory/PollListItemEnded-test.tsx @@ -17,7 +17,6 @@ limitations under the License. import React from "react"; import { render } from "@testing-library/react"; import { MatrixEvent, Poll, Room, M_TEXT } from "matrix-js-sdk/src/matrix"; -import { TooltipProvider } from "@vector-im/compound-web"; import { PollListItemEnded } from "../../../../../src/components/views/polls/pollHistory/PollListItemEnded"; import { diff --git a/test/components/views/right_panel/RoomSummaryCard-test.tsx b/test/components/views/right_panel/RoomSummaryCard-test.tsx index 8fce2fdf868..878a38550b8 100644 --- a/test/components/views/right_panel/RoomSummaryCard-test.tsx +++ b/test/components/views/right_panel/RoomSummaryCard-test.tsx @@ -19,7 +19,6 @@ import { render, fireEvent, screen } from "@testing-library/react"; import { EventType, MatrixEvent, Room, MatrixClient, JoinRule } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { mocked, MockedObject } from "jest-mock"; -import { TooltipProvider } from "@vector-im/compound-web"; import DMRoomMap from "../../../../src/utils/DMRoomMap"; import RoomSummaryCard from "../../../../src/components/views/right_panel/RoomSummaryCard"; @@ -57,9 +56,7 @@ describe("", () => { return render(, { wrapper: ({ children }) => ( - - {children} - + {children} ), }); }; diff --git a/test/components/views/right_panel/UserInfo-test.tsx b/test/components/views/right_panel/UserInfo-test.tsx index b40146e609c..7e07636c448 100644 --- a/test/components/views/right_panel/UserInfo-test.tsx +++ b/test/components/views/right_panel/UserInfo-test.tsx @@ -38,7 +38,6 @@ import { VerificationPhase as Phase, VerificationRequestEvent, } from "matrix-js-sdk/src/crypto-api"; -import { TooltipProvider } from "@vector-im/compound-web"; import UserInfo, { BanToggleButton, @@ -206,11 +205,7 @@ describe("", () => { const renderComponent = (props = {}) => { const Wrapper = (wrapperProps = {}) => { - return ( - - - - ); + return ; }; return render(, { @@ -454,11 +449,7 @@ describe("", () => { const renderComponent = (props = {}) => { const Wrapper = (wrapperProps = {}) => { - return ( - - - - ); + return ; }; return render(, { diff --git a/test/components/views/rooms/EventTile-test.tsx b/test/components/views/rooms/EventTile-test.tsx index 31203d4f85b..cb4cbc56f0f 100644 --- a/test/components/views/rooms/EventTile-test.tsx +++ b/test/components/views/rooms/EventTile-test.tsx @@ -29,7 +29,6 @@ import { TweakName, } from "matrix-js-sdk/src/matrix"; import { EventEncryptionInfo, EventShieldColour, EventShieldReason } from "matrix-js-sdk/src/crypto-api"; -import { TooltipProvider } from "@vector-im/compound-web"; import { mkEncryptedMatrixEvent } from "matrix-js-sdk/src/testing"; import EventTile, { EventTileProps } from "../../../../src/components/views/rooms/EventTile"; @@ -59,13 +58,11 @@ describe("EventTile", () => { return ( - - - + ); diff --git a/test/components/views/rooms/LegacyRoomHeader-test.tsx b/test/components/views/rooms/LegacyRoomHeader-test.tsx index 1a1db41add8..c01d749eeab 100644 --- a/test/components/views/rooms/LegacyRoomHeader-test.tsx +++ b/test/components/views/rooms/LegacyRoomHeader-test.tsx @@ -32,7 +32,6 @@ import { ClientWidgetApi, Widget } from "matrix-widget-api"; import EventEmitter from "events"; import { setupJestCanvasMock } from "jest-canvas-mock"; import { ViewRoomOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; -import { TooltipProvider } from "@vector-im/compound-web"; // eslint-disable-next-line no-restricted-imports import { MatrixRTCSessionManagerEvents } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSessionManager"; // eslint-disable-next-line no-restricted-imports @@ -226,7 +225,6 @@ describe("LegacyRoomHeader", () => { {...props} /> , - , ); }; @@ -870,7 +868,6 @@ function mountHeader(room: Room, propsOverride = {}, roomContext?: Partial , - , ); } diff --git a/test/components/views/rooms/RoomHeader-test.tsx b/test/components/views/rooms/RoomHeader-test.tsx index e215775a0d0..21a5cccf2bd 100644 --- a/test/components/views/rooms/RoomHeader-test.tsx +++ b/test/components/views/rooms/RoomHeader-test.tsx @@ -40,7 +40,6 @@ import { waitFor, } from "@testing-library/react"; import { ViewRoomOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; -import { TooltipProvider } from "@vector-im/compound-web"; import { filterConsole, mkEvent, stubClient } from "../../../test-utils"; import RoomHeader from "../../../../src/components/views/rooms/RoomHeader"; @@ -67,11 +66,7 @@ jest.mock("../../../../src/utils/ShieldUtils"); function getWrapper(): RenderOptions { return { wrapper: ({ children }) => ( - - - {children} - - + {children} ), }; } diff --git a/test/components/views/rooms/RoomHeader/CallGuestLinkButton-test.tsx b/test/components/views/rooms/RoomHeader/CallGuestLinkButton-test.tsx index 465a4b6770a..24524b6587a 100644 --- a/test/components/views/rooms/RoomHeader/CallGuestLinkButton-test.tsx +++ b/test/components/views/rooms/RoomHeader/CallGuestLinkButton-test.tsx @@ -15,7 +15,6 @@ limitations under the License. */ import React from "react"; -import { TooltipProvider } from "@vector-im/compound-web"; import { fireEvent, getByLabelText, getByText, render, screen, waitFor } from "@testing-library/react"; import { EventTimeline, JoinRule, Room } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; @@ -75,11 +74,7 @@ describe("", () => { const getComponent = (room: Room) => render(, { - wrapper: ({ children }) => ( - - {children} - - ), + wrapper: ({ children }) => {children}, }); const oldGet = SdkConfig.get; @@ -225,11 +220,7 @@ describe("", () => { const getComponent = (room: Room, canInvite: boolean = true) => render(, { - wrapper: ({ children }) => ( - - {children} - - ), + wrapper: ({ children }) => {children}, }); beforeEach(() => { diff --git a/test/components/views/rooms/RoomHeader/VideoRoomChatButton-test.tsx b/test/components/views/rooms/RoomHeader/VideoRoomChatButton-test.tsx index 222da727643..daf075ce8e7 100644 --- a/test/components/views/rooms/RoomHeader/VideoRoomChatButton-test.tsx +++ b/test/components/views/rooms/RoomHeader/VideoRoomChatButton-test.tsx @@ -18,7 +18,6 @@ import React from "react"; import { MockedObject } from "jest-mock"; import { Room } from "matrix-js-sdk/src/matrix"; import { fireEvent, render, screen } from "@testing-library/react"; -import { TooltipProvider } from "@vector-im/compound-web"; import { VideoRoomChatButton } from "../../../../../src/components/views/rooms/RoomHeader/VideoRoomChatButton"; import { SDKContext, SdkContextClass } from "../../../../../src/contexts/SDKContext"; @@ -57,11 +56,7 @@ describe("", () => { const getComponent = (room: Room) => render(, { - wrapper: ({ children }) => ( - - {children} - - ), + wrapper: ({ children }) => {children}, }); beforeEach(() => { diff --git a/test/components/views/rooms/RoomList-test.tsx b/test/components/views/rooms/RoomList-test.tsx index d5daa43d5cd..d92b25e347c 100644 --- a/test/components/views/rooms/RoomList-test.tsx +++ b/test/components/views/rooms/RoomList-test.tsx @@ -20,7 +20,6 @@ import { cleanup, queryByRole, render, screen, within } from "@testing-library/r import userEvent from "@testing-library/user-event"; import { mocked } from "jest-mock"; import { Room } from "matrix-js-sdk/src/matrix"; -import { TooltipProvider } from "@vector-im/compound-web"; import RoomList from "../../../../src/components/views/rooms/RoomList"; import ResizeNotifier from "../../../../src/utils/ResizeNotifier"; @@ -56,18 +55,16 @@ describe("RoomList", () => { function getComponent(props: Partial> = {}): JSX.Element { return ( - - - + ); } diff --git a/test/components/views/settings/devices/FilteredDeviceList-test.tsx b/test/components/views/settings/devices/FilteredDeviceList-test.tsx index 53d24de4225..c37ea612283 100644 --- a/test/components/views/settings/devices/FilteredDeviceList-test.tsx +++ b/test/components/views/settings/devices/FilteredDeviceList-test.tsx @@ -16,7 +16,6 @@ limitations under the License. import React, { ComponentProps } from "react"; import { act, fireEvent, render } from "@testing-library/react"; -import { TooltipProvider } from "@vector-im/compound-web"; import { FilteredDeviceList } from "../../../../../src/components/views/settings/devices/FilteredDeviceList"; import { DeviceSecurityVariation } from "../../../../../src/components/views/settings/devices/types"; @@ -82,11 +81,7 @@ describe("", () => { supportsMSC3881: true, }; - const getComponent = (props = {}) => ( - - - - ); + const getComponent = (props = {}) => ; afterAll(() => { jest.spyOn(global.Date, "now").mockRestore(); diff --git a/test/components/views/settings/devices/FilteredDeviceListHeader-test.tsx b/test/components/views/settings/devices/FilteredDeviceListHeader-test.tsx index 18649a3f49c..05380493d3f 100644 --- a/test/components/views/settings/devices/FilteredDeviceListHeader-test.tsx +++ b/test/components/views/settings/devices/FilteredDeviceListHeader-test.tsx @@ -16,7 +16,6 @@ limitations under the License. import { fireEvent, render } from "@testing-library/react"; import React from "react"; -import { TooltipProvider } from "@vector-im/compound-web"; import FilteredDeviceListHeader from "../../../../../src/components/views/settings/devices/FilteredDeviceListHeader"; @@ -28,11 +27,7 @@ describe("", () => { children:
test
, ["data-testid"]: "test123", }; - const getComponent = (props = {}) => ( - - - - ); + const getComponent = (props = {}) => ; it("renders correctly when no devices are selected", () => { const { container } = render(getComponent()); diff --git a/test/components/views/settings/tabs/user/SessionManagerTab-test.tsx b/test/components/views/settings/tabs/user/SessionManagerTab-test.tsx index 60b6bade4da..a35e7f4edb6 100644 --- a/test/components/views/settings/tabs/user/SessionManagerTab-test.tsx +++ b/test/components/views/settings/tabs/user/SessionManagerTab-test.tsx @@ -35,7 +35,6 @@ import { MatrixClient, } from "matrix-js-sdk/src/matrix"; import { mocked, MockedObject } from "jest-mock"; -import { TooltipProvider } from "@vector-im/compound-web"; import { clearAllModals, @@ -99,11 +98,9 @@ describe("", () => { const defaultProps = {}; const getComponent = (props = {}): React.ReactElement => ( - - - - - + + + ); const toggleDeviceDetails = ( diff --git a/test/components/views/voip/CallView-test.tsx b/test/components/views/voip/CallView-test.tsx index 2746200a2fa..c193ab4e5ba 100644 --- a/test/components/views/voip/CallView-test.tsx +++ b/test/components/views/voip/CallView-test.tsx @@ -20,7 +20,6 @@ import { render, screen, act, fireEvent, waitFor, cleanup } from "@testing-libra import { mocked, Mocked } from "jest-mock"; import { MatrixClient, PendingEventOrdering, Room, RoomStateEvent } from "matrix-js-sdk/src/matrix"; import { Widget } from "matrix-widget-api"; -import { TooltipProvider } from "@vector-im/compound-web"; import type { RoomMember } from "matrix-js-sdk/src/matrix"; import type { ClientWidgetApi } from "matrix-widget-api"; @@ -74,9 +73,7 @@ describe("CallView", () => { }); const renderView = async (skipLobby = false): Promise => { - render(, { - wrapper: TooltipProvider, - }); + render(); await act(() => Promise.resolve()); // Let effects settle };