fleet/frontend/pages/DashboardPage/components/MdmSolutionModal/MdmSolutionModal.tests.tsx
jacobshandling 9353d091fe
UI – Test all data tables, 1/6 (#21481)
## Addresses #20919 
- Write tests
- Componentize table rendering where helpful for testing
- Misc. improvements and cleanups

- [x] Added/updated tests

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2024-08-26 13:59:17 -07:00

27 lines
713 B
TypeScript

import React from "react";
import { render, screen } from "@testing-library/react";
import { IMdmSolution } from "interfaces/mdm";
import MdmSolutionModal from "./MdmSolutionModal";
describe("MdmSolutionModal table", () => {
it("Renders table data normally", () => {
const [server_url, hosts_count] = ["a.b.c", 123];
const mdmSolutions: IMdmSolution[] = [
{
id: 1,
name: "test solution",
server_url,
hosts_count,
},
];
render(
<MdmSolutionModal mdmSolutions={mdmSolutions} onCancel={() => null} />
);
expect(screen.getByText(server_url)).toBeInTheDocument();
expect(screen.getByText(hosts_count)).toBeInTheDocument();
});
});