@@ -569,11 +569,8 @@ describe('@flaky Test select box and lasso in general:', function() {
569
569
dragmode : 'select'
570
570
} )
571
571
. then ( function ( ) {
572
-
573
572
// expect(gd.fullLayout.selectdirection).toBe('any');
574
-
575
573
resetEvents ( gd ) ;
576
-
577
574
drag ( selectPath ) ;
578
575
579
576
selectedPromise . then ( function ( ) {
@@ -582,22 +579,48 @@ describe('@flaky Test select box and lasso in general:', function() {
582
579
expect ( selectedData . points [ 0 ] . y ) . toBe ( 3 ) ;
583
580
} ) ;
584
581
585
- // do a drag and check that the selection is correct for the default `selectdirection`
586
-
587
582
return Plotly . relayout ( gd , { selectdirection : 'h' } ) ;
588
583
} )
589
584
. then ( function ( ) {
590
- // do probably the SAME drag and check that the selection is correct for the `selectdirection='h'`
585
+ resetEvents ( gd ) ;
586
+ drag ( selectPath ) ;
587
+
588
+ selectedPromise . then ( function ( )
589
+ {
590
+ expect ( selectedData . points . length ) . toBe ( 2 ) ;
591
+ expect ( selectedData . points [ 0 ] . x ) . toBe ( 1.8 ) ;
592
+ expect ( selectedData . points [ 1 ] . x ) . toBe ( 2.2 ) ;
593
+ } ) ;
591
594
592
595
return Plotly . relayout ( gd , { selectdirection : 'v' } ) ;
593
596
} )
594
597
. then ( function ( ) {
595
- // ...
598
+ resetEvents ( gd ) ;
599
+ drag ( selectPath ) ;
600
+
601
+ selectedPromise . then ( function ( )
602
+ {
603
+ expect ( selectedData . points . length ) . toBe ( 2 ) ;
604
+ expect ( selectedData . points [ 0 ] . x ) . toBe ( 1.8 ) ;
605
+ expect ( selectedData . points [ 1 ] . x ) . toBe ( 2.8000000000000003 ) ;
606
+ } ) ;
607
+
608
+ return Plotly . relayout ( gd , { selectdirection : 'd' } ) ;
609
+ } )
610
+ . then ( function ( ) {
611
+ resetEvents ( gd ) ;
612
+ drag ( selectPath ) ;
613
+
614
+ selectedPromise . then ( function ( )
615
+ {
616
+ expect ( selectedData . points . length ) . toBe ( 2 ) ;
617
+ expect ( selectedData . points [ 0 ] . x ) . toBe ( 1.8 ) ;
618
+ expect ( selectedData . points [ 1 ] . x ) . toBe ( 2.2 ) ;
619
+ } ) ;
596
620
} )
597
621
. catch ( fail ) // hmm, we should change the name of this import to failTest, since fail is already a jasmine global, for sync failure, we're overriding it here with our async version (we've already done this in other places)
598
622
. then ( done ) ;
599
623
600
-
601
624
} ) ;
602
625
603
626
} ) ;
0 commit comments