1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Update tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-11-17 08:01:14 -05:00
parent 59b730deed
commit 3f52b60a0e

View File

@ -39,7 +39,11 @@ describe("<Icon> 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 <Icon> with https href", () => {
@ -50,7 +54,11 @@ describe("<Icon> 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("<Icon> 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("<Icon> 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();
});
});