@@ -615,11 +615,37 @@ describe('Click-to-select', function() {
615
615
616
616
describe ( 'is supported by' , function ( ) {
617
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
+
618
642
// On loading mocks:
619
643
// - Note, that `require` function calls are resolved at compile time
620
644
// and thus dynamically concatenated mock paths won't work.
621
645
// - Some mocks don't specify a width and height, so this needs
622
646
// to be set explicitly to ensure click coordinates fit.
647
+
648
+ // The non-gl traces: use @flaky CI annotation
623
649
[
624
650
testCase ( 'histrogram' , require ( '@mocks/histogram_colorscale.json' ) , 355 , 301 , [ 3 , 4 , 5 ] ) ,
625
651
testCase ( 'box' , require ( '@mocks/box_grouped_horz.json' ) , 610 , 342 , [ [ 2 ] , [ ] , [ ] ] ,
@@ -643,34 +669,22 @@ describe('Click-to-select', function() {
643
669
// so set dragmode to zoom
644
670
testCase ( 'scatterpolar' , require ( '@mocks/polar_scatter.json' ) , 130 , 290 ,
645
671
[ [ ] , [ ] , [ ] , [ 19 ] , [ ] , [ ] ] , { dragmode : 'zoom' } ) ,
672
+ ]
673
+ . forEach ( function ( testCase ) {
674
+ it ( '@flaky trace type ' + testCase . label , function ( done ) {
675
+ _run ( testCase , done ) ;
676
+ } ) ;
677
+ } ) ;
678
+
679
+ // The gl traces: use @gl CI annotation
680
+ [
646
681
testCase ( 'scatterpolargl' , require ( '@mocks/glpolar_scatter.json' ) , 130 , 290 ,
647
- [ [ ] , [ ] , [ ] , [ 19 ] , [ ] , [ ] ] , { dragmode : 'zoom' } ) . enableGl ( ) ,
648
- testCase ( 'splom' , require ( '@mocks/splom_lower.json' ) , 427 , 400 , [ [ ] , [ 7 ] , [ ] ] ) . enableGl ( )
682
+ [ [ ] , [ ] , [ ] , [ 19 ] , [ ] , [ ] ] , { dragmode : 'zoom' } ) ,
683
+ testCase ( 'splom' , require ( '@mocks/splom_lower.json' ) , 427 , 400 , [ [ ] , [ 7 ] , [ ] ] )
649
684
]
650
685
. forEach ( function ( testCase ) {
651
- var ciAnnotation = testCase . gl ? 'gl' : 'flaky' ;
652
- it ( '@' + ciAnnotation + ' trace type ' + testCase . label , function ( done ) {
653
- Plotly . plot ( gd , testCase . mock . data , testCase . mock . layout , testCase . mock . config )
654
- . then ( function ( ) {
655
- return _immediateClickPt ( testCase ) ;
656
- } )
657
- . then ( function ( ) {
658
- assertSelectedPoints ( testCase . expectedPts ) ;
659
- return Plotly . relayout ( gd , 'dragmode' , 'lasso' ) ;
660
- } )
661
- . then ( function ( ) {
662
- _clickPt ( testCase ) ;
663
- return deselectPromise ;
664
- } )
665
- . then ( function ( ) {
666
- assertSelectionCleared ( ) ;
667
- return _clickPt ( testCase ) ;
668
- } )
669
- . then ( function ( ) {
670
- assertSelectedPoints ( testCase . expectedPts ) ;
671
- } )
672
- . catch ( failTest )
673
- . then ( done ) ;
686
+ it ( '@gl trace type ' + testCase . label , function ( done ) {
687
+ _run ( testCase , done ) ;
674
688
} ) ;
675
689
} ) ;
676
690
} ) ;
@@ -737,12 +751,7 @@ describe('Click-to-select', function() {
737
751
x : x ,
738
752
y : y ,
739
753
expectedPts : expectedPts ,
740
- configOptions : configOptions ,
741
- gl : false ,
742
- enableGl : function ( ) {
743
- this . gl = true ;
744
- return this ;
745
- }
754
+ configOptions : configOptions
746
755
} ;
747
756
}
748
757
} ) ;
0 commit comments