Skip to content

Commit 77ab257

Browse files
committed
improve transition test
1 parent 530281a commit 77ab257

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

test/jasmine/tests/transition_test.js

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,25 +1196,21 @@ describe('Plotly.react transitions:', function() {
11961196

11971197
gd.layout.xaxis.range = ['2018-06-01', '2019-06-01'];
11981198
gd.layout.xaxis2.range = [0.5, 1.5];
1199-
var promise = Plotly.react(gd, gd.data, gd.layout);
12001199

1201-
setTimeout(function() {
1202-
var fullLayout = gd._fullLayout;
1200+
return Plotly.react(gd, gd.data, gd.layout);
1201+
}).then(function() {
1202+
var fullLayout = gd._fullLayout;
12031203

1204-
var xa = fullLayout.xaxis;
1205-
var xr = xa.range.slice();
1206-
expect(xa.r2l(xr[0])).toBeGreaterThan(xa.r2l('2018-01-01'));
1207-
expect(xa.r2l(xr[1])).toBeLessThan(xa.r2l('2020-01-01'));
1204+
var xa = fullLayout.xaxis;
1205+
var xr = xa.range.slice();
1206+
expect(xa.r2l(xr[0])).toBeGreaterThan(xa.r2l('2018-01-01'));
1207+
expect(xa.r2l(xr[1])).toBeLessThan(xa.r2l('2020-01-01'));
12081208

1209-
var xa2 = fullLayout.xaxis2;
1210-
var xr2 = xa2.range.slice();
1211-
expect(xr2[0]).toBeGreaterThan(0);
1212-
expect(xr2[1]).toBeLessThan(2);
1213-
}, 15);
1209+
var xa2 = fullLayout.xaxis2;
1210+
var xr2 = xa2.range.slice();
1211+
expect(xr2[0]).toBeGreaterThan(0);
1212+
expect(xr2[1]).toBeLessThan(2);
12141213

1215-
return promise;
1216-
})
1217-
.then(function() {
12181214
expect(gd._fullLayout.xaxis.range).toEqual(['2018-06-01', '2019-06-01']);
12191215
expect(gd._fullLayout.xaxis2.range).toEqual([0.5, 1.5]);
12201216
})

0 commit comments

Comments
 (0)