@@ -569,11 +569,8 @@ describe('@flaky Test select box and lasso in general:', function() {
569569 dragmode : 'select'
570570 } )
571571 . then ( function ( ) {
572-
573572 // expect(gd.fullLayout.selectdirection).toBe('any');
574-
575573 resetEvents ( gd ) ;
576-
577574 drag ( selectPath ) ;
578575
579576 selectedPromise . then ( function ( ) {
@@ -582,22 +579,48 @@ describe('@flaky Test select box and lasso in general:', function() {
582579 expect ( selectedData . points [ 0 ] . y ) . toBe ( 3 ) ;
583580 } ) ;
584581
585- // do a drag and check that the selection is correct for the default `selectdirection`
586-
587582 return Plotly . relayout ( gd , { selectdirection : 'h' } ) ;
588583 } )
589584 . 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+ } ) ;
591594
592595 return Plotly . relayout ( gd , { selectdirection : 'v' } ) ;
593596 } )
594597 . 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+ } ) ;
596620 } )
597621 . 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)
598622 . then ( done ) ;
599623
600-
601624 } ) ;
602625
603626} ) ;
0 commit comments