import { TestBed } from '@kbn/test/target_types/jest' ; import { act } from 'react-dom/test-utils' ; const createSetWaitForSnapshotAction = ( testBed ) => async ( snapshotPolicyName ) => { const { find , component } = testBed ; act ( ( ) => { find ( 'snapshotPolicyCombobox' ) . simulate ( 'change' , [ { label : snapshotPolicyName } ] ) ; } ) ; component . update ( ) ; } ; export const createSnapshotPolicyActions = ( testBed ) => { const { exists } = testBed ; return { setSnapshotPolicy : createSetWaitForSnapshotAction ( testBed ) , hasCustomPolicyCallout : ( ) => exists ( 'customPolicyCallout' ) , hasPolicyErrorCallout : ( ) => exists ( 'policiesErrorCallout' ) , hasNoPoliciesCallout : ( ) => exists ( 'noPoliciesCallout' ) , } ; } ;