MCPcopy Index your code
hub / github.com/plotly/plotly.js / assertMenus

Function assertMenus

test/jasmine/tests/updatemenus_test.js:834–854  ·  view source on GitHub ↗
(expectedMenus)

Source from the content-addressed store, hash-verified

832 // call assertMenus([0, 3]); to check that the 2nd update menu is dropped
833 // and showing 3 buttons.
834 function assertMenus(expectedMenus) {
835 assertNodeCount('.' + constants.containerClassName, 1);
836 assertNodeCount('.' + constants.headerClassName, expectedMenus.length);
837
838 var gButton = d3Select('.' + constants.dropdownButtonGroupClassName);
839 var actualActiveIndex = +gButton.attr(constants.menuIndexAttrName);
840 var hasActive = false;
841
842 expectedMenus.forEach(function(expected, i) {
843 if(expected) {
844 expect(actualActiveIndex).toEqual(i);
845 assertNodeCount('.' + constants.dropdownButtonClassName, expected);
846 hasActive = true;
847 }
848 });
849
850 if(!hasActive) {
851 expect(actualActiveIndex).toEqual(-1);
852 assertNodeCount('.' + constants.dropdownButtonClassName, 0);
853 }
854 }
855
856 function assertActive(gd, expectedMenus) {
857 expectedMenus.forEach(function(expected, i) {

Callers 1

Calls 1

assertNodeCountFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…