@@ -15,6 +15,7 @@ import { CertType } from '../../../../../legacy/plugins/uptime/common/runtime_ty
1515export default function ( { getService } : FtrProviderContext ) {
1616 const supertest = getService ( 'supertest' ) ;
1717 const legacyEsService = getService ( 'legacyEs' ) ;
18+ const esArchiver = getService ( 'esArchiver' ) ;
1819
1920 describe ( 'certs api' , ( ) => {
2021 describe ( 'empty index' , async ( ) => {
@@ -23,6 +24,7 @@ export default function({ getService }: FtrProviderContext) {
2324 expect ( JSON . stringify ( apiResponse . body ) ) . to . eql ( '{"certs":[]}' ) ;
2425 } ) ;
2526 } ) ;
27+
2628 describe ( 'when data is present' , async ( ) => {
2729 const now = moment ( ) ;
2830 const cnva = now . add ( 6 , 'months' ) . toISOString ( ) ;
@@ -59,15 +61,21 @@ export default function({ getService }: FtrProviderContext) {
5961 d => d
6062 ) ;
6163 } ) ;
64+ after ( 'unload test docs' , ( ) => {
65+ esArchiver . unload ( 'uptime/blank' ) ;
66+ } ) ;
6267
6368 it ( 'pause so I can check stuff' , async ( ) => {
6469 const apiResponse = await supertest . get ( API_URLS . CERTS ) ;
6570 const { body } = apiResponse ;
71+
6672 expect ( body . certs ) . not . to . be ( undefined ) ;
6773 expect ( Array . isArray ( body . certs ) ) . to . be ( true ) ;
6874 expect ( body . certs ) . to . have . length ( 1 ) ;
75+
6976 const decoded = CertType . decode ( body . certs [ 0 ] ) ;
7077 expect ( isRight ( decoded ) ) . to . be ( true ) ;
78+
7179 const cert = body . certs [ 0 ] ;
7280 expect ( Array . isArray ( cert . monitors ) ) . to . be ( true ) ;
7381 expect ( cert . monitors [ 0 ] ) . to . eql ( { id : monitorId } ) ;
0 commit comments