Skip to content

Commit 62c95f8

Browse files
committed
test: add jasmine test for #1169
1 parent 218744d commit 62c95f8

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

test/jasmine/tests/updatemenus_test.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,52 @@ describe('update menus interactions', function() {
462462
});
463463
});
464464

465+
it('should update correctly on failed binding comparisons', function(done) {
466+
467+
// See https://github.com/plotly/plotly.js/issues/1169
468+
// for more info.
469+
470+
var data = [{
471+
y: [1, 2, 3],
472+
visible: true
473+
}, {
474+
y: [2, 3, 1],
475+
visible: false
476+
}, {
477+
y: [3, 1, 2],
478+
visible: false
479+
}];
480+
481+
var layout = {
482+
updatemenus: [{
483+
buttons: [{
484+
label: 'a',
485+
method: 'restyle',
486+
args: ['visible', [true, false, false]]
487+
}, {
488+
label: 'b',
489+
method: 'restyle',
490+
args: ['visible', [false, true, false]]
491+
}, {
492+
label: 'c',
493+
method: 'restyle',
494+
args: ['visible', [false, false, true]]
495+
}]
496+
}]
497+
};
498+
499+
Plotly.newPlot(gd, data, layout).then(function() {
500+
return click(selectHeader(0));
501+
})
502+
.then(function() {
503+
return click(selectButton(1));
504+
})
505+
.then(function() {
506+
assertActive(gd, [1]);
507+
})
508+
.then(done);
509+
});
510+
465511
it('should change color on mouse over', function(done) {
466512
var INDEX_0 = 2,
467513
INDEX_1 = gd.layout.updatemenus[1].active;

0 commit comments

Comments
 (0)