@@ -139,7 +139,7 @@ describe('scattermapbox convert', function() {
139139 Plots . doCalcdata ( gd , fullTrace ) ;
140140
141141 var calcTrace = gd . calcdata [ 0 ] ;
142- return convert ( calcTrace ) ;
142+ return convert ( calcTrace , { _fullLayout : { _d3locale : false } } ) ;
143143 }
144144
145145 function assertVisibility ( opts , expectations ) {
@@ -478,6 +478,44 @@ describe('scattermapbox convert', function() {
478478 expect ( actualText ) . toEqual ( [ 'A' , 'B' , 'C' , 'F' , undefined ] ) ;
479479 } ) ;
480480
481+ it ( 'should generate correct output for texttemplate without text' , function ( ) {
482+ var opts = _convert ( Lib . extendFlat ( { } , base , {
483+ mode : 'lines+text' ,
484+ connectgaps : true ,
485+ textposition : 'outside' ,
486+ texttemplate : [ 'A' , 'B' , 'C' , 'D' , 'E' , 'F' ]
487+ } ) ) ;
488+
489+ var actualText = opts . symbol . geojson . features . map ( function ( f ) {
490+ return f . properties . text ;
491+ } ) ;
492+
493+ expect ( actualText ) . toEqual ( [ 'A' , 'B' , 'C' , 'F' , '' ] ) ;
494+ } ) ;
495+
496+ it ( 'should generate correct output for texttemplate' , function ( ) {
497+ var mock = {
498+ 'type' : 'scattermapbox' ,
499+ 'mode' : 'markers+text' ,
500+ 'lon' : [ - 73.57 , - 79.24 , - 123.06 ] ,
501+ 'lat' : [ 45.5 , 43.4 , 49.13 ] ,
502+ 'text' : [ 'Montreal' , 'Toronto' , 'Vancouver' ] ,
503+ 'texttemplate' : '%{text} (%{lonlat[0]}, %{lonlat[1]}): %{customdata:.2s}' ,
504+ 'textposition' : 'top center' ,
505+ 'customdata' : [ 1780000 , 2930000 , 675218 ]
506+ } ;
507+ var opts = _convert ( mock ) ;
508+ var actualText = opts . symbol . geojson . features . map ( function ( f ) {
509+ return f . properties . text ;
510+ } ) ;
511+
512+ expect ( actualText ) . toEqual ( [
513+ 'Montreal (-73.57, 45.5): 1.8M' ,
514+ 'Toronto (-79.24, 43.4): 2.9M' ,
515+ 'Vancouver (-123.06, 49.13): 680k'
516+ ] ) ;
517+ } ) ;
518+
481519 it ( 'should generate correct output for lines traces with trailing gaps' , function ( ) {
482520 var opts = _convert ( Lib . extendFlat ( { } , base , {
483521 mode : 'lines' ,
0 commit comments