fleet/frontend/components/ViewAllHostsLink/ViewAllHostsLink.tests.tsx
Marko Lisica 8162d052bf
Icons improvements (making frontend consistent with Figma component library) (#14185)
# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [ ] Manual QA for all new/changed functionality

---------

Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
2023-10-31 16:06:38 +00:00

22 lines
698 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-down-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();
});
});