Skip to content

Commit 1bdb8ae

Browse files
committed
add hovertemplate test for scattergeo and scatterpolar
1 parent 2e05455 commit 1bdb8ae

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

test/jasmine/tests/scattergeo_test.js

+11
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,17 @@ describe('Test scattergeo hover', function() {
299299
.then(done);
300300
});
301301

302+
it('should not hide hover label when hovertemplate', function(done) {
303+
Plotly.restyle(gd, {
304+
name: '',
305+
hovertemplate: 'tpl %{lat}<extra>x</extra>'
306+
}).then(function() {
307+
check([381, 221], ['tpl 10', 'x']);
308+
})
309+
.catch(failTest)
310+
.then(done);
311+
});
312+
302313
it('should generate hover label info (\'text\' single value case)', function(done) {
303314
Plotly.restyle(gd, 'text', 'text').then(function() {
304315
check([381, 221], ['(10°, 10°)\ntext', null]);

test/jasmine/tests/scatterpolar_test.js

+9
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,15 @@ describe('Test scatterpolar hover:', function() {
117117
},
118118
nums: 'template 4.02289202968 128.342009045',
119119
name: 'Trial 3'
120+
}, {
121+
desc: 'with hovertemplate and empty trace name',
122+
patch: function(fig) {
123+
fig.data[2].hovertemplate = 'template %{r} %{theta}';
124+
fig.data[2].name = '';
125+
return fig;
126+
},
127+
nums: 'template 4.02289202968 128.342009045',
128+
name: ''
120129
}, {
121130
desc: '(no labels - out of sector)',
122131
patch: function(fig) {

0 commit comments

Comments
 (0)