@@ -650,9 +650,9 @@ describe('legend interaction', function() {
650650 done ( ) ;
651651 } ) ;
652652 } ) ;
653- afterAll ( function ( ) {
654- destroyGraphDiv ( ) ;
655- } ) ;
653+
654+ afterAll ( destroyGraphDiv ) ;
655+
656656 describe ( 'single click' , function ( ) {
657657 it ( 'should hide slice' , function ( done ) {
658658 legendItem . dispatchEvent ( new MouseEvent ( 'mousedown' ) ) ;
@@ -663,9 +663,11 @@ describe('legend interaction', function() {
663663 done ( ) ;
664664 } , DBLCLICKDELAY + 20 ) ;
665665 } ) ;
666+
666667 it ( 'should fade legend item' , function ( ) {
667668 expect ( + legendItem . parentNode . style . opacity ) . toBeLessThan ( 1 ) ;
668669 } ) ;
670+
669671 it ( 'should unhide slice' , function ( done ) {
670672 legendItem . dispatchEvent ( new MouseEvent ( 'mousedown' ) ) ;
671673 legendItem . dispatchEvent ( new MouseEvent ( 'mouseup' ) ) ;
@@ -674,6 +676,7 @@ describe('legend interaction', function() {
674676 done ( ) ;
675677 } , DBLCLICKDELAY + 20 ) ;
676678 } ) ;
679+
677680 it ( 'should unfade legend item' , function ( ) {
678681 expect ( + legendItem . parentNode . style . opacity ) . toBe ( 1 ) ;
679682 } ) ;
@@ -691,6 +694,7 @@ describe('legend interaction', function() {
691694 done ( ) ;
692695 } , 20 ) ;
693696 } ) ;
697+
694698 it ( 'should fade other legend items' , function ( ) {
695699 var legendItemi ;
696700 for ( var i = 0 ; i < legendItems . length ; i ++ ) {
@@ -702,6 +706,7 @@ describe('legend interaction', function() {
702706 }
703707 }
704708 } ) ;
709+
705710 it ( 'should unhide all slices' , function ( done ) {
706711 legendItem . dispatchEvent ( new MouseEvent ( 'mousedown' ) ) ;
707712 legendItem . dispatchEvent ( new MouseEvent ( 'mouseup' ) ) ;
@@ -712,6 +717,7 @@ describe('legend interaction', function() {
712717 done ( ) ;
713718 } , 20 ) ;
714719 } ) ;
720+
715721 it ( 'should unfade legend items' , function ( ) {
716722 var legendItemi ;
717723 for ( var i = 0 ; i < legendItems . length ; i ++ ) {
@@ -721,6 +727,7 @@ describe('legend interaction', function() {
721727 } ) ;
722728 } ) ;
723729 } ) ;
730+
724731 describe ( 'non-pie chart' , function ( ) {
725732 var mockCopy , gd , legendItems , legendItem ;
726733 var testEntry = 2 ;
@@ -736,9 +743,8 @@ describe('legend interaction', function() {
736743 done ( ) ;
737744 } ) ;
738745 } ) ;
739- afterAll ( function ( ) {
740- destroyGraphDiv ( ) ;
741- } ) ;
746+
747+ afterAll ( destroyGraphDiv ) ;
742748
743749 describe ( 'single click' , function ( ) {
744750 it ( 'should hide series' , function ( done ) {
@@ -749,9 +755,11 @@ describe('legend interaction', function() {
749755 done ( ) ;
750756 } , DBLCLICKDELAY + 20 ) ;
751757 } ) ;
758+
752759 it ( 'should fade legend item' , function ( ) {
753760 expect ( + legendItem . parentNode . style . opacity ) . toBeLessThan ( 1 ) ;
754761 } ) ;
762+
755763 it ( 'should unhide series' , function ( done ) {
756764 legendItem . dispatchEvent ( new MouseEvent ( 'mousedown' ) ) ;
757765 legendItem . dispatchEvent ( new MouseEvent ( 'mouseup' ) ) ;
@@ -760,10 +768,12 @@ describe('legend interaction', function() {
760768 done ( ) ;
761769 } , DBLCLICKDELAY + 20 ) ;
762770 } ) ;
771+
763772 it ( 'should unfade legend item' , function ( ) {
764773 expect ( + legendItem . parentNode . style . opacity ) . toBe ( 1 ) ;
765774 } ) ;
766775 } ) ;
776+
767777 describe ( 'double click' , function ( ) {
768778 it ( 'should hide series' , function ( done ) {
769779 legendItem . dispatchEvent ( new MouseEvent ( 'mousedown' ) ) ;
@@ -781,6 +791,7 @@ describe('legend interaction', function() {
781791 done ( ) ;
782792 } , 20 ) ;
783793 } ) ;
794+
784795 it ( 'should fade legend item' , function ( ) {
785796 var legendItemi ;
786797 for ( var i = 0 ; i < legendItems . length ; i ++ ) {
@@ -792,6 +803,7 @@ describe('legend interaction', function() {
792803 }
793804 }
794805 } ) ;
806+
795807 it ( 'should unhide series' , function ( done ) {
796808 legendItem . dispatchEvent ( new MouseEvent ( 'mousedown' ) ) ;
797809 legendItem . dispatchEvent ( new MouseEvent ( 'mouseup' ) ) ;
@@ -804,6 +816,7 @@ describe('legend interaction', function() {
804816 done ( ) ;
805817 } , 20 ) ;
806818 } ) ;
819+
807820 it ( 'should unfade legend items' , function ( ) {
808821 var legendItemi ;
809822 for ( var i = 0 ; i < legendItems . length ; i ++ ) {
0 commit comments