2023-02-23 00:35:26 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import { render, screen } from "@testing-library/react";
|
|
|
|
|
import { createCustomRenderer } from "test/test-utils";
|
2023-11-29 14:32:42 +00:00
|
|
|
import { ProfileOperationType } from "interfaces/mdm";
|
2023-11-07 14:58:08 +00:00
|
|
|
import OSSettingStatusCell from "./OSSettingStatusCell";
|
2023-02-23 00:35:26 +00:00
|
|
|
|
2023-11-07 14:58:08 +00:00
|
|
|
describe("OS setting status cell", () => {
|
2023-02-23 00:35:26 +00:00
|
|
|
it("Correctly displays the status text of a profile", () => {
|
2023-05-05 13:44:05 +00:00
|
|
|
const status = "verifying";
|
2023-11-29 14:32:42 +00:00
|
|
|
const operationType: ProfileOperationType = "install";
|
2023-02-23 00:35:26 +00:00
|
|
|
|
|
|
|
|
render(
|
2023-11-07 14:58:08 +00:00
|
|
|
<OSSettingStatusCell
|
2023-06-06 14:52:10 +00:00
|
|
|
profileName="Test Profile"
|
|
|
|
|
status={status}
|
|
|
|
|
operationType={operationType}
|
|
|
|
|
/>
|
2023-02-23 00:35:26 +00:00
|
|
|
);
|
|
|
|
|
|
2023-04-26 18:31:38 +00:00
|
|
|
expect(screen.getByText("Verifying")).toBeInTheDocument();
|
2023-02-23 00:35:26 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("Correctly displays the tooltip text for a profile", async () => {
|
2023-05-05 13:44:05 +00:00
|
|
|
const status = "verifying";
|
2023-11-29 14:32:42 +00:00
|
|
|
const operationType: ProfileOperationType = "install";
|
2023-02-23 00:35:26 +00:00
|
|
|
|
|
|
|
|
const customRender = createCustomRenderer();
|
|
|
|
|
|
|
|
|
|
const { user } = customRender(
|
2023-11-07 14:58:08 +00:00
|
|
|
<OSSettingStatusCell
|
2023-06-06 14:52:10 +00:00
|
|
|
profileName="Test Profile"
|
|
|
|
|
status={status}
|
|
|
|
|
operationType={operationType}
|
|
|
|
|
/>
|
2023-02-23 00:35:26 +00:00
|
|
|
);
|
|
|
|
|
|
2023-04-26 18:31:38 +00:00
|
|
|
const statusText = screen.getByText("Verifying");
|
2023-02-23 00:35:26 +00:00
|
|
|
|
|
|
|
|
await user.hover(statusText);
|
|
|
|
|
|
2023-06-06 14:52:10 +00:00
|
|
|
expect(screen.getByText(/verifying/)).toBeInTheDocument();
|
2023-02-23 00:35:26 +00:00
|
|
|
});
|
|
|
|
|
});
|