@@ -2666,6 +2666,47 @@ describe('Test select box and lasso per trace:', function() {
2666
2666
. catch ( failTest )
2667
2667
. then ( done ) ;
2668
2668
} ) ;
2669
+
2670
+ it ( '@flaky should work on sankey traces' , function ( done ) {
2671
+ var fig = Lib . extendDeep ( { } , require ( '@mocks/sankey_circular.json' ) ) ;
2672
+ fig . layout . dragmode = 'select' ;
2673
+ var dblClickPos = [ 250 , 400 ] ;
2674
+ var opts = { } ;
2675
+
2676
+ Plotly . plot ( gd , fig )
2677
+ . then ( function ( ) {
2678
+ // No groups initially
2679
+ expect ( gd . _fullData [ 0 ] . node . groups ) . toEqual ( [ ] ) ;
2680
+
2681
+ opts . element = document . elementFromPoint ( 400 , 400 ) ;
2682
+ } )
2683
+ . then ( function ( ) {
2684
+ // Grouping the two nodes on the top right
2685
+ return _run (
2686
+ [ [ 640 , 130 ] , [ 400 , 450 ] ] ,
2687
+ function ( ) {
2688
+ expect ( gd . _fullData [ 0 ] . node . groups ) . toEqual ( [ [ 2 , 3 ] ] ) ;
2689
+ } ,
2690
+ dblClickPos , BOXEVENTS , 'for top right nodes #2 and #3'
2691
+ ) ;
2692
+ } )
2693
+ . then ( function ( ) {
2694
+ // Grouping node #4 and the previous group
2695
+ drag ( [ [ 715 , 400 ] , [ 300 , 110 ] ] , opts ) ;
2696
+ } )
2697
+ . then ( function ( ) {
2698
+ expect ( gd . _fullData [ 0 ] . node . groups ) . toEqual ( [ [ 4 , 3 , 2 ] ] ) ;
2699
+ } )
2700
+ . then ( function ( ) {
2701
+ // Grouping node #0 and #1 on the left side
2702
+ drag ( [ [ 160 , 110 ] , [ 200 , 590 ] ] , opts ) ;
2703
+ } )
2704
+ . then ( function ( ) {
2705
+ expect ( gd . _fullData [ 0 ] . node . groups ) . toEqual ( [ [ 4 , 3 , 2 ] , [ 0 , 1 ] ] ) ;
2706
+ } )
2707
+ . catch ( failTest )
2708
+ . then ( done ) ;
2709
+ } ) ;
2669
2710
} ) ;
2670
2711
2671
2712
describe ( 'Test that selections persist:' , function ( ) {
0 commit comments