Skip to content

Commit 43b5579

Browse files
committed
test(sankey): use a short sink column for the non-clamped case
1 parent 31eb47d commit 43b5579

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

test/jasmine/tests/sankey_test.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,19 @@ describe('sankey tests', function () {
153153

154154
it('does not warn when the figure fits node.pad', function(done) {
155155
var warnings = [];
156-
spyOn(Lib, 'warn').and.callFake(function(msg) {
157-
warnings.push(msg);
156+
spyOn(Lib, 'warn').and.callFake(function() {
157+
// collect all arguments, as Lib.warn is variadic
158+
warnings.push(Array.prototype.slice.call(arguments));
158159
});
159160

160161
var fig = Lib.extendDeep({}, padMock);
161162
fig.layout.width = 480;
162163
fig.layout.height = 1000;
164+
// keep the sink column short enough that pad=30 always fits
165+
fig.data[0].node.label = Array.from({length: 8}, function(_, i) { return 'n' + i; });
166+
fig.data[0].link.source = Array.from({length: 7}, function() { return 0; });
167+
fig.data[0].link.target = Array.from({length: 7}, function(_, i) { return i + 1; });
168+
fig.data[0].link.value = Array.from({length: 7}, function() { return 1; });
163169
var gd = createGraphDiv();
164170
Plotly.newPlot(gd, fig)
165171
.then(function() {

0 commit comments

Comments
 (0)