import * as React from "react" ; import { ArrayValue } from "@itwin/appui-abstract" ; import { Orientation } from "@itwin/core-react" ; import { render } from "@testing-library/react" ; import { TableArrayValueRenderer } from "../../../../../components-react/properties/renderers/value/table/ArrayValueRenderer" ; import TestUtils from "../../../../TestUtils" ; describe ( "ArrayValueRenderer" , ( ) => { it ( "renders correctly" , ( ) => { const record = TestUtils . createArrayProperty ( "Pipes" , [ TestUtils . createPrimitiveStringProperty ( "Label" , "Model" ) ] ) ; const renderer = render ( < TableArrayValueRenderer onDialogOpen = { ( ) => { } } orientation = { Orientation . Horizontal } propertyRecord = { record } / > ) ; renderer . getByText ( "string[1]" ) ; } ) ; it ( "renders correctly with empty array" , ( ) => { const record = TestUtils . createArrayProperty ( "Pipes" ) ; ( record . value as ArrayValue ) . itemsTypeName = "string" ; const renderer = render ( < TableArrayValueRenderer onDialogOpen = { ( ) => { } } orientation = { Orientation . Horizontal } propertyRecord = { record } / > ) ; renderer . getByText ( "[]" ) ; } ) ; } ) ;