Skip to content
Prev Previous commit
Next Next commit
add jasmine tests for icicle restyling marker.fillet
  • Loading branch information
emilykl committed Oct 24, 2022
commit c61aeccd0c076a58721da1aad7c8ac4ad11dc4a8
33 changes: 33 additions & 0 deletions test/jasmine/tests/icicle_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,39 @@ describe('Test icicle restyle:', function() {
.then(_assert('back to dflt', ['', '0.7', '', '0.7']))
.then(done, done.fail);
});

it('should be able to restyle *marker.fillet*', function(done) {
var mock = {
data: [{
type: 'icicle',
labels: ['Root', 'A', 'B', 'b'],
parents: ['', 'Root', 'Root', 'B']
}]
};

function _assert(msg, exp) {
return function() {
var layer = d3Select(gd).select('.iciclelayer');
layer.selectAll('.surface').each(function() {
var surfaces = d3Select(this);
var path = surfaces[0][0].getAttribute('d');
expect(path.indexOf('a') !== -1).toEqual(exp);
});
};
}

Plotly.newPlot(gd, mock)
.then(_assert('no arcs', false))
.then(function() {
return Plotly.restyle(gd, 'marker.fillet', 10);
})
.then(_assert('has arcs', true))
.then(function() {
return Plotly.restyle(gd, 'marker.fillet', 0);
})
.then(_assert('no arcs', false))
.then(done, done.fail);
});
});

describe('Test icicle texttemplate without `values` should work at root level:', function() {
Expand Down