import React from 'react' ; import { render , screen } from '@testing-library/react' ; import { ObservabilityStatusBoxes } from './observability_status_boxes' ; describe ( 'ObservabilityStatusBoxes' , ( ) => { it ( 'should render all boxes passed as prop' , ( ) => { const boxes = [ { id : 'logs' , dataSourceName : 'Logs' , hasData : true , description : 'This is the description for logs' , modules : [ ] , integrationLink : 'http://example.com' , learnMoreLink : 'http://example.com' , } , { id : 'metrics' , dataSourceName : 'Metrics' , hasData : true , description : 'This is the description for metrics' , modules : [ ] , integrationLink : 'http://example.com' , learnMoreLink : 'http://example.com' , } , ] ; render ( < ObservabilityStatusBoxes boxes = { boxes } / > ) ; expect ( screen . getByText ( 'Logs' ) ) . toBeInTheDocument ( ) ; expect ( screen . getByText ( 'Metrics' ) ) . toBeInTheDocument ( ) ; } ) ; } ) ;