Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
GerardasB committed Dec 11, 2024
1 parent e85a601 commit 453a6ff
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ import * as React from "react";
import { Tool } from "@itwin/core-frontend";
import { ToolbarItemUtilities } from "../../appui-react.js";
import { ToolUtilities } from "@itwin/imodel-components-react";
import { render } from "@testing-library/react";

describe("ToolbarItemUtilities.createForTool", () => {
it("should read `iconElement` property", () => {
class MyTool extends Tool {
public static override iconSpec = "icon-placeholder";
}
ToolUtilities.defineIcon(MyTool, <span>My SVG</span>);

const item = ToolbarItemUtilities.createForTool(MyTool);
expect(item.icon).toEqual("icon-placeholder");
expect(item).toHaveProperty("iconNode");

const { getByText } = render(item.iconNode);
getByText("My SVG");
});
});

0 comments on commit 453a6ff

Please sign in to comment.