Skip to content

Commit 23564a7

Browse files
committed
Add test for circular sankey with node sort set
1 parent c9592a7 commit 23564a7

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

test/jasmine/tests/sankey_test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,27 @@ describe('sankey tests', function () {
501501
.then(done, done.fail);
502502
});
503503

504+
it('falls back to the default sort for circular Sankey with node.sort set', function (done) {
505+
var errors = [];
506+
spyOn(Lib, 'error').and.callFake(function (msg) {
507+
errors.push(msg);
508+
});
509+
510+
var mockCircularCopy = Lib.extendDeep({}, mockCircular);
511+
mockCircularCopy.data[0].node.sort = 'input';
512+
513+
Plotly.newPlot(gd, mockCircularCopy)
514+
.then(function () {
515+
// The plot renders successfully
516+
expect(gd.calcdata[0][0].circular).toBe(true);
517+
expect(d3SelectAll('.sankey .node-rect').size()).toBeGreaterThan(0);
518+
519+
// An error is logged about the fallback
520+
expect(errors.length).toBe(1);
521+
})
522+
.then(done, done.fail);
523+
});
524+
504525
it('can create groups, restyle groups and properly update DOM', function (done) {
505526
var mockCircularCopy = Lib.extendDeep({}, mockCircular);
506527
var firstGroup = [

0 commit comments

Comments
 (0)