@@ -18,31 +18,16 @@ under the License.
18
18
*/
19
19
20
20
import React from "react" ;
21
- import { render , fireEvent } from "@testing-library/react" ;
21
+ import { render } from "@testing-library/react" ;
22
22
import { mockService } from "../../../test_data/qdrService.mock" ;
23
23
import SchemaPage from "./schemaPage" ;
24
24
25
25
it ( "renders a SchemaPage" , ( ) => {
26
26
const service = mockService ( { } ) ;
27
27
const props = {
28
- schema : service . schema
28
+ schema : service . schema ,
29
29
} ;
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 ( / r o u t e r .a d d r e s s / ) ;
32
+ expect ( addressText ) . toBeInTheDocument ( ) ;
48
33
} ) ;
0 commit comments