fleet/frontend/pages/hosts/details/MacSettingsModal/MacSettingsTable/MacSettingStatusCell/MacSettingStatusCell.tests.tsx
Gabriel Hernandez 2c9c9b4f0e
add verified status to UI for profile statuses (#11886)
relates to #11238

This implements the Verified status for the profile statute on the macOS
settings pages and the Host Details and My Device pages.

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
- [x] Manual QA for all new/changed functionality
2023-06-06 15:52:10 +01:00

43 lines
1.2 KiB
TypeScript

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