Skip to content

Commit db6f82d

Browse files
committed
add hovertemplateString test for the number *0*
1 parent c7dd66a commit db6f82d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/jasmine/tests/lib_test.js

+8
Original file line numberDiff line numberDiff line change
@@ -2257,6 +2257,14 @@ describe('Test lib.js:', function() {
22572257
expect(Lib.hovertemplateString('foo %{bar[0].baz}', {}, locale, {bar: [{baz: 'asdf'}]})).toEqual('foo asdf');
22582258
});
22592259

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+
22602268
it('subtitutes multiple matches', function() {
22612269
expect(Lib.hovertemplateString('foo %{group} %{trace}', {}, locale, {group: 'asdf', trace: 'jkl;'})).toEqual('foo asdf jkl;');
22622270
});

0 commit comments

Comments
 (0)