66
77import expect from '@kbn/expect' ;
88import { FtrProviderContext } from '../../../../common/ftr_provider_context' ;
9- import { archives } from '../../config ' ;
9+ import archives from '../../archives_metadata ' ;
1010
1111export default function ApiTest ( { getService } : FtrProviderContext ) {
1212 const supertest = getService ( 'supertest' ) ;
1313 const esArchiver = getService ( 'esArchiver' ) ;
1414
15- // url parameters
16- const start = encodeURIComponent ( '2020-06-29T06:45:00.000Z' ) ;
17- const end = encodeURIComponent ( '2020-06-29T06:49:00.000Z' ) ;
15+ const range = archives [ 'apm_8.0.0' ] ;
16+ const start = encodeURIComponent ( range . start ) ;
17+ const end = encodeURIComponent ( range . end ) ;
1818
1919 describe ( 'Agent name' , ( ) => {
2020 describe ( 'when data is not loaded ' , ( ) => {
@@ -32,13 +32,9 @@ export default function ApiTest({ getService }: FtrProviderContext) {
3232 before ( ( ) => esArchiver . load ( 'apm_8.0.0' ) ) ;
3333 after ( ( ) => esArchiver . unload ( 'apm_8.0.0' ) ) ;
3434
35- const { from, to } = archives [ 'apm_8.0.0' ] ;
36-
3735 it ( 'returns the agent name' , async ( ) => {
3836 const response = await supertest . get (
39- `/api/apm/services/opbeans-node/agent_name?start=${ encodeURIComponent (
40- from
41- ) } &end=${ encodeURIComponent ( to ) } `
37+ `/api/apm/services/opbeans-node/agent_name?start=${ start } &end=${ end } `
4238 ) ;
4339
4440 expect ( response . status ) . to . be ( 200 ) ;
0 commit comments