@@ -10,6 +10,7 @@ import {
1010 convertToTimeChartConfig ,
1111 formatResponseForTimeChart ,
1212} from '@/ChartUtils' ;
13+ import { CHART_COLOR_ERROR , COLORS } from '@/utils' ;
1314
1415describe ( 'ChartUtils' , ( ) => {
1516 describe ( 'formatResponseForTimeChart' , ( ) => {
@@ -122,7 +123,7 @@ describe('ChartUtils', () => {
122123 } ) ;
123124 expect ( actual . lineData ) . toEqual ( [
124125 {
125- color : '#20c997' ,
126+ color : COLORS [ 0 ] ,
126127 dataKey : 'AVG(toFloat64OrDefault(toString(Duration)))' ,
127128 currentPeriodKey : 'AVG(toFloat64OrDefault(toString(Duration)))' ,
128129 previousPeriodKey :
@@ -211,7 +212,7 @@ describe('ChartUtils', () => {
211212 } ) ;
212213 expect ( actual . lineData ) . toEqual ( [
213214 {
214- color : '#20c997' ,
215+ color : COLORS [ 0 ] ,
215216 dataKey : 'AVG(toFloat64OrDefault(toString(Duration))) · checkout' ,
216217 currentPeriodKey :
217218 'AVG(toFloat64OrDefault(toString(Duration))) · checkout' ,
@@ -221,15 +222,15 @@ describe('ChartUtils', () => {
221222 isDashed : false ,
222223 } ,
223224 {
224- color : '#8250dc' ,
225+ color : COLORS [ 1 ] ,
225226 dataKey : 'max · checkout' ,
226227 currentPeriodKey : 'max · checkout' ,
227228 previousPeriodKey : 'max · checkout (previous)' ,
228229 displayName : 'max · checkout' ,
229230 isDashed : false ,
230231 } ,
231232 {
232- color : '#cdad7a' ,
233+ color : COLORS [ 2 ] ,
233234 dataKey : 'AVG(toFloat64OrDefault(toString(Duration))) · shipping' ,
234235 currentPeriodKey :
235236 'AVG(toFloat64OrDefault(toString(Duration))) · shipping' ,
@@ -239,7 +240,7 @@ describe('ChartUtils', () => {
239240 isDashed : false ,
240241 } ,
241242 {
242- color : '#0d6efd' ,
243+ color : COLORS [ 3 ] ,
243244 dataKey : 'max · shipping' ,
244245 currentPeriodKey : 'max · shipping' ,
245246 previousPeriodKey : 'max · shipping (previous)' ,
@@ -299,23 +300,23 @@ describe('ChartUtils', () => {
299300
300301 expect ( actual . lineData ) . toEqual ( [
301302 {
302- color : '#20c997' ,
303+ color : COLORS [ 0 ] ,
303304 dataKey : 'info' ,
304305 currentPeriodKey : 'info' ,
305306 previousPeriodKey : 'info (previous)' ,
306307 displayName : 'info' ,
307308 isDashed : false ,
308309 } ,
309310 {
310- color : '#20c997' ,
311+ color : COLORS [ 0 ] ,
311312 dataKey : 'debug' ,
312313 currentPeriodKey : 'debug' ,
313314 previousPeriodKey : 'debug (previous)' ,
314315 displayName : 'debug' ,
315316 isDashed : false ,
316317 } ,
317318 {
318- color : '#F81358' ,
319+ color : CHART_COLOR_ERROR ,
319320 dataKey : 'error' ,
320321 currentPeriodKey : 'error' ,
321322 previousPeriodKey : 'error (previous)' ,
@@ -403,7 +404,7 @@ describe('ChartUtils', () => {
403404 } ) ;
404405 expect ( actual . lineData ) . toEqual ( [
405406 {
406- color : '#20c997' ,
407+ color : COLORS [ 0 ] ,
407408 dataKey : 'AVG(toFloat64OrDefault(toString(Duration))) · checkout' ,
408409 currentPeriodKey :
409410 'AVG(toFloat64OrDefault(toString(Duration))) · checkout' ,
@@ -413,15 +414,15 @@ describe('ChartUtils', () => {
413414 isDashed : false ,
414415 } ,
415416 {
416- color : '#8250dc' ,
417+ color : COLORS [ 1 ] ,
417418 dataKey : 'max · checkout' ,
418419 currentPeriodKey : 'max · checkout' ,
419420 previousPeriodKey : 'max · checkout (previous)' ,
420421 displayName : 'max · checkout' ,
421422 isDashed : false ,
422423 } ,
423424 {
424- color : '#cdad7a' ,
425+ color : COLORS [ 2 ] ,
425426 dataKey : 'AVG(toFloat64OrDefault(toString(Duration))) · shipping' ,
426427 currentPeriodKey :
427428 'AVG(toFloat64OrDefault(toString(Duration))) · shipping' ,
@@ -431,7 +432,7 @@ describe('ChartUtils', () => {
431432 isDashed : false ,
432433 } ,
433434 {
434- color : '#0d6efd' ,
435+ color : COLORS [ 3 ] ,
435436 dataKey : 'max · shipping' ,
436437 currentPeriodKey : 'max · shipping' ,
437438 previousPeriodKey : 'max · shipping (previous)' ,
@@ -519,7 +520,7 @@ describe('ChartUtils', () => {
519520 } ) ;
520521 expect ( actual . lineData ) . toEqual ( [
521522 {
522- color : '#20c997' ,
523+ color : COLORS [ 0 ] ,
523524 currentPeriodKey : 'AVG(toFloat64OrDefault(toString(Duration)))' ,
524525 previousPeriodKey :
525526 'AVG(toFloat64OrDefault(toString(Duration))) (previous)' ,
@@ -528,7 +529,7 @@ describe('ChartUtils', () => {
528529 isDashed : false ,
529530 } ,
530531 {
531- color : '#20c997' ,
532+ color : COLORS [ 0 ] ,
532533 currentPeriodKey : 'AVG(toFloat64OrDefault(toString(Duration)))' ,
533534 previousPeriodKey :
534535 'AVG(toFloat64OrDefault(toString(Duration))) (previous)' ,
0 commit comments