@@ -20,6 +20,8 @@ import stackedSeries from '../../../fixtures/mock_data/date_histogram/_stacked_s
2020import { vislibPointSeriesTypes } from './point_series' ;
2121import percentileTestdata from './testdata_linechart_percentile.json' ;
2222import percentileTestdataResult from './testdata_linechart_percentile_result.json' ;
23+ import percentileTestdataFloatValue from './testdata_linechart_percentile_float_value.json' ;
24+ import percentileTestdataFloatValueResult from './testdata_linechart_percentile_float_value_result.json' ;
2325
2426const maxBucketData = {
2527 get : ( prop ) => {
@@ -215,18 +217,26 @@ describe('Point Series Config Type Class Test Suite', function () {
215217 } ) ;
216218
217219 describe ( 'line chart' , function ( ) {
218- beforeEach ( function ( ) {
220+ function prepareData ( { cfg , data } ) {
219221 const percentileDataObj = {
220222 get : ( prop ) => {
221223 return maxBucketData [ prop ] || maxBucketData . data [ prop ] || null ;
222224 } ,
223225 getLabels : ( ) => [ ] ,
224- data : percentileTestdata . data ,
226+ data : data ,
225227 } ;
226- parsedConfig = vislibPointSeriesTypes . line ( percentileTestdata . cfg , percentileDataObj ) ;
227- } ) ;
228+ const parsedConfig = vislibPointSeriesTypes . line ( cfg , percentileDataObj ) ;
229+ return parsedConfig ;
230+ }
231+
228232 it ( 'should render a percentile line chart' , function ( ) {
229- expect ( JSON . stringify ( parsedConfig ) ) . toEqual ( JSON . stringify ( percentileTestdataResult ) ) ;
233+ const parsedConfig = prepareData ( percentileTestdata ) ;
234+ expect ( parsedConfig ) . toMatchObject ( percentileTestdataResult ) ;
235+ } ) ;
236+
237+ it ( 'should render a percentile line chart when value is float' , function ( ) {
238+ const parsedConfig = prepareData ( percentileTestdataFloatValue ) ;
239+ expect ( parsedConfig ) . toMatchObject ( percentileTestdataFloatValueResult ) ;
230240 } ) ;
231241 } ) ;
232242} ) ;
0 commit comments