@@ -2229,6 +2229,14 @@ describe('Test lib.js:', function() {
22292229 it ( 'replaces empty key with empty string' , function ( ) {
22302230 expect ( Lib . templateString ( 'foo %{} %{}' , { } ) ) . toEqual ( 'foo ' ) ;
22312231 } ) ;
2232+
2233+ it ( 'should work with the number *0*' , function ( ) {
2234+ expect ( Lib . templateString ( '%{group}' , { group : 0 } ) ) . toEqual ( '0' ) ;
2235+ } ) ;
2236+
2237+ it ( 'should work with the number *0* (nested case)' , function ( ) {
2238+ expect ( Lib . templateString ( '%{x.y}' , { 'x' : { y : 0 } } ) ) . toEqual ( '0' ) ;
2239+ } ) ;
22322240 } ) ;
22332241
22342242 describe ( 'hovertemplateString' , function ( ) {
@@ -2249,6 +2257,14 @@ describe('Test lib.js:', function() {
22492257 expect ( Lib . hovertemplateString ( 'foo %{bar[0].baz}' , { } , locale , { bar : [ { baz : 'asdf' } ] } ) ) . toEqual ( 'foo asdf' ) ;
22502258 } ) ;
22512259
2260+ it ( 'should work with the number *0*' , function ( ) {
2261+ expect ( Lib . hovertemplateString ( '%{group}' , { } , locale , { group : 0 } ) ) . toEqual ( '0' ) ;
2262+ } ) ;
2263+
2264+ it ( 'should work with the number *0* (nested case)' , function ( ) {
2265+ expect ( Lib . hovertemplateString ( '%{x.y}' , { } , locale , { 'x' : { y : 0 } } ) ) . toEqual ( '0' ) ;
2266+ } ) ;
2267+
22522268 it ( 'subtitutes multiple matches' , function ( ) {
22532269 expect ( Lib . hovertemplateString ( 'foo %{group} %{trace}' , { } , locale , { group : 'asdf' , trace : 'jkl;' } ) ) . toEqual ( 'foo asdf jkl;' ) ;
22542270 } ) ;
0 commit comments