MCPcopy
hub / github.com/plotly/plotly.js / testOrdering

Function testOrdering

test/jasmine/tests/scatter_test.js:793–830  ·  view source on GitHub ↗
(i)

Source from the content-addressed store, hash-verified

791 }
792
793 function testOrdering(i) {
794 return function() {
795 var name = cases[indices[i]].name;
796 var hasFills = name.indexOf('fill') !== -1;
797 var hasLines = name.indexOf('lines') !== -1;
798 var hasMarkers = name.indexOf('markers') !== -1;
799 var tracei, prefix;
800
801 // construct the expected ordering based on case name
802 var selectorArray = [];
803 for(tracei = 0; tracei < 3; tracei++) {
804 prefix = '.xy .trace:nth-child(' + (tracei + 1) + ') ';
805
806 // two fills are attached to the first trace, one to the second
807 if(hasFills) {
808 if(tracei === 0) {
809 selectorArray.push(
810 prefix + 'g:first-child>.js-fill',
811 prefix + 'g:last-child>.js-fill');
812 } else if(tracei === 1) selectorArray.push(prefix + 'g:last-child>.js-fill');
813 }
814 if(hasLines) selectorArray.push(prefix + '.js-line');
815 if(hasMarkers) selectorArray.push(prefix + '.point');
816 }
817
818 // ordering in the legend
819 for(tracei = 0; tracei < 3; tracei++) {
820 prefix = '.legend .traces:nth-child(' + (tracei + 1) + ') ';
821 if(hasFills) selectorArray.push(prefix + '.js-fill');
822 if(hasLines) selectorArray.push(prefix + '.js-line');
823 if(hasMarkers) selectorArray.push(prefix + '.scatterpts');
824 }
825
826 var msg = i ? ('from ' + cases[indices[i - 1]].name + ' to ') : 'from default to ';
827 msg += name;
828 assertMultiNodeOrder(selectorArray, msg);
829 };
830 }
831
832 for(i = 0; i < indices.length; i++) {
833 p = p.then(setMode(i)).then(testOrdering(i));

Callers 1

scatter_test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…