Skip to content

Commit e6555b0

Browse files
committed
change all catch(fail) instances to catch(failTest)
1 parent 1a69837 commit e6555b0

File tree

3 files changed

+42
-40
lines changed

3 files changed

+42
-40
lines changed

test/jasmine/tests/cartesian_interact_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2337,7 +2337,7 @@ describe('Event data:', function() {
23372337
expect('marker.colorbar.tickvals' in pt).toBe(false, 'marker.colorbar.tickvals');
23382338
expect('marker.colorbar.ticktext' in pt).toBe(false, 'marker.colorbar.ticktext');
23392339
})
2340-
.catch(fail)
2340+
.catch(failTest)
23412341
.then(done);
23422342
});
23432343

@@ -2365,7 +2365,7 @@ describe('Event data:', function() {
23652365
expect('marker.colorbar.tickvals' in pt).toBe(false, 'marker.colorbar.tickvals');
23662366
expect('marker.colorbar.ticktext' in pt).toBe(false, 'marker.colorbar.ticktext');
23672367
})
2368-
.catch(fail)
2368+
.catch(failTest)
23692369
.then(done);
23702370
});
23712371
});

test/jasmine/tests/fx_test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ var d3 = require('d3');
44
var createGraphDiv = require('../assets/create_graph_div');
55
var destroyGraphDiv = require('../assets/destroy_graph_div');
66
var supplyAllDefaults = require('../assets/supply_defaults');
7+
var failTest = require('../assets/fail_test');
78

89
describe('Fx defaults', function() {
910
'use strict';
@@ -268,6 +269,6 @@ describe('relayout', function() {
268269
return Plotly.relayout(gd, 'xaxis.fixedrange', false);
269270
}).then(function() {
270271
assertMainDrag('ew-resize', true);
271-
}).catch(fail).then(done);
272+
}).catch(failTest).then(done);
272273
});
273274
});

test/jasmine/tests/titles_test.js

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var rgb = require('@src/components/color').rgb;
99
var createGraphDiv = require('../assets/create_graph_div');
1010
var destroyGraphDiv = require('../assets/destroy_graph_div');
1111
var mouseEvent = require('../assets/mouse_event');
12+
var failTest = require('../assets/fail_test');
1213

1314
describe('Plot title', function() {
1415
'use strict';
@@ -47,7 +48,7 @@ describe('Plot title', function() {
4748
.then(function() {
4849
expectDefaultCenteredPosition(gd);
4950
})
50-
.catch(fail)
51+
.catch(failTest)
5152
.then(done);
5253
});
5354

@@ -57,7 +58,7 @@ describe('Plot title', function() {
5758
expectTitle('Plotly line chart');
5859
expectDefaultCenteredPosition(gd);
5960
})
60-
.catch(fail)
61+
.catch(failTest)
6162
.then(done);
6263
});
6364

@@ -68,7 +69,7 @@ describe('Plot title', function() {
6869
return Plotly.relayout(gd, {title: {text: 'Some other title'}});
6970
})
7071
.then(expectTitleFn('Some other title'))
71-
.catch(fail)
72+
.catch(failTest)
7273
.then(done);
7374
});
7475

@@ -92,7 +93,7 @@ describe('Plot title', function() {
9293
.then(function() {
9394
expectLeftEdgeAlignedTo(testCase.selector);
9495
})
95-
.catch(fail)
96+
.catch(failTest)
9697
.then(done);
9798
});
9899

@@ -105,7 +106,7 @@ describe('Plot title', function() {
105106
.then(function() {
106107
expectRightEdgeAlignedTo(testCase.selector);
107108
})
108-
.catch(fail)
109+
.catch(failTest)
109110
.then(done);
110111
});
111112

@@ -118,7 +119,7 @@ describe('Plot title', function() {
118119
.then(function() {
119120
expectCenteredWithin(testCase.selector);
120121
})
121-
.catch(fail)
122+
.catch(failTest)
122123
.then(done);
123124
});
124125
});
@@ -143,7 +144,7 @@ describe('Plot title', function() {
143144
.then(function() {
144145
expectCapLineAlignsWithTopEdgeOf(testCase.selector);
145146
})
146-
.catch(fail)
147+
.catch(failTest)
147148
.then(done);
148149
});
149150

@@ -156,7 +157,7 @@ describe('Plot title', function() {
156157
.then(function() {
157158
expectBaselineAlignsWithBottomEdgeOf(testCase.selector);
158159
})
159-
.catch(fail)
160+
.catch(failTest)
160161
.then(done);
161162
});
162163

