fleet/frontend/components/ViewAllHostsLink/ViewAllHostsLink.tests.tsx
Gabriel Hernandez 82e576ef59
fix view all host link chevron icon (#14924)
Fixes chevron icon for view all host link component


- [x] Manual QA for all new/changed functionality
2023-11-03 15:22:17 +00:00

22 lines
699 B
TypeScript

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");
const icon = screen.getByTestId("chevron-right-icon");
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();
});
});