Skip to content

Commit e01d09a

Browse files
committed
add jasmine test to lock issue 5213 - adjust pie test
1 parent 0594ed4 commit e01d09a

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

test/jasmine/tests/pie_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ describe('Pie traces', function() {
10071007
textposition: [['outside', 'outside', 'inside', 'inside', 'outside']],
10081008
'outsidetextfont.size': 12
10091009
}, {
1010-
t: '~=', l: 'shrunk',
1010+
t: '~=', l: '~=',
10111011
b: 'grew', r: 'grew'
10121012
}))
10131013
.then(check('automargin:false', {automargin: false}, {

test/jasmine/tests/toimage_test.js

+32
Original file line numberDiff line numberDiff line change
@@ -318,5 +318,37 @@ describe('Plotly.toImage', function() {
318318
.catch(failTest)
319319
.then(done);
320320
});
321+
322+
it('record and export computed margins with "Too many auto-margin redraws"', function(done) {
323+
Plotly.toImage({
324+
data: [{
325+
x: [
326+
'a',
327+
'b',
328+
'looooooooooooooooooooooooooooooooooog',
329+
'd'
330+
]
331+
}],
332+
layout: {
333+
width: 400,
334+
height: 400,
335+
paper_bgcolor: 'lightblue',
336+
xaxis: {
337+
automargin: true
338+
},
339+
yaxis: {
340+
automargin: true
341+
}
342+
}
343+
}, imgOpts)
344+
.then(function(fig) {
345+
fig = JSON.parse(fig);
346+
var computed = fig.layout.computed;
347+
expect(computed.margin.b).toBeGreaterThan(80);
348+
expect(computed.margin.r).toBeGreaterThan(80);
349+
})
350+
.catch(failTest)
351+
.then(done);
352+
});
321353
});
322354
});

0 commit comments

Comments
 (0)