import { createStore } from '@client/store' ; import { createTestComponent } from '@client/tests/util' ; import { ReactWrapper } from 'enzyme' ; import * as React from 'react' ; import { ReportList } from './ReportList' ; import { MonthlyReports } from './MonthlyReports' ; describe ( 'Report list' , ( ) => { const { store , history } = createStore ( ) ; let app ; describe ( 'Report list with defined param' , ( ) => { beforeAll ( async ( ) => { app = ( await createTestComponent ( < ReportList history = { history } / > , store ) ) . component ; app . update ( ) ; } ) ; it ( 'loads list table' , ( ) => { expect ( app . find ( MonthlyReports ) ) . toHaveLength ( 1 ) ; } ) ; } ) ; describe ( 'Report list with default param' , ( ) => { beforeAll ( async ( ) => { app = ( await createTestComponent ( < ReportList match = { { params : { } } } history = { history } / > , store ) ) . component ; app . update ( ) ; } ) ; it ( 'loads list table' , ( ) => { expect ( app . find ( MonthlyReports ) ) . toHaveLength ( 1 ) ; } ) ; } ) ; } ) ;