import { act } from 'react-dom/test-utils' ; import { TestBed } from '@kbn/test/jest' ; export const createFormToggleAction = ( testBed , dataTestSubject ) => async ( ) => { const { form , component } = testBed ; await act ( async ( ) => { form . toggleEuiSwitch ( dataTestSubject ) ; } ) ; component . update ( ) ; } ;