Skip to content

Commit 324446d

Browse files
committed
add mode bar manger test for ternary plots
1 parent e3c0dd8 commit 324446d

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

test/jasmine/tests/modebar_test.js

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,75 @@ describe('ModeBar', function() {
373373
checkButtons(modeBar, buttons, 1);
374374
});
375375

376+
it('creates mode bar (un-selectable ternary version)', function() {
377+
var buttons = getButtons([
378+
['toImage', 'sendDataToCloud'],
379+
['zoom2d', 'pan2d']
380+
]);
381+
382+
var gd = getMockGraphInfo();
383+
gd._fullLayout._hasTernary = true;
384+
385+
manageModeBar(gd);
386+
var modeBar = gd._fullLayout._modeBar;
387+
388+
checkButtons(modeBar, buttons, 1);
389+
});
390+
391+
it('creates mode bar (selectable ternary version)', function() {
392+
var buttons = getButtons([
393+
['toImage', 'sendDataToCloud'],
394+
['zoom2d', 'pan2d', 'select2d', 'lasso2d']
395+
]);
396+
397+
var gd = getMockGraphInfo();
398+
gd._fullLayout._hasTernary = true;
399+
gd._fullData = [{
400+
type: 'scatterternary',
401+
visible: true,
402+
mode: 'markers',
403+
_module: {selectPoints: true}
404+
}];
405+
406+
manageModeBar(gd);
407+
var modeBar = gd._fullLayout._modeBar;
408+
409+
checkButtons(modeBar, buttons, 1);
410+
});
411+
412+
it('creates mode bar (ternary + cartesian version)', function() {
413+
var buttons = getButtons([
414+
['toImage', 'sendDataToCloud'],
415+
['zoom2d', 'pan2d'],
416+
['hoverClosestCartesian', 'hoverCompareCartesian']
417+
]);
418+
419+
var gd = getMockGraphInfo();
420+
gd._fullLayout._hasTernary = true;
421+
gd._fullLayout._hasCartesian = true;
422+
423+
manageModeBar(gd);
424+
var modeBar = gd._fullLayout._modeBar;
425+
426+
checkButtons(modeBar, buttons, 1);
427+
});
428+
429+
it('creates mode bar (ternary + gl3d version)', function() {
430+
var buttons = getButtons([
431+
['toImage', 'sendDataToCloud'],
432+
['resetViews', 'toggleHover']
433+
]);
434+
435+
var gd = getMockGraphInfo();
436+
gd._fullLayout._hasTernary = true;
437+
gd._fullLayout._hasGL3D = true;
438+
439+
manageModeBar(gd);
440+
var modeBar = gd._fullLayout._modeBar;
441+
442+
checkButtons(modeBar, buttons, 1);
443+
});
444+
376445
it('throws an error if modeBarButtonsToRemove isn\'t an array', function() {
377446
var gd = getMockGraphInfo();
378447
gd._context.modeBarButtonsToRemove = 'not gonna work';

0 commit comments

Comments
 (0)