Skip to content

Commit 3132624

Browse files
committed
cleanup cartesian_interact_test a little
1 parent d077e32 commit 3132624

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

test/jasmine/tests/cartesian_interact_test.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ describe('zoom box element', function() {
2727
var mockCopy = Lib.extendDeep({}, mock);
2828
mockCopy.layout.dragmode = 'zoom';
2929

30-
Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(done);
30+
Plotly.plot(gd, mockCopy.data, mockCopy.layout)
31+
.catch(failTest)
32+
.then(done);
3133
});
3234

3335
afterEach(destroyGraphDiv);
@@ -74,9 +76,9 @@ describe('main plot pan', function() {
7476
relayoutCallback = jasmine.createSpy('relayoutCallback');
7577

7678
gd.on('plotly_relayout', relayoutCallback);
77-
78-
done();
79-
});
79+
})
80+
.catch(failTest)
81+
.then(done);
8082
});
8183

8284
afterEach(destroyGraphDiv);
@@ -211,6 +213,7 @@ describe('axis zoom/pan and main plot zoom', function() {
211213
// each subplot is 200x200 px
212214
// if constrainScales is used, x/x2/y/y2 are linked, as are x3/y3
213215
// layoutEdits are other changes to make to the layout
216+
214217
var data = [
215218
{y: [0, 1, 2]},
216219
{y: [0, 1, 2], xaxis: 'x2'},
@@ -242,9 +245,9 @@ describe('axis zoom/pan and main plot zoom', function() {
242245

243246
if(layoutEdits) Lib.extendDeep(layout, layoutEdits);
244247

245-
return Plotly.newPlot(gd, data, layout, config).then(function() {
246-
checkRanges({}, 'initial');
247-
248+
return Plotly.newPlot(gd, data, layout, config)
249+
.then(checkRanges({}, 'initial'))
250+
.then(function() {
248251
expect(Object.keys(gd._fullLayout._plots))
249252
.toEqual(['xy', 'xy2', 'x2y', 'x3y3']);
250253

@@ -278,6 +281,7 @@ describe('axis zoom/pan and main plot zoom', function() {
278281
function checkRanges(newRanges, msg) {
279282
msg = msg || '';
280283
if(msg) msg = ' - ' + msg;
284+
281285
return function() {
282286
var allRanges = {
283287
xaxis: initialRange.slice(),

0 commit comments

Comments
 (0)