Skip to content

Commit 7f90732

Browse files
committed
add catch failTest to 4 places in config test
1 parent ec53d29 commit 7f90732

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

test/jasmine/tests/config_test.js

+16-8
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,18 @@ describe('config argument', function() {
231231

232232
afterEach(destroyGraphDiv);
233233

234-
it('should not display the edit link by default', function() {
234+
it('should not display the edit link by default', function(done) {
235235
Plotly.plot(gd, [], {})
236236
.then(function() {
237237
var link = document.getElementsByClassName('js-plot-link-container')[0];
238238

239239
expect(link).toBeUndefined();
240-
});
240+
})
241+
.catch(failTest)
242+
.then(done);
241243
});
242244

243-
it('should display a link when true', function() {
245+
it('should display a link when true', function(done) {
244246
Plotly.plot(gd, [], {}, { showLink: true })
245247
.then(function() {
246248
var link = document.getElementsByClassName('js-plot-link-container')[0];
@@ -250,7 +252,9 @@ describe('config argument', function() {
250252
var bBox = link.getBoundingClientRect();
251253
expect(bBox.width).toBeGreaterThan(0);
252254
expect(bBox.height).toBeGreaterThan(0);
253-
});
255+
})
256+
.catch(failTest)
257+
.then(done);
254258
});
255259
});
256260

@@ -491,7 +495,7 @@ describe('config argument', function() {
491495

492496
afterEach(destroyGraphDiv);
493497

494-
it('allows axis range entry by default', function() {
498+
it('allows axis range entry by default', function(done) {
495499
Plotly.plot(gd, mockCopy.data, {})
496500
.then(function() {
497501
var corner = document.getElementsByClassName('edrag')[0];
@@ -504,10 +508,12 @@ describe('config argument', function() {
504508
var editBox = document.getElementsByClassName('plugin-editable editable')[0];
505509
expect(editBox).toBeDefined();
506510
expect(editBox.getAttribute('contenteditable')).toBe('true');
507-
});
511+
})
512+
.catch(failTest)
513+
.then(done);
508514
});
509515

510-
it('disallows axis range entry when disabled', function() {
516+
it('disallows axis range entry when disabled', function(done) {
511517
Plotly.plot(gd, mockCopy.data, {}, { showAxisRangeEntryBoxes: false })
512518
.then(function() {
513519
var corner = document.getElementsByClassName('edrag')[0];
@@ -519,7 +525,9 @@ describe('config argument', function() {
519525

520526
var editBox = document.getElementsByClassName('plugin-editable editable')[0];
521527
expect(editBox).toBeUndefined();
522-
});
528+
})
529+
.catch(failTest)
530+
.then(done);
523531
});
524532
});
525533

0 commit comments

Comments
 (0)