Skip to content

Commit 6c6cdd1

Browse files
committed
DISPATCH-1914 Updated the console's schema page test
1 parent ebaf88f commit 6c6cdd1

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

console/react/src/details/schema/schemaPage.test.js

+5-20
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,16 @@ under the License.
1818
*/
1919

2020
import React from "react";
21-
import { render, fireEvent } from "@testing-library/react";
21+
import { render } from "@testing-library/react";
2222
import { mockService } from "../../../test_data/qdrService.mock";
2323
import SchemaPage from "./schemaPage";
2424

2525
it("renders a SchemaPage", () => {
2626
const service = mockService({});
2727
const props = {
28-
schema: service.schema
28+
schema: service.schema,
2929
};
30-
const { getByTestId, queryByTestId } = render(<SchemaPage {...props} />);
31-
32-
// the root node should be present
33-
const root = getByTestId("entities");
34-
expect(root).toBeInTheDocument();
35-
36-
// the root node should be expanded by default
37-
// therefore the address entity should be present
38-
let addressEntity = getByTestId("address");
39-
expect(addressEntity).toBeInTheDocument();
40-
41-
fireEvent.click(addressEntity);
42-
expect(getByTestId("address-egressPhase")).toBeInTheDocument();
43-
44-
// clicking on the root should collapse the tree
45-
fireEvent.click(root);
46-
addressEntity = queryByTestId("address");
47-
expect(addressEntity).toBeNull();
30+
const { getByText } = render(<SchemaPage {...props} />);
31+
const addressText = getByText(/router.address/);
32+
expect(addressText).toBeInTheDocument();
4833
});

0 commit comments

Comments
 (0)