@@ -169,7 +170,7 @@ describe('Plot title', function() {
169170
.then(function() {
170171
expectCenteredVerticallyWithin(testCase.selector);
171172
})
172-
.catch(fail)
173+
.catch(failTest)
173174
.then(done);
174175
});
175176
});
@@ -191,7 +192,7 @@ describe('Plot title', function() {
191192
.then(function() {
192193
expectBaselineInMiddleOfTopMargin(gd);
193194
})
194-
.catch(fail)
195+
.catch(failTest)
195196
.then(done);
196197
});
197198

@@ -222,7 +223,7 @@ describe('Plot title', function() {
222223
var textAnchor = titleSel().attr('text-anchor');
223224
expect(textAnchor).toBe(testCase.expAlignment, testDesc);
224225
})
225-
.catch(fail)
226+
.catch(failTest)
226227
.then(done);
227228
});
228229
}
@@ -255,7 +256,7 @@ describe('Plot title', function() {
255256
.then(function() {
256257
testCase.expFn(elemSelector);
257258
})
258-
.catch(fail)
259+
.catch(failTest)
259260
.then(done);
260261
});
261262
}
@@ -269,7 +270,7 @@ describe('Plot title', function() {
269270
.then(function() {
270271
expectDefaultCenteredPosition(gd);
271272
})
272-
.catch(fail)
273+
.catch(failTest)
273274
.then(done);
274275
});
275276

@@ -286,7 +287,7 @@ describe('Plot title', function() {
286287
expect(titleSel().attr('text-anchor')).toBe('start');
287288
expect(titleX() - 10).toBe(leftOf(refSelector));
288289
})
289-
.catch(fail)
290+
.catch(failTest)
290291
.then(done);
291292
});
292293
});
@@ -303,7 +304,7 @@ describe('Plot title', function() {
303304
expect(titleSel().attr('text-anchor')).toBe('end');
304305
expect(titleX() + 10).toBe(rightOf(refSelector));
305306
})
306-
.catch(fail)
307+
.catch(failTest)
307308
.then(done);
308309
});
309310
});
@@ -332,7 +333,7 @@ describe('Plot title', function() {
332333
.then(function() {
333334
expectCenteredWithin(refSelector);
334335
})
335-
.catch(fail)
336+
.catch(failTest)
336337
.then(done);
337338
});
338339
});
@@ -353,7 +354,7 @@ describe('Plot title', function() {
353354
.then(function() {
354355
expectCenteredWithin(paperElemSelector);
355356
})
356-
.catch(fail)
357+
.catch(failTest)
357358
.then(done);
358359
});
359360
});
@@ -370,7 +371,7 @@ describe('Plot title', function() {
370371
.then(function() {
371372
expectRightEdgeAlignedTo(paperElemSelector);
372373
})
373-
.catch(fail)
374+
.catch(failTest)
374375
.then(done);
375376
});
376377

@@ -386,7 +387,7 @@ describe('Plot title', function() {
386387
.then(function() {
387388
expectLeftEdgeAlignedTo(paperElemSelector);
388389
})
389-
.catch(fail)
390+
.catch(failTest)
390391
.then(done);
391392
});
392393

@@ -403,7 +404,7 @@ describe('Plot title', function() {
403404
var capLineY = calcTextCapLineY(titleSel());
404405
expect(capLineY).toBe(topOf(refSelector) + 10);
405406
})
406-
.catch(fail)
407+
.catch(failTest)
407408
.then(done);
408409
});
409410
});
@@ -420,7 +421,7 @@ describe('Plot title', function() {
420421
var baselineY = calcTextBaselineY(titleSel());
421422
expect(baselineY).toBe(bottomOf(refSelector) - 10);
422423
})
423-
.catch(fail)
424+
.catch(failTest)
424425
.then(done);
425426
});
426427
});
@@ -449,7 +450,7 @@ describe('Plot title', function() {
449450
.then(function() {
450451
expectCenteredVerticallyWithin(refSelector);
451452
})
452-
.catch(fail)
453+
.catch(failTest)
453454
.then(done);
454455
});
455456
});
@@ -470,7 +471,7 @@ describe('Plot title', function() {
470471
.then(function() {
471472
expectCenteredVerticallyWithin(paperElemSelector);
472473
})
473-
.catch(fail)
474+
.catch(failTest)
474475
.then(done);
475476
});
476477
});
@@ -487,7 +488,7 @@ describe('Plot title', function() {
487488
.then(function() {
488489
expectBaselineAlignsWithBottomEdgeOf(paperElemSelector);
489490
})
490-
.catch(fail)
491+
.catch(failTest)
491492
.then(done);
492493
});
493494

