Skip to content

Commit dd673a2

Browse files
committed
add test for pie title.position restyle calls
... which are now correctly declared as editType:'plot'
1 parent 23bc199 commit dd673a2

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/traces/pie/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ module.exports = {
213213
'bottom left', 'bottom center', 'bottom right'
214214
],
215215
role: 'info',
216-
editType: 'plot', // TODO: test
216+
editType: 'plot',
217217
description: [
218218
'Specifies the location of the `title`.',
219219
'Note that the title\'s position used to be set',

test/jasmine/tests/pie_test.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,30 @@ describe('Pie traces', function() {
428428
.then(done);
429429
});
430430

431+
it('should be able to restyle title position', function(done) {
432+
Plotly.newPlot(gd, [{
433+
values: [3, 2, 1],
434+
title: 'Test<BR>Title',
435+
titleposition: 'top left',
436+
titlefont: {
437+
size: 12
438+
},
439+
type: 'pie',
440+
textinfo: 'none'
441+
}], {height: 300, width: 300})
442+
.then(_verifyTitle(true, false, true, false, false))
443+
.then(function() { return Plotly.restyle(gd, 'titleposition', 'top right'); })
444+
.then(_verifyTitle(false, true, true, false, false))
445+
.then(function() { return Plotly.restyle(gd, 'titleposition', 'bottom left'); })
446+
.then(_verifyTitle(true, false, false, true, false))
447+
.then(function() { return Plotly.restyle(gd, 'titleposition', 'bottom center'); })
448+
.then(_verifyTitle(false, false, false, true, true))
449+
.then(function() { return Plotly.restyle(gd, 'titleposition', 'bottom right'); })
450+
.then(_verifyTitle(false, true, false, true, false))
451+
.catch(failTest)
452+
.then(done);
453+
});
454+
431455
it('does not intersect pulled slices', function(done) {
432456
Plotly.newPlot(gd, [{
433457
values: [2, 2, 2, 2],

0 commit comments

Comments
 (0)