66
77import expect from '@kbn/expect' ;
88import { FtrProviderContext } from '../../../api_integration/ftr_provider_context' ;
9- import { warnAndSkipTest } from '../../helpers' ;
9+ import { skipIfNoDockerRegistry } from '../../helpers' ;
10+ import { setupIngest } from '../fleet/agents/services' ;
1011
11- export default function ( { getService } : FtrProviderContext ) {
12- const log = getService ( 'log' ) ;
12+ export default function ( providerContext : FtrProviderContext ) {
13+ const { getService } = providerContext ;
1314 const supertest = getService ( 'supertest' ) ;
14- const dockerServers = getService ( 'dockerServers' ) ;
1515
16- const server = dockerServers . get ( 'registry' ) ;
1716 // use function () {} and not () => {} here
1817 // because `this` has to point to the Mocha context
1918 // see https://mochajs.org/#arrow-functions
2019
2120 describe ( 'EPM - list' , async function ( ) {
22- it ( 'lists all packages from the registry' , async function ( ) {
23- if ( server . enabled ) {
21+ skipIfNoDockerRegistry ( providerContext ) ;
22+ setupIngest ( providerContext ) ;
23+
24+ describe ( 'list api tests' , async ( ) => {
25+ it ( 'lists all packages from the registry' , async function ( ) {
2426 const fetchPackageList = async ( ) => {
2527 const response = await supertest
2628 . get ( '/api/ingest_manager/epm/packages' )
@@ -30,13 +32,9 @@ export default function ({ getService }: FtrProviderContext) {
3032 } ;
3133 const listResponse = await fetchPackageList ( ) ;
3234 expect ( listResponse . response . length ) . not . to . be ( 0 ) ;
33- } else {
34- warnAndSkipTest ( this , log ) ;
35- }
36- } ) ;
35+ } ) ;
3736
38- it ( 'lists all limited packages from the registry' , async function ( ) {
39- if ( server . enabled ) {
37+ it ( 'lists all limited packages from the registry' , async function ( ) {
4038 const fetchLimitedPackageList = async ( ) => {
4139 const response = await supertest
4240 . get ( '/api/ingest_manager/epm/packages/limited' )
@@ -46,9 +44,7 @@ export default function ({ getService }: FtrProviderContext) {
4644 } ;
4745 const listResponse = await fetchLimitedPackageList ( ) ;
4846 expect ( listResponse . response ) . to . eql ( [ 'endpoint' ] ) ;
49- } else {
50- warnAndSkipTest ( this , log ) ;
51- }
47+ } ) ;
5248 } ) ;
5349 } ) ;
5450}
0 commit comments