@@ -655,8 +655,6 @@ describe('Click-to-select', function() {
655
655
testCase ( 'ohlc' , require ( '@mocks/ohlc_first.json' ) , 669 , 165 , [ 9 ] ) ,
656
656
testCase ( 'candlestick' , require ( '@mocks/finance_style.json' ) , 331 , 162 , [ [ ] , [ 5 ] ] ) ,
657
657
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 } ) ,
660
658
testCase ( 'scattergeo' , require ( '@mocks/geo_scattergeo-locations.json' ) , 285 , 240 , [ 1 ] ) ,
661
659
testCase ( 'scatterternary' , require ( '@mocks/ternary_markers.json' ) , 485 , 335 , [ 7 ] ) ,
662
660
@@ -687,40 +685,63 @@ describe('Click-to-select', function() {
687
685
_run ( testCase , done ) ;
688
686
} ) ;
689
687
} ) ;
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
+ } ) ;
690
699
} ) ;
691
700
692
701
describe ( 'triggers \'plotly_selected\' before \'plotly_click\'' , function ( ) {
693
702
[
694
703
testCase ( 'cartesian' , require ( '@mocks/14.json' ) , 270 , 160 , [ 7 ] ) ,
695
704
testCase ( 'geo' , require ( '@mocks/geo_scattergeo-locations.json' ) , 285 , 240 , [ 1 ] ) ,
696
705
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 } ) ,
699
706
testCase ( 'polar' , require ( '@mocks/polar_scatter.json' ) , 130 , 290 ,
700
707
[ [ ] , [ ] , [ ] , [ 19 ] , [ ] , [ ] ] , { dragmode : 'zoom' } )
701
708
] . forEach ( function ( testCase ) {
702
709
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 ) ;
722
711
} ) ;
723
712
} ) ;
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
+ }
724
745
} ) ;
725
746
726
747
function testCase ( label , mock , x , y , expectedPts , layoutOptions , configOptions ) {
0 commit comments