mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
## 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>
27 lines
713 B
TypeScript
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();
|
|
});
|
|
});
|