import * as React from 'react' ; import { createStore } from '@client/store' ; import { createTestComponent } from '@client/tests/util' ; import { TimeFrameReports } from '@client/views/SysAdmin/Performance/reports/TimeFrameReports' ; import { Event } from '@client/forms' ; describe ( 'Time frame report tests' , ( ) => { const { store } = createStore ( ) ; const timeFramesData = { details : [ { locationId : 'Location/d5ccd1d1-ca47-435b-93db-36c626ad2dfa' , regWithin45d : 0 , regWithin45dTo1yr : 0 , regWithin1yrTo5yr : 0 , regOver5yr : 2 , total : 2 } ] , total : { regWithin45d : 0 , regWithin45dTo1yr : 0 , regWithin1yrTo5yr : 0 , regOver5yr : 2 , total : 2 } } ; it ( 'Renders without crashing' , async ( ) => { const testComponent = await createTestComponent ( < TimeFrameReports eventType = { Event . BIRTH } data = { timeFramesData } loading = { false } / > , store ) ; const columnValueOfRegOver5Year = testComponent . component . find ( '#row_0' ) . find ( 'span' ) . at ( 5 ) ; expect ( columnValueOfRegOver5Year . text ( ) ) . toBe ( '2 (100%)' ) ; } ) ; } ) ;