Skip to content

Commit 7a8dae8

Browse files
committed
test(sankey): use a short sink column for the non-clamped case
1 parent b2fa0c4 commit 7a8dae8

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
@@ -148,13 +148,19 @@ describe('sankey tests', function() {
148148

149149
it('does not warn when the figure fits node.pad', function(done) {
150150
var warnings = [];
151-
spyOn(Lib, 'warn').and.callFake(function(msg) {
152-
warnings.push(msg);
151+
spyOn(Lib, 'warn').and.callFake(function() {
152+
// collect all arguments, as Lib.warn is variadic
153+
warnings.push(Array.prototype.slice.call(arguments));
153154
});
154155

155156
var fig = Lib.extendDeep({}, padMock);
156157
fig.layout.width = 480;
157158
fig.layout.height = 1000;
159+
// keep the sink column short enough that pad=30 always fits
160+
fig.data[0].node.label = Array.from({length: 8}, function(_, i) { return 'n' + i; });
161+
fig.data[0].link.source = Array.from({length: 7}, function() { return 0; });
162+
fig.data[0].link.target = Array.from({length: 7}, function(_, i) { return i + 1; });
163+
fig.data[0].link.value = Array.from({length: 7}, function() { return 1; });
158164
var gd = createGraphDiv();
159165
Plotly.newPlot(gd, fig)
160166
.then(function() {

0 commit comments

Comments
 (0)