File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed
x-pack/test/apm_api_integration
fixtures/es_archiver/apm_8.0.0 Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 66
77export default {
88 'apm_8.0.0' : {
9- start : '2020-09-10T08:07:13.274Z ' ,
10- end : '2020-09-10T08:37:13.274Z ' ,
9+ start : '2020-09-10T06:00:00.000Z ' ,
10+ end : '2020-09-10T07:00:00.000Z ' ,
1111 } ,
1212} ;
Original file line number Diff line number Diff line change 66
77import querystring from 'querystring' ;
88import expect from '@kbn/expect' ;
9+ import { isEmpty } from 'lodash' ;
910import { FtrProviderContext } from '../../../common/ftr_provider_context' ;
1011
1112export default function serviceMapsApiTests ( { getService } : FtrProviderContext ) {
@@ -285,5 +286,28 @@ export default function serviceMapsApiTests({ getService }: FtrProviderContext)
285286 } ) ;
286287 } ) ;
287288 } ) ;
289+
290+ describe ( 'when there is data with anomalies' , ( ) => {
291+ before ( ( ) => esArchiver . load ( 'apm_8.0.0' ) ) ;
292+ after ( ( ) => esArchiver . unload ( 'apm_8.0.0' ) ) ;
293+
294+ it ( 'returns service map elements' , async ( ) => {
295+ const start = encodeURIComponent ( '2020-09-10T06:00:00.000Z' ) ;
296+ const end = encodeURIComponent ( '2020-09-10T07:00:00.000Z' ) ;
297+
298+ const response = await supertest . get ( `/api/apm/service-map?start=${ start } &end=${ end } ` ) ;
299+
300+ expect ( response . status ) . to . be ( 200 ) ;
301+ const dataWithAnomalies = response . body . elements . filter (
302+ ( el : { data : { serviceAnomalyStats ?: { } } } ) => ! isEmpty ( el . data . serviceAnomalyStats )
303+ ) ;
304+ expect ( dataWithAnomalies ) . to . not . empty ( ) ;
305+ dataWithAnomalies . forEach ( ( { data } : any ) => {
306+ expect (
307+ Object . values ( data . serviceAnomalyStats ) . filter ( ( value ) => isEmpty ( value ) )
308+ ) . to . not . empty ( ) ;
309+ } ) ;
310+ } ) ;
311+ } ) ;
288312 } ) ;
289313}
You can’t perform that action at this time.
0 commit comments