Skip to content

Commit

Permalink
Add updatemenus test for buttonclicked + skip
Browse files Browse the repository at this point in the history
  • Loading branch information
rreusser committed May 18, 2017
1 parent 0065c74 commit bdf96b8
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/jasmine/tests/updatemenus_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,33 @@ describe('update menus interactions', function() {
}).catch(fail).then(done);
});

it('should still emit the event if method = skip', function(done) {
var clickCnt = 0;
var data = [];
gd.on('plotly_buttonclicked', function(datum) {
data.push(datum);
clickCnt++;
});

Plotly.relayout(gd, {
'updatemenus[0].buttons[0].method': 'skip',
'updatemenus[0].buttons[1].method': 'skip',
'updatemenus[0].buttons[2].method': 'skip',
'updatemenus[1].buttons[0].method': 'skip',
'updatemenus[1].buttons[1].method': 'skip',
'updatemenus[1].buttons[2].method': 'skip',
'updatemenus[1].buttons[3].method': 'skip',
}).then(function() {
click(selectHeader(0)).then(function() {
expect(clickCnt).toEqual(0);

return click(selectButton(2));
}).then(function() {
expect(clickCnt).toEqual(1);
}).catch(fail).then(done);
});
});

it('should apply update on button click', function(done) {
var header0 = selectHeader(0),
header1 = selectHeader(1);
Expand Down

0 comments on commit bdf96b8

Please sign in to comment.