@@ -503,7 +504,7 @@ describe('Plot title', function() {
503504
.then(function() {
504505
expectCapLineAlignsWithTopEdgeOf(paperElemSelector);
505506
})
506-
.catch(fail)
507+
.catch(failTest)
507508
.then(done);
508509
});
509510

@@ -675,7 +676,7 @@ describe('Titles can be updated', function() {
675676
.then(function() {
676677
expectChangedTitles();
677678
})
678-
.catch(fail)
679+
.catch(failTest)
679680
.then(done);
680681
});
681682

@@ -684,7 +685,7 @@ describe('Titles can be updated', function() {
684685
.then(function() {
685686
expectChangedTitles();
686687
})
687-
.catch(fail)
688+
.catch(failTest)
688689
.then(done);
689690
});
690691
});
@@ -758,7 +759,7 @@ describe('Titles and labels', function() {
758759
expect(xTitleSel().text()).toBe('x-new');
759760
expect(d3.select('.xtick').text()).toBe('b');
760761
})
761-
.catch(fail)
762+
.catch(failTest)
762763
.then(done);
763764
});
764765
});
@@ -813,7 +814,7 @@ describe('Titles support setting custom font properties', function() {
813814
expectXAxisTitleFont('#333', 'sans-serif', 20);
814815
expectYAxisTitleFont('#666', 'Arial', 16);
815816
})
816-
.catch(fail)
817+
.catch(failTest)
817818
.then(done);
818819
});
819820

@@ -855,7 +856,7 @@ describe('Titles support setting custom font properties', function() {
855856
expectXAxisTitleFont('#333', 'sans-serif', 20);
856857
expectYAxisTitleFont('#666', 'Arial', 16);
857858
})
858-
.catch(fail)
859+
.catch(failTest)
859860
.then(done);
860861
});
861862
});
@@ -983,7 +984,7 @@ describe('Title fonts can be updated', function() {
983984
.then(function() {
984985
expectChangedTitleFonts();
985986
})
986-
.catch(fail)
987+
.catch(failTest)
987988
.then(done);
988989
});
989990

@@ -992,7 +993,7 @@ describe('Title fonts can be updated', function() {
992993
.then(function() {
993994
expectChangedTitleFonts();
994995
})
995-
.catch(fail)
996+
.catch(failTest)
996997
.then(done);
997998
});
998999
});
@@ -1062,7 +1063,7 @@ describe('Titles for multiple axes', function() {
10621063
expect(yTitleSel(2).text()).toBe('Y-Axis 2');
10631064
expect(yTitleSel(2).node().style.fill).toBe(rgb('blue'));
10641065
})
1065-
.catch(fail)
1066+
.catch(failTest)
10661067
.then(done);
10671068
});
10681069

@@ -1093,7 +1094,7 @@ describe('Titles for multiple axes', function() {
10931094
expect(y2Style.fontFamily).toBe('monospace');
10941095
expect(y2Style.fontSize).toBe('5px');
10951096
})
1096-
.catch(fail)
1097+
.catch(failTest)
10971098
.then(done);
10981099
});
10991100
});
@@ -1287,7 +1288,7 @@ describe('Editable titles', function() {
12871288
checkTitle('g', 'Click to enter Plot title', 0.2, 0.2)
12881289
]);
12891290
})
1290-
.catch(fail)
1291+
.catch(failTest)
12911292
.then(done);
12921293
});
12931294

@@ -1304,7 +1305,7 @@ describe('Editable titles', function() {
13041305
checkTitle('g', 'Click to enter Plot title', 0, 1)
13051306
]);
13061307
})
1307-
.catch(fail)
1308+
.catch(failTest)
13081309
.then(done);
13091310
});
13101311

@@ -1330,7 +1331,7 @@ describe('Editable titles', function() {
13301331
checkTitle('g', 'TTT', 1, 1)
13311332
]);
13321333
})
1333-
.catch(fail)
1334+
.catch(failTest)
13341335
.then(done);
13351336
});
13361337
});

0 commit comments

Comments
 (0)