@@ -12,8 +12,14 @@ import {
12
12
getSeriesAndDomain ,
13
13
getSidebarItems ,
14
14
} from './data_formatting' ;
15
- import { MimeType , FriendlyFlyoutLabels , FriendlyTimingLabels , Timings , Metadata } from './types' ;
16
- import { WaterfallDataEntry } from './types' ;
15
+ import {
16
+ MimeType ,
17
+ FriendlyFlyoutLabels ,
18
+ FriendlyTimingLabels ,
19
+ Timings ,
20
+ Metadata ,
21
+ WaterfallTooltipItem ,
22
+ } from './types' ;
17
23
import type { DateFormatter } from '../../../../../../hooks/use_date_format' ;
18
24
import { mockMoment } from '../../../../utils/formatting/test_helpers' ;
19
25
import { NetworkEvent } from '../../../../../../../common/runtime_types' ;
@@ -247,11 +253,6 @@ describe('getSeriesAndDomain', () => {
247
253
"colour": "#b0c9e0",
248
254
"id": 0,
249
255
"isHighlighted": true,
250
- "showTooltip": true,
251
- "tooltipProps": Object {
252
- "colour": "#b0c9e0",
253
- "value": "Queued / Blocked: 0.9ms",
254
- },
255
256
},
256
257
"x": 0,
257
258
"y": 0.8540000017092098,
@@ -262,11 +263,6 @@ describe('getSeriesAndDomain', () => {
262
263
"colour": "#aad9cc",
263
264
"id": 0,
264
265
"isHighlighted": true,
265
- "showTooltip": true,
266
- "tooltipProps": Object {
267
- "colour": "#aad9cc",
268
- "value": "DNS: 4ms",
269
- },
270
266
},
271
267
"x": 0,
272
268
"y": 4.413999999087537,
@@ -277,11 +273,6 @@ describe('getSeriesAndDomain', () => {
277
273
"colour": "#c8b8dc",
278
274
"id": 0,
279
275
"isHighlighted": true,
280
- "showTooltip": true,
281
- "tooltipProps": Object {
282
- "colour": "#c8b8dc",
283
- "value": "Connecting: 26ms",
284
- },
285
276
},
286
277
"x": 0,
287
278
"y": 30.135000000882428,
@@ -292,11 +283,6 @@ describe('getSeriesAndDomain', () => {
292
283
"colour": "#e5c7d7",
293
284
"id": 0,
294
285
"isHighlighted": true,
295
- "showTooltip": true,
296
- "tooltipProps": Object {
297
- "colour": "#e5c7d7",
298
- "value": "TLS: 55ms",
299
- },
300
286
},
301
287
"x": 0,
302
288
"y": 85.52200000121957,
@@ -307,11 +293,6 @@ describe('getSeriesAndDomain', () => {
307
293
"colour": "#f3b3a6",
308
294
"id": 0,
309
295
"isHighlighted": true,
310
- "showTooltip": true,
311
- "tooltipProps": Object {
312
- "colour": "#f3b3a6",
313
- "value": "Sending request: 0.4ms",
314
- },
315
296
},
316
297
"x": 0,
317
298
"y": 85.88200000303914,
@@ -322,11 +303,6 @@ describe('getSeriesAndDomain', () => {
322
303
"colour": "#e7664c",
323
304
"id": 0,
324
305
"isHighlighted": true,
325
- "showTooltip": true,
326
- "tooltipProps": Object {
327
- "colour": "#e7664c",
328
- "value": "Waiting (TTFB): 35ms",
329
- },
330
306
},
331
307
"x": 0,
332
308
"y": 120.4600000019127,
@@ -337,11 +313,6 @@ describe('getSeriesAndDomain', () => {
337
313
"colour": "#9170b8",
338
314
"id": 0,
339
315
"isHighlighted": true,
340
- "showTooltip": true,
341
- "tooltipProps": Object {
342
- "colour": "#9170b8",
343
- "value": "Content downloading (CSS): 0.6ms",
344
- },
345
316
},
346
317
"x": 0,
347
318
"y": 121.01200000324752,
@@ -352,11 +323,6 @@ describe('getSeriesAndDomain', () => {
352
323
"colour": "#b0c9e0",
353
324
"id": 1,
354
325
"isHighlighted": true,
355
- "showTooltip": true,
356
- "tooltipProps": Object {
357
- "colour": "#b0c9e0",
358
- "value": "Queued / Blocked: 85ms",
359
- },
360
326
},
361
327
"x": 1,
362
328
"y": 84.90799999795854,
@@ -367,11 +333,6 @@ describe('getSeriesAndDomain', () => {
367
333
"colour": "#f3b3a6",
368
334
"id": 1,
369
335
"isHighlighted": true,
370
- "showTooltip": true,
371
- "tooltipProps": Object {
372
- "colour": "#f3b3a6",
373
- "value": "Sending request: 0.2ms",
374
- },
375
336
},
376
337
"x": 1,
377
338
"y": 85.14699999883305,
@@ -382,11 +343,6 @@ describe('getSeriesAndDomain', () => {
382
343
"colour": "#e7664c",
383
344
"id": 1,
384
345
"isHighlighted": true,
385
- "showTooltip": true,
386
- "tooltipProps": Object {
387
- "colour": "#e7664c",
388
- "value": "Waiting (TTFB): 53ms",
389
- },
390
346
},
391
347
"x": 1,
392
348
"y": 137.70799999925657,
@@ -397,11 +353,6 @@ describe('getSeriesAndDomain', () => {
397
353
"colour": "#da8b45",
398
354
"id": 1,
399
355
"isHighlighted": true,
400
- "showTooltip": true,
401
- "tooltipProps": Object {
402
- "colour": "#da8b45",
403
- "value": "Content downloading (JS): 3ms",
404
- },
405
356
},
406
357
"x": 1,
407
358
"y": 140.7760000010603,
@@ -420,11 +371,6 @@ describe('getSeriesAndDomain', () => {
420
371
"colour": "#b0c9e0",
421
372
"id": 0,
422
373
"isHighlighted": true,
423
- "showTooltip": true,
424
- "tooltipProps": Object {
425
- "colour": "#b0c9e0",
426
- "value": "Queued / Blocked: 0.9ms",
427
- },
428
374
},
429
375
"x": 0,
430
376
"y": 0.8540000017092098,
@@ -435,11 +381,6 @@ describe('getSeriesAndDomain', () => {
435
381
"colour": "#aad9cc",
436
382
"id": 0,
437
383
"isHighlighted": true,
438
- "showTooltip": true,
439
- "tooltipProps": Object {
440
- "colour": "#aad9cc",
441
- "value": "DNS: 4ms",
442
- },
443
384
},
444
385
"x": 0,
445
386
"y": 4.413999999087537,
@@ -450,11 +391,6 @@ describe('getSeriesAndDomain', () => {
450
391
"colour": "#c8b8dc",
451
392
"id": 0,
452
393
"isHighlighted": true,
453
- "showTooltip": true,
454
- "tooltipProps": Object {
455
- "colour": "#c8b8dc",
456
- "value": "Connecting: 26ms",
457
- },
458
394
},
459
395
"x": 0,
460
396
"y": 30.135000000882428,
@@ -465,11 +401,6 @@ describe('getSeriesAndDomain', () => {
465
401
"colour": "#e5c7d7",
466
402
"id": 0,
467
403
"isHighlighted": true,
468
- "showTooltip": true,
469
- "tooltipProps": Object {
470
- "colour": "#e5c7d7",
471
- "value": "TLS: 55ms",
472
- },
473
404
},
474
405
"x": 0,
475
406
"y": 85.52200000121957,
@@ -480,11 +411,6 @@ describe('getSeriesAndDomain', () => {
480
411
"colour": "#f3b3a6",
481
412
"id": 0,
482
413
"isHighlighted": true,
483
- "showTooltip": true,
484
- "tooltipProps": Object {
485
- "colour": "#f3b3a6",
486
- "value": "Sending request: 0.4ms",
487
- },
488
414
},
489
415
"x": 0,
490
416
"y": 85.88200000303914,
@@ -495,11 +421,6 @@ describe('getSeriesAndDomain', () => {
495
421
"colour": "#e7664c",
496
422
"id": 0,
497
423
"isHighlighted": true,
498
- "showTooltip": true,
499
- "tooltipProps": Object {
500
- "colour": "#e7664c",
501
- "value": "Waiting (TTFB): 35ms",
502
- },
503
424
},
504
425
"x": 0,
505
426
"y": 120.4600000019127,
@@ -510,11 +431,6 @@ describe('getSeriesAndDomain', () => {
510
431
"colour": "#9170b8",
511
432
"id": 0,
512
433
"isHighlighted": true,
513
- "showTooltip": true,
514
- "tooltipProps": Object {
515
- "colour": "#9170b8",
516
- "value": "Content downloading (CSS): 0.6ms",
517
- },
518
434
},
519
435
"x": 0,
520
436
"y": 121.01200000324752,
@@ -524,11 +440,6 @@ describe('getSeriesAndDomain', () => {
524
440
"config": Object {
525
441
"colour": "#da8b45",
526
442
"isHighlighted": true,
527
- "showTooltip": true,
528
- "tooltipProps": Object {
529
- "colour": "#da8b45",
530
- "value": "Content downloading (JS): 3ms",
531
- },
532
443
},
533
444
"x": 1,
534
445
"y": 3.714999998046551,
@@ -546,8 +457,6 @@ describe('getSeriesAndDomain', () => {
546
457
"config": Object {
547
458
"colour": "",
548
459
"isHighlighted": true,
549
- "showTooltip": false,
550
- "tooltipProps": undefined,
551
460
},
552
461
"x": 0,
553
462
"y": 0,
@@ -614,8 +523,10 @@ describe('getSeriesAndDomain', () => {
614
523
"value": undefined,
615
524
},
616
525
],
526
+ "networkItemTooltipProps": Array [],
617
527
"requestHeaders": undefined,
618
528
"responseHeaders": undefined,
529
+ "showTooltip": false,
619
530
"url": "file:///Users/dominiqueclarke/dev/synthetics/examples/todos/app/app.js",
620
531
"x": 0,
621
532
},
@@ -625,8 +536,6 @@ describe('getSeriesAndDomain', () => {
625
536
"config": Object {
626
537
"colour": "",
627
538
"isHighlighted": true,
628
- "showTooltip": false,
629
- "tooltipProps": undefined,
630
539
},
631
540
"x": 0,
632
541
"y": 0,
@@ -660,23 +569,21 @@ describe('getSeriesAndDomain', () => {
660
569
} ) ;
661
570
662
571
it ( 'handles formatting when mime type is not mapped to a specific mime type bucket' , ( ) => {
663
- const { series } = getSeriesAndDomain (
572
+ const { metadata } = getSeriesAndDomain (
664
573
networkItemsWithUnknownMimeType ,
665
574
false ,
666
575
mockDateFormatter
667
576
) ;
668
577
/* verify that raw mime type appears in the tooltip config and that
669
578
* the colour is mapped to mime type other */
670
- const contentDownloadingConfigItem = series . find ( ( item : WaterfallDataEntry ) => {
671
- const { tooltipProps } = item . config ;
672
- if ( tooltipProps && typeof tooltipProps . value === 'string' ) {
579
+ const contentDownloadingConfigItem = metadata [ 0 ] . networkItemTooltipProps . find (
580
+ ( item : WaterfallTooltipItem ) => {
673
581
return (
674
- tooltipProps . value . includes ( 'application/x-unknown' ) &&
675
- tooltipProps . colour === colourPalette [ MimeType . Other ]
582
+ item . value . includes ( 'application/x-unknown' ) &&
583
+ item . colour === colourPalette [ MimeType . Other ]
676
584
) ;
677
585
}
678
- return false ;
679
- } ) ;
586
+ ) ;
680
587
expect ( contentDownloadingConfigItem ) . toBeDefined ( ) ;
681
588
} ) ;
682
589
0 commit comments