import expect from '@kbn/expect' ; import { PRECONFIGURATION_API_ROUTES } from '../../../../plugins/fleet/common/constants' ; import { FtrProviderContext } from '../../../api_integration/ftr_provider_context' ; import { skipIfNoDockerRegistry } from '../../helpers' ; export default function ( providerContext ) { const { getService } = providerContext ; const supertest = getService ( 'supertest' ) ; describe ( 'Preconfiguration' , async ( ) => { skipIfNoDockerRegistry ( providerContext ) ; before ( async ( ) => { await getService ( 'esArchiver' ) . load ( 'x-pack/test/functional/es_archives/empty_kibana' ) ; await getService ( 'esArchiver' ) . load ( 'x-pack/test/functional/es_archives/fleet/empty_fleet_server' ) ; } ) ; after ( async ( ) => { await getService ( 'esArchiver' ) . unload ( 'x-pack/test/functional/es_archives/fleet/empty_fleet_server' ) ; await getService ( 'esArchiver' ) . unload ( 'x-pack/test/functional/es_archives/empty_kibana' ) ; } ) ; it ( 'should succeed with an empty payload' , async ( ) => { const { body } = await supertest . put ( PRECONFIGURATION_API_ROUTES . UPDATE_PATTERN ) . set ( 'kbn-xsrf' , 'xxxx' ) . send ( { } ) . expect ( 200 ) ; expect ( body ) . to . eql ( { packages : [ ] , policies : [ ] , nonFatalErrors : [ ] , } ) ; } ) ; } ) ; }