Skip to content

Commit 8c2ea1c

Browse files
Added test and draftlog.
1 parent dfc146d commit 8c2ea1c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

draftlogs/6177_fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fix modeBarButtons mutate the input, issue [[#1157](https://github.com/plotly/dash/issues/1157)]

test/jasmine/tests/modebar_test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,15 @@ describe('ModeBar', function() {
996996
expect(countButtons(gd._fullLayout._modeBar))
997997
.toEqual(initialButtonCount + 6);
998998
});
999+
1000+
it('sets up buttons without changing the input', function() {
1001+
var config = [['toImage']];
1002+
var gd = setupGraphInfo();
1003+
gd._context.modeBarButtons = config;
1004+
manageModeBar(gd);
1005+
expect(config).toEqual([['toImage']]);
1006+
expect(countButtons(gd._fullLayout._modeBar)).toEqual(2);
1007+
});
9991008
});
10001009

10011010
describe('modebar on clicks', function() {

0 commit comments

Comments
 (0)