Skip to content
Permalink
Browse files

add test for commit 86204a6 (ternary ax tickfont relayouts)

  • Loading branch information...
etpinard committed Dec 14, 2017
1 parent 17503cb commit 7b0f718d8961794fc395ef249cdb6462c25914b9
Showing with 33 additions and 0 deletions.
  1. +33 −0 test/jasmine/tests/ternary_test.js
@@ -338,6 +338,39 @@ describe('ternary plots', function() {
.then(done);
});

it('should be able to relayout axis tickfont attributes', function(done) {
var gd = createGraphDiv();
var fig = Lib.extendDeep({}, require('@mocks/ternary_simple.json'));

function _assert(family, color, size) {
var tick = d3.select('g.aaxis > g.ytick > text').node();

expect(tick.style['font-family']).toBe(family, 'font family');
expect(parseFloat(tick.style['font-size'])).toBe(size, 'font size');
expect(tick.style.fill).toBe(color, 'font color');
}

Plotly.plot(gd, fig).then(function() {
_assert('"Open Sans", verdana, arial, sans-serif', 'rgb(204, 204, 204)', 12);

return Plotly.relayout(gd, 'ternary.aaxis.tickfont.size', 5);
})
.then(function() {
_assert('"Open Sans", verdana, arial, sans-serif', 'rgb(204, 204, 204)', 5);

return Plotly.relayout(gd, 'ternary.aaxis.tickfont', {
family: 'Roboto',
color: 'red',
size: 20
});
})
.then(function() {
_assert('Roboto', 'rgb(255, 0, 0)', 20);
})
.catch(fail)
.then(done);
});

function countTernarySubplot() {
return d3.selectAll('.ternary').size();
}

0 comments on commit 7b0f718

Please sign in to comment.
You can’t perform that action at this time.