fleet/frontend/components/TableContainer/DataTable/PlatformCell/PlatformCell.tests.tsx
Lucas Manuel Rodriguez 8e9bc79a5e
Add support for Windows to conditional access policies (#41830)
Resolves #41476
([Figma](https://www.figma.com/design/Su6nBw3Oi3VtGrQaIcK1cU/-38041-Entra-conditional-access--Windows?node-id=0-1))

I added a changes file in the first PR, so no need to add one here.

<img width="1096" height="1119" alt="Screenshot 2026-03-17 at 12 36
36 PM"
src="https://github.com/user-attachments/assets/a18ded0c-a5d5-4b56-9bf8-944566603088"
/>

## Testing

- [X] Added/updated automated tests
- [X] QA'd all new/changed functionality manually
2026-03-17 16:30:21 -03:00

36 lines
1.2 KiB
TypeScript

import React from "react";
import { render, screen } from "@testing-library/react";
import { QueryablePlatform } from "interfaces/platform";
import PlatformCell from "./PlatformCell";
const QUERYABLE_PLATFORMS: QueryablePlatform[] = [
"windows",
"darwin",
"linux",
"chrome",
];
describe("Platform cell", () => {
it("renders platform icons in correct order", () => {
render(<PlatformCell platforms={QUERYABLE_PLATFORMS} />);
const icons = screen.queryByTestId("icons");
const appleIcon = screen.queryByTestId("darwin-icon");
const windowsIcon = screen.queryByTestId("windows-icon");
const linuxIcon = screen.queryByTestId("linux-icon");
const chromeIcon = screen.queryByTestId("chrome-icon");
expect(icons?.firstChild).toBe(appleIcon);
expect(icons?.firstChild?.nextSibling).toBe(windowsIcon);
expect(icons?.firstChild?.nextSibling?.nextSibling).toBe(linuxIcon);
expect(icons?.firstChild?.nextSibling?.nextSibling?.nextSibling).toBe(
chromeIcon
);
});
it("renders --- when no platforms passed in", () => {
render(<PlatformCell platforms={[]} />);
expect(screen.getByText(/---/i)).toBeInTheDocument();
});
});