@@ -650,9 +650,9 @@ describe('legend interaction', function() {
650
650
done ( ) ;
651
651
} ) ;
652
652
} ) ;
653
- afterAll ( function ( ) {
654
- destroyGraphDiv ( ) ;
655
- } ) ;
653
+
654
+ afterAll ( destroyGraphDiv ) ;
655
+
656
656
describe ( 'single click' , function ( ) {
657
657
it ( 'should hide slice' , function ( done ) {
658
658
legendItem . dispatchEvent ( new MouseEvent ( 'mousedown' ) ) ;
@@ -663,9 +663,11 @@ describe('legend interaction', function() {
663
663
done ( ) ;
664
664
} , DBLCLICKDELAY + 20 ) ;
665
665
} ) ;
666
+
666
667
it ( 'should fade legend item' , function ( ) {
667
668
expect ( + legendItem . parentNode . style . opacity ) . toBeLessThan ( 1 ) ;
668
669
} ) ;
670
+
669
671
it ( 'should unhide slice' , function ( done ) {
670
672
legendItem . dispatchEvent ( new MouseEvent ( 'mousedown' ) ) ;
671
673
legendItem . dispatchEvent ( new MouseEvent ( 'mouseup' ) ) ;
@@ -674,6 +676,7 @@ describe('legend interaction', function() {
674
676
done ( ) ;
675
677
} , DBLCLICKDELAY + 20 ) ;
676
678
} ) ;
679
+
677
680
it ( 'should unfade legend item' , function ( ) {
678
681
expect ( + legendItem . parentNode . style . opacity ) . toBe ( 1 ) ;
679
682
} ) ;
@@ -691,6 +694,7 @@ describe('legend interaction', function() {
691
694
done ( ) ;
692
695
} , 20 ) ;
693
696
} ) ;
697
+
694
698
it ( 'should fade other legend items' , function ( ) {
695
699
var legendItemi ;
696
700
for ( var i = 0 ; i < legendItems . length ; i ++ ) {
@@ -702,6 +706,7 @@ describe('legend interaction', function() {
702
706
}
703
707
}
704
708
} ) ;
709
+
705
710
it ( 'should unhide all slices' , function ( done ) {
706
711
legendItem . dispatchEvent ( new MouseEvent ( 'mousedown' ) ) ;
707
712
legendItem . dispatchEvent ( new MouseEvent ( 'mouseup' ) ) ;
@@ -712,6 +717,7 @@ describe('legend interaction', function() {
712
717
done ( ) ;
713
718
} , 20 ) ;
714
719
} ) ;
720
+
715
721
it ( 'should unfade legend items' , function ( ) {
716
722
var legendItemi ;
717
723
for ( var i = 0 ; i < legendItems . length ; i ++ ) {
@@ -721,6 +727,7 @@ describe('legend interaction', function() {
721
727
} ) ;
722
728
} ) ;
723
729
} ) ;
730
+
724
731
describe ( 'non-pie chart' , function ( ) {
725
732
var mockCopy , gd , legendItems , legendItem ;
726
733
var testEntry = 2 ;
@@ -736,9 +743,8 @@ describe('legend interaction', function() {
736
743
done ( ) ;
737
744
} ) ;
738
745
} ) ;
739
- afterAll ( function ( ) {
740
- destroyGraphDiv ( ) ;
741
- } ) ;
746
+
747
+ afterAll ( destroyGraphDiv ) ;
742
748
743
749
describe ( 'single click' , function ( ) {
744
750
it ( 'should hide series' , function ( done ) {
@@ -749,9 +755,11 @@ describe('legend interaction', function() {
749
755
done ( ) ;
750
756
} , DBLCLICKDELAY + 20 ) ;
751
757
} ) ;
758
+
752
759
it ( 'should fade legend item' , function ( ) {
753
760
expect ( + legendItem . parentNode . style . opacity ) . toBeLessThan ( 1 ) ;
754
761
} ) ;
762
+
755
763
it ( 'should unhide series' , function ( done ) {
756
764
legendItem . dispatchEvent ( new MouseEvent ( 'mousedown' ) ) ;
757
765
legendItem . dispatchEvent ( new MouseEvent ( 'mouseup' ) ) ;
@@ -760,10 +768,12 @@ describe('legend interaction', function() {
760
768
done ( ) ;
761
769
} , DBLCLICKDELAY + 20 ) ;
762
770
} ) ;
771
+
763
772
it ( 'should unfade legend item' , function ( ) {
764
773
expect ( + legendItem . parentNode . style . opacity ) . toBe ( 1 ) ;
765
774
} ) ;
766
775
} ) ;
776
+
767
777
describe ( 'double click' , function ( ) {
768
778
it ( 'should hide series' , function ( done ) {
769
779
legendItem . dispatchEvent ( new MouseEvent ( 'mousedown' ) ) ;
@@ -781,6 +791,7 @@ describe('legend interaction', function() {
781
791
done ( ) ;
782
792
} , 20 ) ;
783
793
} ) ;
794
+
784
795
it ( 'should fade legend item' , function ( ) {
785
796
var legendItemi ;
786
797
for ( var i = 0 ; i < legendItems . length ; i ++ ) {
@@ -792,6 +803,7 @@ describe('legend interaction', function() {
792
803
}
793
804
}
794
805
} ) ;
806
+
795
807
it ( 'should unhide series' , function ( done ) {
796
808
legendItem . dispatchEvent ( new MouseEvent ( 'mousedown' ) ) ;
797
809
legendItem . dispatchEvent ( new MouseEvent ( 'mouseup' ) ) ;
@@ -804,6 +816,7 @@ describe('legend interaction', function() {
804
816
done ( ) ;
805
817
} , 20 ) ;
806
818
} ) ;
819
+
807
820
it ( 'should unfade legend items' , function ( ) {
808
821
var legendItemi ;
809
822
for ( var i = 0 ; i < legendItems . length ; i ++ ) {
0 commit comments