File tree Expand file tree Collapse file tree
src/chart_types/xy_chart/tooltip Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ describe('Tooltip formatting', () => {
5555 showOverlappingTicks : false ,
5656 tickPadding : 0 ,
5757 tickSize : 0 ,
58- tickFormat : ( d ) => `${ d } ` ,
58+ tickFormat : jest . fn ( ( d ) => `${ d } ` ) ,
5959 } ;
6060 const seriesStyle = {
6161 rect : {
@@ -125,6 +125,7 @@ describe('Tooltip formatting', () => {
125125 expect ( tooltipValue . isHighlighted ) . toBe ( false ) ;
126126 expect ( tooltipValue . color ) . toBe ( 'blue' ) ;
127127 expect ( tooltipValue . value ) . toBe ( '10' ) ;
128+ expect ( YAXIS_SPEC . tickFormat ) . not . toBeCalledWith ( null , undefined ) ;
128129 } ) ;
129130 it ( 'should set name as spec name when provided' , ( ) => {
130131 const name = 'test - spec' ;
Original file line number Diff line number Diff line change @@ -82,14 +82,13 @@ export function formatTooltip(
8282
8383 const value = isHeader ? x : y ;
8484 const tickFormatOptions : TickFormatterOptions | undefined = spec . timeZone ? { timeZone : spec . timeZone } : undefined ;
85- const markValue = axisSpec ? axisSpec . tickFormat ( mark , tickFormatOptions ) : emptyFormatter ( mark ) ;
8685
8786 return {
8887 seriesIdentifier,
8988 valueAccessor : accessor ,
9089 label,
9190 value : axisSpec ? axisSpec . tickFormat ( value , tickFormatOptions ) : emptyFormatter ( value ) ,
92- markValue : isHeader || mark === null ? null : markValue ,
91+ markValue : isHeader || mark === null ? null : mark ,
9392 color,
9493 isHighlighted : isHeader ? false : isHighlighted ,
9594 isVisible,
You can’t perform that action at this time.
0 commit comments