Skip to content

Commit 2bc582b

Browse files
committed
Apply @noci tag to mapbox tests in select_test.js [1852]
1 parent 90ba209 commit 2bc582b

File tree

2 files changed

+44
-24
lines changed

2 files changed

+44
-24
lines changed

src/plots/mapbox/mapbox.js

-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ proto.updateFx = function(fullLayout) {
424424
map.dragPan.disable();
425425
map.on('zoomstart', self.clearSelect);
426426

427-
428427
self.dragOptions.prepFn = function(e, startX, startY) {
429428
prepSelect(e, startX, startY, self.dragOptions, dragMode);
430429
};

test/jasmine/tests/select_test.js

+44-23
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,6 @@ describe('Click-to-select', function() {
655655
testCase('ohlc', require('@mocks/ohlc_first.json'), 669, 165, [9]),
656656
testCase('candlestick', require('@mocks/finance_style.json'), 331, 162, [[], [5]]),
657657
testCase('choropleth', require('@mocks/geo_choropleth-text.json'), 440, 163, [6]),
658-
testCase('scattermapbox', require('@mocks/mapbox_0.json'), 650, 195, [[2], []], {},
659-
{ mapboxAccessToken: require('@build/credentials.json').MAPBOX_ACCESS_TOKEN }),
660658
testCase('scattergeo', require('@mocks/geo_scattergeo-locations.json'), 285, 240, [1]),
661659
testCase('scatterternary', require('@mocks/ternary_markers.json'), 485, 335, [7]),
662660

@@ -687,40 +685,63 @@ describe('Click-to-select', function() {
687685
_run(testCase, done);
688686
});
689687
});
688+
689+
// The mapbox traces: use @noCI annotation cause they are usually too resource-intensive
690+
[
691+
testCase('scattermapbox', require('@mocks/mapbox_0.json'), 650, 195, [[2], []], {},
692+
{ mapboxAccessToken: require('@build/credentials.json').MAPBOX_ACCESS_TOKEN })
693+
]
694+
.forEach(function(testCase) {
695+
it('@noCI trace type ' + testCase.label, function(done) {
696+
_run(testCase, done);
697+
});
698+
});
690699
});
691700

692701
describe('triggers \'plotly_selected\' before \'plotly_click\'', function() {
693702
[
694703
testCase('cartesian', require('@mocks/14.json'), 270, 160, [7]),
695704
testCase('geo', require('@mocks/geo_scattergeo-locations.json'), 285, 240, [1]),
696705
testCase('ternary', require('@mocks/ternary_markers.json'), 485, 335, [7]),
697-
testCase('mapbox', require('@mocks/mapbox_0.json'), 650, 195, [[2], []], {},
698-
{ mapboxAccessToken: require('@build/credentials.json').MAPBOX_ACCESS_TOKEN }),
699706
testCase('polar', require('@mocks/polar_scatter.json'), 130, 290,
700707
[[], [], [], [19], [], []], { dragmode: 'zoom' })
701708
].forEach(function(testCase) {
702709
it('@flaky for base plot ' + testCase.label, function(done) {
703-
Plotly.plot(gd, testCase.mock.data, testCase.mock.layout, testCase.mock.config)
704-
.then(function() {
705-
var clickHandlerCalled = false;
706-
var selectedHandlerCalled = false;
707-
708-
gd.on('plotly_selected', function() {
709-
expect(clickHandlerCalled).toBe(false);
710-
selectedHandlerCalled = true;
711-
});
712-
gd.on('plotly_click', function() {
713-
clickHandlerCalled = true;
714-
expect(selectedHandlerCalled).toBe(true);
715-
done();
716-
});
717-
718-
return click(testCase.x, testCase.y);
719-
})
720-
.catch(failTest)
721-
.then(done);
710+
_run(testCase, done);
722711
});
723712
});
713+
714+
// The mapbox traces: use @noCI annotation cause they are usually too resource-intensive
715+
[
716+
testCase('mapbox', require('@mocks/mapbox_0.json'), 650, 195, [[2], []], {},
717+
{ mapboxAccessToken: require('@build/credentials.json').MAPBOX_ACCESS_TOKEN })
718+
].forEach(function(testCase) {
719+
it('@noCI for base plot ' + testCase.label, function(done) {
720+
_run(testCase, done);
721+
});
722+
});
723+
724+
function _run(testCase, doneFn) {
725+
Plotly.plot(gd, testCase.mock.data, testCase.mock.layout, testCase.mock.config)
726+
.then(function() {
727+
var clickHandlerCalled = false;
728+
var selectedHandlerCalled = false;
729+
730+
gd.on('plotly_selected', function() {
731+
expect(clickHandlerCalled).toBe(false);
732+
selectedHandlerCalled = true;
733+
});
734+
gd.on('plotly_click', function() {
735+
clickHandlerCalled = true;
736+
expect(selectedHandlerCalled).toBe(true);
737+
doneFn();
738+
});
739+
740+
return click(testCase.x, testCase.y);
741+
})
742+
.catch(failTest)
743+
.then(doneFn);
744+
}
724745
});
725746

726747
function testCase(label, mock, x, y, expectedPts, layoutOptions, configOptions) {

0 commit comments

Comments
 (0)