Skip to content

Commit bdf96b8

Browse files
committed
Add updatemenus test for buttonclicked + skip
1 parent 0065c74 commit bdf96b8

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/jasmine/tests/updatemenus_test.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,33 @@ describe('update menus interactions', function() {
469469
}).catch(fail).then(done);
470470
});
471471

472+
it('should still emit the event if method = skip', function(done) {
473+
var clickCnt = 0;
474+
var data = [];
475+
gd.on('plotly_buttonclicked', function(datum) {
476+
data.push(datum);
477+
clickCnt++;
478+
});
479+
480+
Plotly.relayout(gd, {
481+
'updatemenus[0].buttons[0].method': 'skip',
482+
'updatemenus[0].buttons[1].method': 'skip',
483+
'updatemenus[0].buttons[2].method': 'skip',
484+
'updatemenus[1].buttons[0].method': 'skip',
485+
'updatemenus[1].buttons[1].method': 'skip',
486+
'updatemenus[1].buttons[2].method': 'skip',
487+
'updatemenus[1].buttons[3].method': 'skip',
488+
}).then(function() {
489+
click(selectHeader(0)).then(function() {
490+
expect(clickCnt).toEqual(0);
491+
492+
return click(selectButton(2));
493+
}).then(function() {
494+
expect(clickCnt).toEqual(1);
495+
}).catch(fail).then(done);
496+
});
497+
});
498+
472499
it('should apply update on button click', function(done) {
473500
var header0 = selectHeader(0),
474501
header1 = selectHeader(1);

0 commit comments

Comments
 (0)