@@ -33,22 +33,35 @@ export default function ApiTest({ getService }: FtrProviderContext) {
3333 before ( ( ) => esArchiver . load ( '8.0.0' ) ) ;
3434 after ( ( ) => esArchiver . unload ( '8.0.0' ) ) ;
3535
36- it ( 'returns the transaction breakdown' , async ( ) => {
36+ it ( 'returns the transaction breakdown for a service ' , async ( ) => {
3737 const response = await supertest . get (
3838 `/api/apm/services/opbeans-node/transaction_groups/breakdown?start=${ start } &end=${ end } &uiFilters=${ uiFilters } &transactionType=${ transactionType } `
3939 ) ;
4040
4141 expect ( response . status ) . to . be ( 200 ) ;
4242 expect ( response . body ) . to . eql ( expectedBreakdown ) ;
4343 } ) ;
44- it ( 'returns the transaction breakdown with transaction name ' , async ( ) => {
44+ it ( 'returns the transaction breakdown for a transaction group ' , async ( ) => {
4545 const response = await supertest . get (
4646 `/api/apm/services/opbeans-node/transaction_groups/breakdown?start=${ start } &end=${ end } &uiFilters=${ uiFilters } &transactionType=${ transactionType } &transactionName=${ transactionName } `
4747 ) ;
4848
4949 expect ( response . status ) . to . be ( 200 ) ;
5050 expect ( response . body ) . to . eql ( expectedBreakdownWithTransactionName ) ;
5151 } ) ;
52+ it ( 'returns the kpis sorted by percentage and name' , async ( ) => {
53+ const response = await supertest . get (
54+ `/api/apm/services/opbeans-node/transaction_groups/breakdown?start=${ start } &end=${ end } &uiFilters=${ uiFilters } &transactionType=${ transactionType } `
55+ ) ;
56+
57+ expect ( response . status ) . to . be ( 200 ) ;
58+ expect ( response . body . kpis ) . to . eql ( [
59+ { name : 'app' , percentage : 0.16700861715223636 , color : '#54b399' } ,
60+ { name : 'http' , percentage : 0.7702092736971686 , color : '#6092c0' } ,
61+ { name : 'postgresql' , percentage : 0.0508822322527698 , color : '#d36086' } ,
62+ { name : 'redis' , percentage : 0.011899876897825195 , color : '#9170b8' } ,
63+ ] ) ;
64+ } ) ;
5265 } ) ;
5366 } ) ;
5467}
0 commit comments