Skip to content

Commit 149701e

Browse files
committed
add missing done and failTest to histogram tests
1 parent 97596ae commit 149701e

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

test/jasmine/tests/histogram_test.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ describe('Test histogram', function() {
11091109

11101110
afterEach(destroyGraphDiv);
11111111

1112-
it('should update autobins correctly when restyling', function() {
1112+
it('should update autobins correctly when restyling', function(done) {
11131113
// note: I'm *not* testing what this does to gd.data, as that's
11141114
// really a matter of convenience and will perhaps change later (v2?)
11151115
var data1 = [1.5, 2, 2, 3, 3, 3, 4, 4, 5];
@@ -1168,10 +1168,12 @@ describe('Test histogram', function() {
11681168
.then(function() {
11691169
expect(gd._fullData[0].xbins).toEqual({start: 9, end: 51, size: 2});
11701170
expect(gd._fullData[0].nbinsx).toBeUndefined();
1171-
});
1171+
})
1172+
.catch(failTest)
1173+
.then(done);
11721174
});
11731175

1174-
it('respects explicit autobin: false as a one-time autobin', function() {
1176+
it('respects explicit autobin: false as a one-time autobin', function(done) {
11751177
var data1 = [1.5, 2, 2, 3, 3, 3, 4, 4, 5];
11761178
Plotly.plot(gd, [{x: data1, type: 'histogram', autobinx: false }])
11771179
.then(function() {
@@ -1187,10 +1189,12 @@ describe('Test histogram', function() {
11871189
})
11881190
.then(function() {
11891191
expect(gd._fullData[0].xbins).toEqual({start: 1, end: 6, size: 1});
1190-
});
1192+
})
1193+
.catch(failTest)
1194+
.then(done);
11911195
});
11921196

1193-
it('allows changing axis type with new x data', function() {
1197+
it('allows changing axis type with new x data', function(done) {
11941198
var x1 = [1, 1, 1, 1, 2, 2, 2, 3, 3, 4];
11951199
var x2 = ['2017-01-01', '2017-01-01', '2017-01-01', '2017-01-02', '2017-01-02', '2017-01-03'];
11961200

@@ -1204,7 +1208,9 @@ describe('Test histogram', function() {
12041208
.then(function() {
12051209
expect(gd._fullLayout.xaxis.type).toBe('date');
12061210
expect(gd._fullLayout.xaxis.range).toEqual(['2016-12-31 12:00', '2017-01-03 12:00']);
1207-
});
1211+
})
1212+
.catch(failTest)
1213+
.then(done);
12081214
});
12091215

12101216
it('can resize a plot with several histograms', function(done) {

0 commit comments

Comments
 (0)