Update dependency @vector-im/compound-web to v2 (#12133)
* Update dependency @vector-im/compound-web to v2 * Update Tooltip props Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Include TooltipProvider in MatrixChat Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix pillify & tooltipify Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update tests to use TooltipProvider where necessary Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix tooltips in Modals, ContextMenus, PersistedElements, Spoiler, HtmlExport Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update tests Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * delint Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update tests Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix tooltips in HTMLExport Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Don't pass mountAsChild to DOM Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * prettier Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Stabilise test Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
54b71140b8
commit
56d8ef3640
51 changed files with 293 additions and 221 deletions
|
@ -14,6 +14,7 @@ limitations under the License.
|
|||
|
||||
import { render } from "@testing-library/react";
|
||||
import React from "react";
|
||||
import { TooltipProvider } from "@vector-im/compound-web";
|
||||
|
||||
import FacePile from "../../../../src/components/views/elements/FacePile";
|
||||
import { mkRoomMember } from "../../../test-utils";
|
||||
|
@ -24,6 +25,7 @@ describe("<FacePile />", () => {
|
|||
|
||||
const { asFragment } = render(
|
||||
<FacePile members={[member]} size="36px" overflow={false} tooltipLabel="tooltip" />,
|
||||
{ wrapper: TooltipProvider },
|
||||
);
|
||||
|
||||
expect(asFragment()).toMatchSnapshot();
|
||||
|
|
|
@ -17,12 +17,15 @@ 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(<InfoTooltip tooltip="Tooltip text">Trigger text</InfoTooltip>);
|
||||
const { getByText, asFragment } = render(<InfoTooltip tooltip="Tooltip text">Trigger text</InfoTooltip>, {
|
||||
wrapper: TooltipProvider,
|
||||
});
|
||||
|
||||
const trigger = getByText("Trigger text");
|
||||
expect(trigger).toBeVisible();
|
||||
|
|
|
@ -19,6 +19,7 @@ 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";
|
||||
|
@ -64,6 +65,7 @@ describe("<Pill>", () => {
|
|||
<div onClick={pillParentClickHandler}>
|
||||
<Pill {...withDefault} />
|
||||
</div>,
|
||||
{ wrapper: TooltipProvider },
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ limitations under the License.
|
|||
|
||||
import { render } from "@testing-library/react";
|
||||
import React from "react";
|
||||
import { TooltipProvider } from "@vector-im/compound-web";
|
||||
|
||||
import { mkRoom, mkRoomMember, stubClient, withClientContextRenderOptions } from "../../../test-utils";
|
||||
import RoomFacePile from "../../../../src/components/views/elements/RoomFacePile";
|
||||
|
@ -29,7 +30,9 @@ describe("<RoomFacePile />", () => {
|
|||
jest.spyOn(room, "getJoinedMembers").mockReturnValue([mkRoomMember(room.roomId, "@bob:example.org", "join")]);
|
||||
|
||||
const { asFragment } = render(
|
||||
<RoomFacePile onlyKnownUsers={false} room={room} />,
|
||||
<TooltipProvider>
|
||||
<RoomFacePile onlyKnownUsers={false} room={room} />
|
||||
</TooltipProvider>,
|
||||
withClientContextRenderOptions(MatrixClientPeg.get()!),
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue