@@ -15,6 +15,8 @@ import {
1515 warningColor ,
1616 errorColor ,
1717} from '../../utils/httpStatusCodeToColor' ;
18+ // eslint-disable-next-line @kbn/eslint/no-restricted-paths
19+ import { ApmTimeSeriesResponse } from '../../../server/lib/transactions/charts/get_timeseries_data/transform' ;
1820
1921describe ( 'chartSelectors' , ( ) => {
2022 describe ( 'getAnomalyScoreSeries' , ( ) => {
@@ -98,7 +100,7 @@ describe('chartSelectors', () => {
98100 } ) ;
99101
100102 describe ( 'getTpmSeries' , ( ) => {
101- const apmTimeseries = {
103+ const apmTimeseries : ApmTimeSeriesResponse = {
102104 responseTimes : {
103105 avg : [ ] ,
104106 p95 : [ ] ,
@@ -107,13 +109,14 @@ describe('chartSelectors', () => {
107109 tpmBuckets : [
108110 {
109111 key : 'HTTP 2xx' ,
112+ avg : 3.5 ,
110113 dataPoints : [
111114 { x : 0 , y : 5 } ,
112- { x : 0 , y : 2 } ,
115+ { x : 1 , y : 2 } ,
113116 ] ,
114117 } ,
115- { key : 'HTTP 4xx' , dataPoints : [ { x : 0 , y : 1 } ] } ,
116- { key : 'HTTP 5xx' , dataPoints : [ { x : 0 , y : 0 } ] } ,
118+ { key : 'HTTP 4xx' , avg : 1 , dataPoints : [ { x : 0 , y : 1 } ] } ,
119+ { key : 'HTTP 5xx' , avg : 0 , dataPoints : [ { x : 0 , y : 0 } ] } ,
117120 ] ,
118121 overallAvgDuration : 200 ,
119122 } ;
@@ -125,7 +128,7 @@ describe('chartSelectors', () => {
125128 color : successColor ,
126129 data : [
127130 { x : 0 , y : 5 } ,
128- { x : 0 , y : 2 } ,
131+ { x : 1 , y : 2 } ,
129132 ] ,
130133 legendValue : '3.5 tpm' ,
131134 title : 'HTTP 2xx' ,
@@ -154,7 +157,7 @@ describe('chartSelectors', () => {
154157 expect (
155158 getTpmSeries ( {
156159 ...apmTimeseries ,
157- tpmBuckets : [ { key, dataPoints : [ { x : 0 , y : 0 } ] } ] ,
160+ tpmBuckets : [ { key, avg : 0 , dataPoints : [ { x : 0 , y : 0 } ] } ] ,
158161 } ) [ 0 ] . color
159162 ) . toEqual ( theme . euiColorSecondary ) ;
160163 } ) ;
@@ -166,7 +169,7 @@ describe('chartSelectors', () => {
166169 expect (
167170 getTpmSeries ( {
168171 ...apmTimeseries ,
169- tpmBuckets : [ { key, dataPoints : [ { x : 0 , y : 0 } ] } ] ,
172+ tpmBuckets : [ { key, avg : 0 , dataPoints : [ { x : 0 , y : 0 } ] } ] ,
170173 } ) [ 0 ] . color
171174 ) . toEqual ( theme . euiColorSecondary ) ;
172175 } ) ;
@@ -178,7 +181,7 @@ describe('chartSelectors', () => {
178181 expect (
179182 getTpmSeries ( {
180183 ...apmTimeseries ,
181- tpmBuckets : [ { key, dataPoints : [ { x : 0 , y : 0 } ] } ] ,
184+ tpmBuckets : [ { key, avg : 0 , dataPoints : [ { x : 0 , y : 0 } ] } ] ,
182185 } ) [ 0 ] . color
183186 ) . toEqual ( theme . euiColorSecondary ) ;
184187 } ) ;
@@ -190,7 +193,7 @@ describe('chartSelectors', () => {
190193 expect (
191194 getTpmSeries ( {
192195 ...apmTimeseries ,
193- tpmBuckets : [ { key, dataPoints : [ { x : 0 , y : 0 } ] } ] ,
196+ tpmBuckets : [ { key, avg : 0 , dataPoints : [ { x : 0 , y : 0 } ] } ] ,
194197 } ) [ 0 ] . color
195198 ) . toEqual ( theme . euiColorSecondary ) ;
196199 } ) ;
@@ -202,7 +205,7 @@ describe('chartSelectors', () => {
202205 expect (
203206 getTpmSeries ( {
204207 ...apmTimeseries ,
205- tpmBuckets : [ { key, dataPoints : [ { x : 0 , y : 0 } ] } ] ,
208+ tpmBuckets : [ { key, avg : 0 , dataPoints : [ { x : 0 , y : 0 } ] } ] ,
206209 } ) [ 0 ] . color
207210 ) . toEqual ( theme . euiColorDanger ) ;
208211 } ) ;
@@ -214,7 +217,7 @@ describe('chartSelectors', () => {
214217 expect (
215218 getTpmSeries ( {
216219 ...apmTimeseries ,
217- tpmBuckets : [ { key, dataPoints : [ { x : 0 , y : 0 } ] } ] ,
220+ tpmBuckets : [ { key, avg : 0 , dataPoints : [ { x : 0 , y : 0 } ] } ] ,
218221 } ) [ 0 ] . color
219222 ) . toEqual ( theme . euiColorDanger ) ;
220223 } ) ;
@@ -226,7 +229,7 @@ describe('chartSelectors', () => {
226229 expect (
227230 getTpmSeries ( {
228231 ...apmTimeseries ,
229- tpmBuckets : [ { key, dataPoints : [ { x : 0 , y : 0 } ] } ] ,
232+ tpmBuckets : [ { key, avg : 0 , dataPoints : [ { x : 0 , y : 0 } ] } ] ,
230233 } ) [ 0 ] . color
231234 ) . toEqual ( theme . euiColorDanger ) ;
232235 } ) ;
@@ -238,7 +241,7 @@ describe('chartSelectors', () => {
238241 expect (
239242 getTpmSeries ( {
240243 ...apmTimeseries ,
241- tpmBuckets : [ { key, dataPoints : [ { x : 0 , y : 0 } ] } ] ,
244+ tpmBuckets : [ { key, avg : 0 , dataPoints : [ { x : 0 , y : 0 } ] } ] ,
242245 } ) [ 0 ] . color
243246 ) . toEqual ( theme . euiColorDanger ) ;
244247 } ) ;
0 commit comments