2022-11-15 13:53:39 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import { render, screen } from "@testing-library/react";
|
|
|
|
|
import ViewAllHostsLink from "./ViewAllHostsLink";
|
|
|
|
|
|
|
|
|
|
describe("ViewAllHostsLink - component", () => {
|
|
|
|
|
it("renders View all hosts text and icon", () => {
|
|
|
|
|
render(<ViewAllHostsLink />);
|
|
|
|
|
|
|
|
|
|
const text = screen.getByText("View all hosts");
|
2022-12-07 17:59:38 +00:00
|
|
|
const icon = screen.getByTestId("icon");
|
2022-11-15 13:53:39 +00:00
|
|
|
|
|
|
|
|
expect(text).toBeInTheDocument();
|
|
|
|
|
expect(icon).toBeInTheDocument();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("hides text when set to condensed ", async () => {
|
|
|
|
|
render(<ViewAllHostsLink queryParams={{ status: "online" }} condensed />);
|
|
|
|
|
const text = screen.queryByText("View all hosts");
|
|
|
|
|
|
|
|
|
|
expect(text).toBeNull();
|
|
|
|
|
});
|
|
|
|
|
});
|