import expect from '@kbn/expect' ; import type { FtrProviderContext } from '../../../common/ftr_provider_context' ; import { obsOnlyRead } from '../../../common/lib/authentication/users' ; import { getAlertsTargetIndices } from '../../../common/lib/helpers' ; export default function registryRulesApiTest ( { getService } ) { const es = getService ( 'es' ) ; describe ( 'Rule Registry API' , ( ) => { describe ( 'with read permissions' , ( ) => { it ( 'does not bootstrap the apm rule indices' , async ( ) => { const { body : targetIndices } = await getAlertsTargetIndices ( getService , obsOnlyRead , 'space1' ) ; const errorOrUndefined = await es . indices . get ( { index : targetIndices [ 0 ] , expand_wildcards : 'open' , allow_no_indices : false , } ) . then ( ( ) => { } ) . catch ( ( error ) => { return error . toString ( ) ; } ) ; expect ( errorOrUndefined ) . not . to . be ( undefined ) ; expect ( errorOrUndefined ) . to . contain ( 'index_not_found_exception' ) ; } ) ; } ) ; } ) ; }