@@ -9,12 +9,11 @@ var helpers = require('@src/components/legend/helpers');
9
9
var anchorUtils = require ( '@src/components/legend/anchor_utils' ) ;
10
10
11
11
var d3 = require ( 'd3' ) ;
12
- var fail = require ( '../assets/fail_test' ) ;
12
+ var failTest = require ( '../assets/fail_test' ) ;
13
13
var delay = require ( '../assets/delay' ) ;
14
14
var createGraphDiv = require ( '../assets/create_graph_div' ) ;
15
15
var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
16
16
17
-
18
17
describe ( 'legend defaults' , function ( ) {
19
18
'use strict' ;
20
19
@@ -538,7 +537,7 @@ describe('legend relayout update', function() {
538
537
. then ( function ( ) {
539
538
expect ( d3 . selectAll ( 'g.legend' ) . size ( ) ) . toBe ( 1 ) ;
540
539
} )
541
- . catch ( fail )
540
+ . catch ( failTest )
542
541
. then ( done ) ;
543
542
} ) ;
544
543
@@ -575,7 +574,7 @@ describe('legend relayout update', function() {
575
574
} ) . then ( function ( ) {
576
575
assertLegendStyle ( 'rgb(0, 0, 255)' , 'rgb(255, 0, 0)' , 10 ) ;
577
576
} )
578
- . catch ( fail )
577
+ . catch ( failTest )
579
578
. then ( done ) ;
580
579
} ) ;
581
580
} ) ;
@@ -907,7 +906,7 @@ describe('legend interaction', function() {
907
906
. then ( function ( ) {
908
907
assertVisible ( gd , [ true , true , true , true ] ) ;
909
908
} )
910
- . catch ( fail )
909
+ . catch ( failTest )
911
910
. then ( done ) ;
912
911
} ) ;
913
912
} ) ;
@@ -976,7 +975,7 @@ describe('legend interaction', function() {
976
975
{ target : 3 } ,
977
976
{ target : 4 }
978
977
] ) ;
979
- } ) . catch ( fail ) . then ( done ) ;
978
+ } ) . catch ( failTest ) . then ( done ) ;
980
979
} ) ;
981
980
} ) ;
982
981
@@ -1023,15 +1022,15 @@ describe('legend interaction', function() {
1023
1022
. then ( assertVisible ( [ false , 'legendonly' , true ] ) )
1024
1023
. then ( click ( 0 ) )
1025
1024
. then ( assertVisible ( [ false , true , true ] ) )
1026
- . catch ( fail ) . then ( done ) ;
1025
+ . catch ( failTest ) . then ( done ) ;
1027
1026
} ) ;
1028
1027
1029
1028
it ( 'clicking once toggles true -> legendonly' , function ( done ) {
1030
1029
Promise . resolve ( )
1031
1030
. then ( assertVisible ( [ false , 'legendonly' , true ] ) )
1032
1031
. then ( click ( 1 ) )
1033
1032
. then ( assertVisible ( [ false , 'legendonly' , 'legendonly' ] ) )
1034
- . catch ( fail ) . then ( done ) ;
1033
+ . catch ( failTest ) . then ( done ) ;
1035
1034
} ) ;
1036
1035
1037
1036
it ( 'double-clicking isolates a visible trace ' , function ( done ) {
@@ -1040,14 +1039,14 @@ describe('legend interaction', function() {
1040
1039
. then ( assertVisible ( [ false , true , true ] ) )
1041
1040
. then ( click ( 0 , 2 ) )
1042
1041
. then ( assertVisible ( [ false , true , 'legendonly' ] ) )
1043
- . catch ( fail ) . then ( done ) ;
1042
+ . catch ( failTest ) . then ( done ) ;
1044
1043
} ) ;
1045
1044
1046
1045
it ( 'double-clicking an isolated trace shows all non-hidden traces' , function ( done ) {
1047
1046
Promise . resolve ( )
1048
1047
. then ( click ( 0 , 2 ) )
1049
1048
. then ( assertVisible ( [ false , true , true ] ) )
1050
- . catch ( fail ) . then ( done ) ;
1049
+ . catch ( failTest ) . then ( done ) ;
1051
1050
} ) ;
1052
1051
} ) ;
1053
1052
@@ -1077,7 +1076,7 @@ describe('legend interaction', function() {
1077
1076
. then ( assertVisible ( [ false , 'legendonly' , true , 'legendonly' ] ) )
1078
1077
. then ( click ( 1 ) )
1079
1078
. then ( assertVisible ( [ false , true , true , true ] ) )
1080
- . catch ( fail ) . then ( done ) ;
1079
+ . catch ( failTest ) . then ( done ) ;
1081
1080
} ) ;
1082
1081
1083
1082
it ( 'isolates legendgroups as a whole' , function ( done ) {
@@ -1086,7 +1085,7 @@ describe('legend interaction', function() {
1086
1085
. then ( assertVisible ( [ false , true , 'legendonly' , true ] ) )
1087
1086
. then ( click ( 1 , 2 ) )
1088
1087
. then ( assertVisible ( [ false , true , true , true ] ) )
1089
- . catch ( fail ) . then ( done ) ;
1088
+ . catch ( failTest ) . then ( done ) ;
1090
1089
} ) ;
1091
1090
} ) ;
1092
1091
@@ -1119,7 +1118,7 @@ describe('legend interaction', function() {
1119
1118
it ( 'computes the initial visibility correctly' , function ( done ) {
1120
1119
Promise . resolve ( )
1121
1120
. then ( assertVisible ( [ false , true , true , true , true , true , true , true ] ) )
1122
- . catch ( fail ) . then ( done ) ;
1121
+ . catch ( failTest ) . then ( done ) ;
1123
1122
} ) ;
1124
1123
1125
1124
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() {
1128
1127
. then ( assertVisible ( [ false , true , 'legendonly' , true , true , true , true , true ] ) )
1129
1128
. then ( click ( 1 ) )
1130
1129
. then ( assertVisible ( [ false , true , true , true , true , true , true , true ] ) )
1131
- . catch ( fail ) . then ( done ) ;
1130
+ . catch ( failTest ) . then ( done ) ;
1132
1131
} ) ;
1133
1132
1134
1133
it ( 'toggles the visibility of the first group in a groupby trace' , function ( done ) {
@@ -1137,7 +1136,7 @@ describe('legend interaction', function() {
1137
1136
. then ( assertVisible ( [ false , 'legendonly' , true , true , true , true , true , true ] ) )
1138
1137
. then ( click ( 0 ) )
1139
1138
. then ( assertVisible ( [ false , true , true , true , true , true , true , true ] ) )
1140
- . catch ( fail ) . then ( done ) ;
1139
+ . catch ( failTest ) . then ( done ) ;
1141
1140
} ) ;
1142
1141
1143
1142
it ( 'toggles the visibility of the third group in a groupby trace' , function ( done ) {
@@ -1146,7 +1145,7 @@ describe('legend interaction', function() {
1146
1145
. then ( assertVisible ( [ false , true , true , true , 'legendonly' , true , true , true ] ) )
1147
1146
. then ( click ( 3 ) )
1148
1147
. then ( assertVisible ( [ false , true , true , true , true , true , true , true ] ) )
1149
- . catch ( fail ) . then ( done ) ;
1148
+ . catch ( failTest ) . then ( done ) ;
1150
1149
} ) ;
1151
1150
1152
1151
it ( 'double-clicking isolates a non-groupby trace' , function ( done ) {
@@ -1155,7 +1154,7 @@ describe('legend interaction', function() {
1155
1154
. then ( assertVisible ( [ false , true , 'legendonly' , 'legendonly' , 'legendonly' , 'legendonly' , 'legendonly' , 'legendonly' ] ) )
1156
1155
. then ( click ( 0 , 2 ) )
1157
1156
. then ( assertVisible ( [ false , true , true , true , true , true , true , true ] ) )
1158
- . catch ( fail ) . then ( done ) ;
1157
+ . catch ( failTest ) . then ( done ) ;
1159
1158
} ) ;
1160
1159
1161
1160
it ( 'double-clicking isolates a groupby trace' , function ( done ) {
@@ -1164,7 +1163,7 @@ describe('legend interaction', function() {
1164
1163
. then ( assertVisible ( [ false , 'legendonly' , true , 'legendonly' , 'legendonly' , 'legendonly' , 'legendonly' , 'legendonly' ] ) )
1165
1164
. then ( click ( 1 , 2 ) )
1166
1165
. then ( assertVisible ( [ false , true , true , true , true , true , true , true ] ) )
1167
- . catch ( fail ) . then ( done ) ;
1166
+ . catch ( failTest ) . then ( done ) ;
1168
1167
} ) ;
1169
1168
} ) ;
1170
1169
} ) ;
0 commit comments