2025-03-21 13:33:06 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import { render, screen } from "@testing-library/react";
|
|
|
|
|
|
|
|
|
|
import InstallerActionCell from "./InstallerActionCell";
|
|
|
|
|
|
2025-07-24 19:04:48 +00:00
|
|
|
describe("InstallerAction cell", () => {
|
2025-03-21 13:33:06 +00:00
|
|
|
it("renders add button if installer is available", async () => {
|
|
|
|
|
render(<InstallerActionCell value={{ id: 1, platform: "darwin" }} />);
|
|
|
|
|
|
|
|
|
|
expect(screen.getByText(/add/i)).toBeInTheDocument();
|
|
|
|
|
});
|
|
|
|
|
it("renders --- if installer is unavailable", async () => {
|
|
|
|
|
render(<InstallerActionCell />);
|
|
|
|
|
|
|
|
|
|
expect(screen.getByText(/---/i)).toBeInTheDocument();
|
|
|
|
|
});
|
|
|
|
|
it("renders checkmark if installer is already added", async () => {
|
|
|
|
|
render(
|
|
|
|
|
<InstallerActionCell
|
|
|
|
|
value={{ id: 1, platform: "darwin", software_title_id: 1 }}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
|
2025-07-24 19:04:48 +00:00
|
|
|
expect(screen.getByTestId("success-icon")).toBeInTheDocument();
|
2025-03-21 13:33:06 +00:00
|
|
|
});
|
|
|
|
|
});
|