2022-12-07 17:59:38 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import { screen } from "@testing-library/react";
|
|
|
|
|
import { createCustomRenderer } from "test/test-utils";
|
|
|
|
|
|
|
|
|
|
import IssueCell from "./IssueCell";
|
|
|
|
|
|
|
|
|
|
describe("Issue cell", () => {
|
|
|
|
|
it("renders icon, total issues, and failing policies tooltip", async () => {
|
|
|
|
|
const render = createCustomRenderer({});
|
|
|
|
|
|
|
|
|
|
const { user } = render(
|
|
|
|
|
<IssueCell
|
|
|
|
|
issues={{
|
|
|
|
|
total_issues_count: 4,
|
|
|
|
|
failing_policies_count: 2,
|
|
|
|
|
}}
|
|
|
|
|
rowId={1}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
|
2023-10-31 16:06:38 +00:00
|
|
|
const icon = screen.queryByTestId("error-outline-icon");
|
2022-12-07 17:59:38 +00:00
|
|
|
|
|
|
|
|
await user.hover(screen.getByText("4"));
|
|
|
|
|
|
|
|
|
|
expect(screen.getByText(/failing policies/i)).toBeInTheDocument();
|
|
|
|
|
expect(icon).toBeInTheDocument();
|
|
|
|
|
});
|
|
|
|
|
});
|