fleet/frontend/pages/hosts/details/OSSettingsModal/OSSettingsTable/OSSettingStatusCell/OSSettingStatusCell.tests.tsx
Gabriel Hernandez eacf9cb3c0
Update mac settings components to os settings components (#14570)
update the mac settings components naming to be less specific to mac os

- [x] Manual QA for all new/changed functionality
2023-11-07 14:58:08 +00: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 OSSettingStatusCell from "./OSSettingStatusCell";
describe("OS setting status cell", () => {
it("Correctly displays the status text of a profile", () => {
const status = "verifying";
const operationType: MacMdmProfileOperationType = "install";
render(
<OSSettingStatusCell
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(
<OSSettingStatusCell
profileName="Test Profile"
status={status}
operationType={operationType}
/>
);
const statusText = screen.getByText("Verifying");
await user.hover(statusText);
expect(screen.getByText(/verifying/)).toBeInTheDocument();
});
});