diff --git a/src/renderer/components/icon/icon.test.tsx b/src/renderer/components/icon/icon.test.tsx index fc61620083..f927caa7da 100644 --- a/src/renderer/components/icon/icon.test.tsx +++ b/src/renderer/components/icon/icon.test.tsx @@ -39,7 +39,11 @@ describe(" href technical tests", () => { /> )); - expect(result.queryByTestId("my-icon")).toBeInTheDocument(); + const icon = result.queryByTestId("my-icon"); + + expect(icon).toBeInTheDocument(); + expect(icon).toHaveAttribute("href", "http://localhost"); + expect(logger.warn).not.toBeCalled(); }); it("should render an with https href", () => { @@ -50,7 +54,11 @@ describe(" href technical tests", () => { /> )); - expect(result.queryByTestId("my-icon")).toBeInTheDocument(); + const icon = result.queryByTestId("my-icon"); + + expect(icon).toBeInTheDocument(); + expect(icon).toHaveAttribute("href", "https://localhost"); + expect(logger.warn).not.toBeCalled(); }); it("should warn about ws hrefs", () => { @@ -61,7 +69,10 @@ describe(" href technical tests", () => { /> )); - expect(result.queryByTestId("my-icon")).not.toBeInTheDocument(); + const icon = result.queryByTestId("my-icon"); + + expect(icon).toBeInTheDocument(); + expect(icon).not.toHaveAttribute("href", "ws://localhost"); expect(logger.warn).toBeCalled(); }); @@ -73,7 +84,10 @@ describe(" href technical tests", () => { /> )); - expect(result.queryByTestId("my-icon")).not.toBeInTheDocument(); + const icon = result.queryByTestId("my-icon"); + + expect(icon).toBeInTheDocument(); + expect(icon).not.toHaveAttribute("href", "javascript:void 0"); expect(logger.warn).toBeCalled(); }); });