Skip to content

Commit 3ccc68b

Browse files
committed
Test contrasting inside text colors for standard pie colors [2951]
- Standard pie colors means no marker colors set explicitly.
1 parent a27d278 commit 3ccc68b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/jasmine/tests/pie_test.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,13 +542,23 @@ describe('Pie traces', function() {
542542
}
543543
};
544544

545-
it('should use inside text colors contrasting to slice colors by default', function(done) {
545+
it('should use inside text colors contrasting to explicitly set slice colors by default', function(done) {
546546
Plotly.plot(gd, [insideTextTestsTrace])
547547
.then(_checkFontColors([DARK, DARK, LIGHT, LIGHT, DARK, LIGHT]))
548548
.catch(failTest)
549549
.then(done);
550550
});
551551

552+
it('should use inside text colors contrasting to standard slice colors by default', function(done) {
553+
var noMarkerTrace = Lib.extendFlat({}, insideTextTestsTrace);
554+
delete noMarkerTrace.marker;
555+
556+
Plotly.plot(gd, [noMarkerTrace])
557+
.then(_checkFontColors([LIGHT, DARK, LIGHT, LIGHT, LIGHT, LIGHT]))
558+
.catch(failTest)
559+
.then(done);
560+
});
561+
552562
it('should use textfont.color for inside text instead of the contrasting default', function(done) {
553563
var data = Lib.extendFlat({}, insideTextTestsTrace, {textfont: {color: 'red'}});
554564
Plotly.plot(gd, [data])

0 commit comments

Comments
 (0)