@@ -34,7 +34,7 @@ describe("aggregateDataPoints", () => {
3434
3535 expect ( result . x ) . toEqual ( [ "A" , "B" , "C" ] ) ;
3636 expect ( result . y ) . toEqual ( [ 25 , 45 , 30 ] ) ;
37- expect ( result . hovertext ) . toEqual ( [ "SUM: 25 (2 values) " , "SUM: 45 (2 values) " , "hover4" ] ) ;
37+ expect ( result . hovertext ) . toEqual ( [ "25 " , "45 " , "hover4" ] ) ;
3838 } ) ;
3939
4040 it ( "should preserve original hover text for single values" , ( ) => {
@@ -100,7 +100,7 @@ describe("aggregateDataPoints", () => {
100100 expect ( result . y ) . toEqual ( [ 25 , 20 ] ) ;
101101 // For A (grouped): "SUM: 25 (2 values)"
102102 // For B (single, no original hovertext): undefined
103- expect ( result . hovertext ) . toEqual ( [ "SUM: 25 (2 values) " , undefined ] ) ;
103+ expect ( result . hovertext ) . toEqual ( [ "25 " , undefined ] ) ;
104104 expect ( result . hoverinfo ) . toBe ( "text" ) ; // Because "SUM: 25 (2 values)" is present
105105 } ) ;
106106
@@ -133,7 +133,7 @@ describe("aggregateDataPoints", () => {
133133 ] as Array < [ AggregationType , number ] > ) ( "should correctly compute aggregation" , ( aggregationType , expected ) => {
134134 const result = aggregateDataPoints ( aggregationType , points ) ;
135135 expect ( result . y ) . toEqual ( [ expected ] ) ;
136- expect ( result . hovertext ) . toEqual ( [ ` ${ aggregationType . toUpperCase ( ) } : ${ expected } (4 values)` ] ) ;
136+ expect ( result . hovertext ) . toEqual ( [ expected . toLocaleString ( ) ] ) ;
137137 } ) ;
138138
139139 describe ( "median aggregation" , ( ) => {
@@ -197,7 +197,7 @@ describe("aggregateDataPoints", () => {
197197 points . hovertext = [ "hover1" , undefined as any , "hover3" , "hover4" ] ;
198198 const result = aggregateDataPoints ( "sum" , points ) ;
199199
200- expect ( result . hovertext ) . toEqual ( [ "SUM: 25 (2 values) " , "SUM: 45 (2 values) " ] ) ;
200+ expect ( result . hovertext ) . toEqual ( [ "25 " , "45 " ] ) ;
201201 } ) ;
202202
203203 it ( "should preserve other properties and original data for non-aggregated points" , ( ) => {
@@ -223,21 +223,21 @@ describe("aggregateDataPoints", () => {
223223 const points = createMockDataPoints ( [ "A" , "A" ] , [ 10 , 15 ] , [ "hover1" , "hover2" ] ) ;
224224 const result = aggregateDataPoints ( "avg" , points ) ;
225225
226- expect ( result . hovertext ) . toEqual ( [ "AVG: 12.5 (2 values) " ] ) ;
226+ expect ( result . hovertext ) . toEqual ( [ "12.5" ] ) ;
227227 } ) ;
228228
229229 it ( "should handle decimal values in hover text" , ( ) => {
230230 const points = createMockDataPoints ( [ "A" , "A" ] , [ 1 , 2 ] , [ "hover1" , "hover2" ] ) ;
231231 const result = aggregateDataPoints ( "avg" , points ) ;
232232
233- expect ( result . hovertext ) . toEqual ( [ "AVG: 1.5 (2 values) " ] ) ;
233+ expect ( result . hovertext ) . toEqual ( [ "1.5" ] ) ;
234234 } ) ;
235235
236236 it ( "should show count in hover text" , ( ) => {
237237 const points = createMockDataPoints ( [ "A" , "A" , "A" ] , [ 1 , 2 , 3 ] , [ "h1" , "h2" , "h3" ] ) ;
238238 const result = aggregateDataPoints ( "sum" , points ) ;
239239
240- expect ( result . hovertext ) . toEqual ( [ "SUM: 6 (3 values) " ] ) ;
240+ expect ( result . hovertext ) . toEqual ( [ "6 " ] ) ;
241241 } ) ;
242242 } ) ;
243243} ) ;
0 commit comments