2021-04-12 13:32:25 +00:00
|
|
|
import React from "react";
|
2022-03-18 19:10:16 +00:00
|
|
|
import { render, screen } from "@testing-library/react";
|
2016-11-17 17:12:41 +00:00
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
import PanelGroup from "./PanelGroup";
|
2016-11-17 17:12:41 +00:00
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
describe("PanelGroup - component", () => {
|
2016-11-17 17:12:41 +00:00
|
|
|
const validPanelGroupItems = [
|
2021-04-12 13:32:25 +00:00
|
|
|
{ type: "all", display_text: "All Hosts", hosts_count: 20 },
|
|
|
|
|
{ type: "platform", display_text: "MAC OS", hosts_count: 10 },
|
2016-11-17 17:12:41 +00:00
|
|
|
];
|
|
|
|
|
|
2022-03-18 19:10:16 +00:00
|
|
|
render(<PanelGroup groupItems={validPanelGroupItems} />);
|
2016-11-17 17:12:41 +00:00
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
it("renders a PanelGroupItem for each group item", () => {
|
2022-03-18 19:10:16 +00:00
|
|
|
const panelGroupItems = screen.queryAllByRole("button");
|
2016-11-17 17:12:41 +00:00
|
|
|
|
2021-09-01 01:02:23 +00:00
|
|
|
expect(panelGroupItems.length).toEqual(2);
|
2016-11-17 17:12:41 +00:00
|
|
|
});
|
|
|
|
|
});
|