@@ -3,15 +3,14 @@ var Plotly = require('@lib/index');
3
3
var Bar = require ( '@src/traces/bar' ) ;
4
4
var Lib = require ( '@src/lib' ) ;
5
5
var Plots = require ( '@src/plots/plots' ) ;
6
+ var Drawing = require ( '@src/components/drawing' ) ;
6
7
7
- var PlotlyInternal = require ( '@src/plotly' ) ;
8
- var Axes = PlotlyInternal . Axes ;
8
+ var Axes = require ( '@src/plots/cartesian/axes' ) ;
9
9
10
10
var createGraphDiv = require ( '../assets/create_graph_div' ) ;
11
11
var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
12
12
var fail = require ( '../assets/fail_test' ) ;
13
13
var customMatchers = require ( '../assets/custom_matchers' ) ;
14
- var failTest = require ( '../assets/fail_test' ) ;
15
14
16
15
describe ( 'Bar.supplyDefaults' , function ( ) {
17
16
'use strict' ;
@@ -855,9 +854,9 @@ describe('A bar plot', function() {
855
854
}
856
855
857
856
expect ( foundTextNodes ) . toBe ( true ) ;
858
-
859
- done ( ) ;
860
- } ) ;
857
+ } )
858
+ . catch ( fail )
859
+ . then ( done ) ;
861
860
} ) ;
862
861
863
862
it ( 'should show bar texts (outside case)' , function ( done ) {
@@ -889,9 +888,9 @@ describe('A bar plot', function() {
889
888
}
890
889
891
890
expect ( foundTextNodes ) . toBe ( true ) ;
892
-
893
- done ( ) ;
894
- } ) ;
891
+ } )
892
+ . catch ( fail )
893
+ . then ( done ) ;
895
894
} ) ;
896
895
897
896
it ( 'should show bar texts (horizontal case)' , function ( done ) {
@@ -922,9 +921,9 @@ describe('A bar plot', function() {
922
921
}
923
922
924
923
expect ( foundTextNodes ) . toBe ( true ) ;
925
-
926
- done ( ) ;
927
- } ) ;
924
+ } )
925
+ . catch ( fail )
926
+ . then ( done ) ;
928
927
} ) ;
929
928
930
929
it ( 'should show bar texts (barnorm case)' , function ( done ) {
@@ -957,9 +956,9 @@ describe('A bar plot', function() {
957
956
}
958
957
959
958
expect ( foundTextNodes ) . toBe ( true ) ;
960
-
961
- done ( ) ;
962
- } ) ;
959
+ } )
960
+ . catch ( fail )
961
+ . then ( done ) ;
963
962
} ) ;
964
963
965
964
it ( 'should be able to restyle' , function ( done ) {
@@ -1107,9 +1106,9 @@ describe('A bar plot', function() {
1107
1106
assertTextIsInsidePath ( text12 , path12 ) ; // inside
1108
1107
assertTextIsInsidePath ( text20 , path20 ) ; // inside
1109
1108
assertTextIsInsidePath ( text30 , path30 ) ; // inside
1110
-
1111
- done ( ) ;
1112
- } ) ;
1109
+ } )
1110
+ . catch ( fail )
1111
+ . then ( done ) ;
1113
1112
} ) ;
1114
1113
1115
1114
it ( 'should coerce text-related attributes' , function ( done ) {
@@ -1189,9 +1188,9 @@ describe('A bar plot', function() {
1189
1188
assertTextFont ( textNodes [ 0 ] , expected . insidetextfont , 0 ) ;
1190
1189
assertTextFont ( textNodes [ 1 ] , expected . outsidetextfont , 1 ) ;
1191
1190
assertTextFont ( textNodes [ 2 ] , expected . insidetextfont , 2 ) ;
1192
-
1193
- done ( ) ;
1194
- } ) ;
1191
+ } )
1192
+ . catch ( fail )
1193
+ . then ( done ) ;
1195
1194
} ) ;
1196
1195
} ) ;
1197
1196
@@ -1248,7 +1247,9 @@ describe('bar hover', function() {
1248
1247
1249
1248
var mock = Lib . extendDeep ( { } , require ( '@mocks/11.json' ) ) ;
1250
1249
1251
- Plotly . plot ( gd , mock . data , mock . layout ) . then ( done ) ;
1250
+ Plotly . plot ( gd , mock . data , mock . layout )
1251
+ . catch ( fail )
1252
+ . then ( done ) ;
1252
1253
} ) ;
1253
1254
1254
1255
it ( 'should return the correct hover point data (case x)' , function ( ) {
@@ -1272,7 +1273,9 @@ describe('bar hover', function() {
1272
1273
1273
1274
var mock = Lib . extendDeep ( { } , require ( '@mocks/bar_attrs_group_norm.json' ) ) ;
1274
1275
1275
- Plotly . plot ( gd , mock . data , mock . layout ) . then ( done ) ;
1276
+ Plotly . plot ( gd , mock . data , mock . layout )
1277
+ . catch ( fail )
1278
+ . then ( done ) ;
1276
1279
} ) ;
1277
1280
1278
1281
it ( 'should return the correct hover point data (case y)' , function ( ) {
@@ -1387,7 +1390,7 @@ describe('bar hover', function() {
1387
1390
expect ( out ) . toBe ( false , hoverSpec ) ;
1388
1391
} ) ;
1389
1392
} )
1390
- . catch ( failTest )
1393
+ . catch ( fail )
1391
1394
. then ( done ) ;
1392
1395
} ) ;
1393
1396
@@ -1425,7 +1428,7 @@ describe('bar hover', function() {
1425
1428
expect ( out . style ) . toEqual ( [ 1 , 'red' , 200 , 1 ] ) ;
1426
1429
assertPos ( out . pos , [ 203 , 304 , 168 , 168 ] ) ;
1427
1430
} )
1428
- . catch ( failTest )
1431
+ . catch ( fail )
1429
1432
. then ( done ) ;
1430
1433
} ) ;
1431
1434
} ) ;
0 commit comments