@@ -559,3 +559,34 @@ test("table keeps correct column-value mapping after column reorder and brush up
559559 expect ( result . numericCount ) . toBeGreaterThan ( 0 ) ;
560560 expect ( result . uidLikeHexCount ) . toBe ( 0 ) ;
561561} ) ;
562+
563+ test ( "plotxy timestamp axis labels are not scientific notation" , async ( { page } ) => {
564+ await loadDemo ( page ) ;
565+ const result = await page . evaluate ( async ( ) => {
566+ const sleep = ( ms : number ) => new Promise ( ( resolve ) => setTimeout ( resolve , ms ) ) ;
567+ const hiplot = ( window as any ) . hiplot_last_instance ;
568+ const plotxy = hiplot ?. plugins_ref ?. XY ?. current ;
569+ if ( ! plotxy || ! plotxy . plot ) {
570+ return { error : "missing-plotxy" } ;
571+ }
572+ plotxy . setState ( { axis_x : "timestamp" } ) ;
573+ await sleep ( 250 ) ;
574+ const axisGroups = Array . from ( document . querySelectorAll ( "svg .axis_render" ) ) ;
575+ const xAxis = axisGroups [ 0 ] ;
576+ if ( ! xAxis ) {
577+ return { error : "missing-x-axis-group" } ;
578+ }
579+ const labels = Array . from ( xAxis . querySelectorAll ( ".tick text" ) ) . map ( ( el ) =>
580+ ( el . textContent || "" ) . trim ( ) ,
581+ ) ;
582+ const nonEmpty = labels . filter ( ( l ) => l . length > 0 ) ;
583+ if ( nonEmpty . length === 0 ) {
584+ return { error : "no-tick-labels" } ;
585+ }
586+ const sciCount = nonEmpty . filter ( ( l ) => / e [ + - ] ? \d + / i. test ( l ) ) . length ;
587+ return { nonEmptyCount : nonEmpty . length , sciCount, labels : nonEmpty . slice ( 0 , 12 ) } ;
588+ } ) ;
589+ expect ( result . error ) . toBeUndefined ( ) ;
590+ expect ( result . nonEmptyCount ) . toBeGreaterThan ( 0 ) ;
591+ expect ( result . sciCount ) . toBe ( 0 ) ;
592+ } ) ;
0 commit comments