Skip to content

Commit 96fcdd7

Browse files
committed
Minor change: move helper method in select_test.s [1852]
1 parent 2bc582b commit 96fcdd7

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

test/jasmine/tests/select_test.js

+24-25
Original file line numberDiff line numberDiff line change
@@ -614,31 +614,6 @@ describe('Click-to-select', function() {
614614
});
615615

616616
describe('is supported by', function() {
617-
618-
function _run(testCase, doneFn) {
619-
Plotly.plot(gd, testCase.mock.data, testCase.mock.layout, testCase.mock.config)
620-
.then(function() {
621-
return _immediateClickPt(testCase);
622-
})
623-
.then(function() {
624-
assertSelectedPoints(testCase.expectedPts);
625-
return Plotly.relayout(gd, 'dragmode', 'lasso');
626-
})
627-
.then(function() {
628-
_clickPt(testCase);
629-
return deselectPromise;
630-
})
631-
.then(function() {
632-
assertSelectionCleared();
633-
return _clickPt(testCase);
634-
})
635-
.then(function() {
636-
assertSelectedPoints(testCase.expectedPts);
637-
})
638-
.catch(failTest)
639-
.then(doneFn);
640-
}
641-
642617
// On loading mocks:
643618
// - Note, that `require` function calls are resolved at compile time
644619
// and thus dynamically concatenated mock paths won't work.
@@ -696,6 +671,30 @@ describe('Click-to-select', function() {
696671
_run(testCase, done);
697672
});
698673
});
674+
675+
function _run(testCase, doneFn) {
676+
Plotly.plot(gd, testCase.mock.data, testCase.mock.layout, testCase.mock.config)
677+
.then(function() {
678+
return _immediateClickPt(testCase);
679+
})
680+
.then(function() {
681+
assertSelectedPoints(testCase.expectedPts);
682+
return Plotly.relayout(gd, 'dragmode', 'lasso');
683+
})
684+
.then(function() {
685+
_clickPt(testCase);
686+
return deselectPromise;
687+
})
688+
.then(function() {
689+
assertSelectionCleared();
690+
return _clickPt(testCase);
691+
})
692+
.then(function() {
693+
assertSelectedPoints(testCase.expectedPts);
694+
})
695+
.catch(failTest)
696+
.then(doneFn);
697+
}
699698
});
700699

701700
describe('triggers \'plotly_selected\' before \'plotly_click\'', function() {

0 commit comments

Comments
 (0)