fleet/frontend/pages/hosts/details/MacSettingsModal/MacSettingsTable/MacSettingStatusCell/MacSettingStatusCell.tests.tsx
gillespi314 66bd7a7fb8
Reconcile API integration for MDM profile statuses in host details (#10045)
Fixes issues found during manual QA of integration for #10034 and #10019
2023-02-23 10:27:00 -03:00

38 lines
1.2 KiB
TypeScript

import React from "react";
import { render, screen } from "@testing-library/react";
import { createCustomRenderer } from "test/test-utils";
import {
MacMdmProfileOperationType,
MacMdmProfileStatus,
} from "interfaces/mdm";
import MacSettingStatusCell from "./MacSettingStatusCell";
describe("Mac setting status cell", () => {
it("Correctly displays the status text of a profile", () => {
const status: MacMdmProfileStatus = "applied";
const operationType: MacMdmProfileOperationType = "install";
render(
<MacSettingStatusCell status={status} operationType={operationType} />
);
expect(screen.getByText("Applied")).toBeInTheDocument();
});
it("Correctly displays the tooltip text for a profile", async () => {
const status: MacMdmProfileStatus = "applied";
const operationType: MacMdmProfileOperationType = "install";
const customRender = createCustomRenderer();
const { user } = customRender(
<MacSettingStatusCell status={status} operationType={operationType} />
);
const statusText = screen.getByText("Applied");
await user.hover(statusText);
expect(screen.getByText("Host applied the setting.")).toBeInTheDocument();
});
});