chore(test): rewritten panelgroup component test using rtl (#4628)

This commit is contained in:
Tharun Rajendran 2022-03-19 00:40:16 +05:30 committed by GitHub
parent b512eef210
commit cb159970c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
import React from "react";
import { mount } from "enzyme";
import { render, screen } from "@testing-library/react";
import PanelGroup from "./PanelGroup";
@ -9,10 +9,10 @@ describe("PanelGroup - component", () => {
{ type: "platform", display_text: "MAC OS", hosts_count: 10 },
];
const component = mount(<PanelGroup groupItems={validPanelGroupItems} />);
render(<PanelGroup groupItems={validPanelGroupItems} />);
it("renders a PanelGroupItem for each group item", () => {
const panelGroupItems = component.find("PanelGroupItem");
const panelGroupItems = screen.queryAllByRole("button");
expect(panelGroupItems.length).toEqual(2);
});