import { TestBed , SetupFunc } from '@kbn/test/jest' ; export interface PolicyFormTestBed extends TestBed < PolicyFormTestSubjects > { actions : { clickNextButton : ( ) => void ; clickSubmitButton : ( ) => void ; } ; } export const formSetup = async ( initTestBed ) : Promise < PolicyFormTestBed > => { const testBed = await initTestBed ( ) ; const clickNextButton = ( ) => { testBed . find ( 'nextButton' ) . simulate ( 'click' ) ; } ; const clickSubmitButton = ( ) => { testBed . find ( 'submitButton' ) . simulate ( 'click' ) ; } ; return { ... testBed , actions : { clickNextButton , clickSubmitButton , } , } ; } ; export type PolicyFormTestSubjects = 'advancedCronInput' | 'allIndicesToggle' | 'backButton' | 'deselectIndicesLink' | 'allDataStreamsToggle' | 'deselectDataStreamLink' | 'expireAfterValueInput' | 'expireAfterUnitSelect' | 'ignoreUnavailableIndicesToggle' | 'nameInput' | 'maxCountInput' | 'minCountInput' | 'nextButton' | 'pageTitle' | 'savePolicyApiError' | 'selectIndicesLink' | 'showAdvancedCronLink' | 'snapshotNameInput' | 'dataStreamBadge' | 'repositoryNotFoundWarning' | 'repositorySelect' | 'submitButton' ;