@@ -9,12 +9,11 @@ var helpers = require('@src/components/legend/helpers');
99var anchorUtils = require ( '@src/components/legend/anchor_utils' ) ;
1010
1111var d3 = require ( 'd3' ) ;
12- var fail = require ( '../assets/fail_test' ) ;
12+ var failTest = require ( '../assets/fail_test' ) ;
1313var delay = require ( '../assets/delay' ) ;
1414var createGraphDiv = require ( '../assets/create_graph_div' ) ;
1515var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
1616
17-
1817describe ( 'legend defaults' , function ( ) {
1918 'use strict' ;
2019
@@ -538,7 +537,7 @@ describe('legend relayout update', function() {
538537 . then ( function ( ) {
539538 expect ( d3 . selectAll ( 'g.legend' ) . size ( ) ) . toBe ( 1 ) ;
540539 } )
541- . catch ( fail )
540+ . catch ( failTest )
542541 . then ( done ) ;
543542 } ) ;
544543
@@ -575,7 +574,7 @@ describe('legend relayout update', function() {
575574 } ) . then ( function ( ) {
576575 assertLegendStyle ( 'rgb(0, 0, 255)' , 'rgb(255, 0, 0)' , 10 ) ;
577576 } )
578- . catch ( fail )
577+ . catch ( failTest )
579578 . then ( done ) ;
580579 } ) ;
581580} ) ;
@@ -907,7 +906,7 @@ describe('legend interaction', function() {
907906 . then ( function ( ) {
908907 assertVisible ( gd , [ true , true , true , true ] ) ;
909908 } )
910- . catch ( fail )
909+ . catch ( failTest )
911910 . then ( done ) ;
912911 } ) ;
913912 } ) ;
@@ -976,7 +975,7 @@ describe('legend interaction', function() {
976975 { target : 3 } ,
977976 { target : 4 }
978977 ] ) ;
979- } ) . catch ( fail ) . then ( done ) ;
978+ } ) . catch ( failTest ) . then ( done ) ;
980979 } ) ;
981980 } ) ;
982981
@@ -1023,15 +1022,15 @@ describe('legend interaction', function() {
10231022 . then ( assertVisible ( [ false , 'legendonly' , true ] ) )
10241023 . then ( click ( 0 ) )
10251024 . then ( assertVisible ( [ false , true , true ] ) )
1026- . catch ( fail ) . then ( done ) ;
1025+ . catch ( failTest ) . then ( done ) ;
10271026 } ) ;
10281027
10291028 it ( 'clicking once toggles true -> legendonly' , function ( done ) {
10301029 Promise . resolve ( )
10311030 . then ( assertVisible ( [ false , 'legendonly' , true ] ) )
10321031 . then ( click ( 1 ) )
10331032 . then ( assertVisible ( [ false , 'legendonly' , 'legendonly' ] ) )
1034- . catch ( fail ) . then ( done ) ;
1033+ . catch ( failTest ) . then ( done ) ;
10351034 } ) ;
10361035
10371036 it ( 'double-clicking isolates a visible trace ' , function ( done ) {
@@ -1040,14 +1039,14 @@ describe('legend interaction', function() {
10401039 . then ( assertVisible ( [ false , true , true ] ) )
10411040 . then ( click ( 0 , 2 ) )
10421041 . then ( assertVisible ( [ false , true , 'legendonly' ] ) )
1043- . catch ( fail ) . then ( done ) ;
1042+ . catch ( failTest ) . then ( done ) ;
10441043 } ) ;
10451044
10461045 it ( 'double-clicking an isolated trace shows all non-hidden traces' , function ( done ) {
10471046 Promise . resolve ( )
10481047 . then ( click ( 0 , 2 ) )
10491048 . then ( assertVisible ( [ false , true , true ] ) )
1050- . catch ( fail ) . then ( done ) ;
1049+ . catch ( failTest ) . then ( done ) ;
10511050 } ) ;
10521051 } ) ;
10531052
@@ -1077,7 +1076,7 @@ describe('legend interaction', function() {
10771076 . then ( assertVisible ( [ false , 'legendonly' , true , 'legendonly' ] ) )
10781077 . then ( click ( 1 ) )
10791078 . then ( assertVisible ( [ false , true , true , true ] ) )
1080- . catch ( fail ) . then ( done ) ;
1079+ . catch ( failTest ) . then ( done ) ;
10811080 } ) ;
10821081
10831082 it ( 'isolates legendgroups as a whole' , function ( done ) {
@@ -1086,7 +1085,7 @@ describe('legend interaction', function() {
10861085 . then ( assertVisible ( [ false , true , 'legendonly' , true ] ) )
10871086 . then ( click ( 1 , 2 ) )
10881087 . then ( assertVisible ( [ false , true , true , true ] ) )
1089- . catch ( fail ) . then ( done ) ;
1088+ . catch ( failTest ) . then ( done ) ;
10901089 } ) ;
10911090 } ) ;
10921091
@@ -1119,7 +1118,7 @@ describe('legend interaction', function() {
11191118 it ( 'computes the initial visibility correctly' , function ( done ) {
11201119 Promise . resolve ( )
11211120 . then ( assertVisible ( [ false , true , true , true , true , true , true , true ] ) )
1122- . catch ( fail ) . then ( done ) ;
1121+ . catch ( failTest ) . then ( done ) ;
11231122 } ) ;
11241123
11251124 it ( 'toggles the visibility of a non-groupby trace in the presence of groupby traces' , function ( done ) {
@@ -1128,7 +1127,7 @@ describe('legend interaction', function() {
11281127 . then ( assertVisible ( [ false , true , 'legendonly' , true , true , true , true , true ] ) )
11291128 . then ( click ( 1 ) )
11301129 . then ( assertVisible ( [ false , true , true , true , true , true , true , true ] ) )
1131- . catch ( fail ) . then ( done ) ;
1130+ . catch ( failTest ) . then ( done ) ;
11321131 } ) ;
11331132
11341133 it ( 'toggles the visibility of the first group in a groupby trace' , function ( done ) {
@@ -1137,7 +1136,7 @@ describe('legend interaction', function() {
11371136 . then ( assertVisible ( [ false , 'legendonly' , true , true , true , true , true , true ] ) )
11381137 . then ( click ( 0 ) )
11391138 . then ( assertVisible ( [ false , true , true , true , true , true , true , true ] ) )
1140- . catch ( fail ) . then ( done ) ;
1139+ . catch ( failTest ) . then ( done ) ;
11411140 } ) ;
11421141
11431142 it ( 'toggles the visibility of the third group in a groupby trace' , function ( done ) {
@@ -1146,7 +1145,7 @@ describe('legend interaction', function() {
11461145 . then ( assertVisible ( [ false , true , true , true , 'legendonly' , true , true , true ] ) )
11471146 . then ( click ( 3 ) )
11481147 . then ( assertVisible ( [ false , true , true , true , true , true , true , true ] ) )
1149- . catch ( fail ) . then ( done ) ;
1148+ . catch ( failTest ) . then ( done ) ;
11501149 } ) ;
11511150
11521151 it ( 'double-clicking isolates a non-groupby trace' , function ( done ) {
@@ -1155,7 +1154,7 @@ describe('legend interaction', function() {
11551154 . then ( assertVisible ( [ false , true , 'legendonly' , 'legendonly' , 'legendonly' , 'legendonly' , 'legendonly' , 'legendonly' ] ) )
11561155 . then ( click ( 0 , 2 ) )
11571156 . then ( assertVisible ( [ false , true , true , true , true , true , true , true ] ) )
1158- . catch ( fail ) . then ( done ) ;
1157+ . catch ( failTest ) . then ( done ) ;
11591158 } ) ;
11601159
11611160 it ( 'double-clicking isolates a groupby trace' , function ( done ) {
@@ -1164,7 +1163,7 @@ describe('legend interaction', function() {
11641163 . then ( assertVisible ( [ false , 'legendonly' , true , 'legendonly' , 'legendonly' , 'legendonly' , 'legendonly' , 'legendonly' ] ) )
11651164 . then ( click ( 1 , 2 ) )
11661165 . then ( assertVisible ( [ false , true , true , true , true , true , true , true ] ) )
1167- . catch ( fail ) . then ( done ) ;
1166+ . catch ( failTest ) . then ( done ) ;
11681167 } ) ;
11691168 } ) ;
11701169 } ) ;
0 commit comments