Skip to content

Commit afad530

Browse files
committed
fixup tests post _length===0 commit
1 parent 3a5a4c2 commit afad530

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

test/jasmine/tests/transform_filter_test.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,15 @@ describe('filter transforms interactions', function() {
13211321
});
13221322

13231323
describe('filter resulting in empty coordinate arrays', function() {
1324-
afterEach(destroyGraphDiv);
1324+
var gd;
1325+
1326+
afterEach(function(done) {
1327+
Plotly.purge(gd);
1328+
setTimeout(function() {
1329+
destroyGraphDiv();
1330+
done();
1331+
}, 200);
1332+
});
13251333

13261334
function filter2empty(mock) {
13271335
var fig = Lib.extendDeep({}, mock);
@@ -1348,7 +1356,7 @@ describe('filter resulting in empty coordinate arrays', function() {
13481356
}
13491357

13501358
it(d[0], function(done) {
1351-
var gd = createGraphDiv();
1359+
gd = createGraphDiv();
13521360
var fig = filter2empty(d[1]);
13531361
Plotly.newPlot(gd, fig).catch(failTest).then(done);
13541362
});
@@ -1360,7 +1368,7 @@ describe('filter resulting in empty coordinate arrays', function() {
13601368

13611369
mockList.forEach(function(d) {
13621370
it('@gl ' + d[0], function(done) {
1363-
var gd = createGraphDiv();
1371+
gd = createGraphDiv();
13641372
var fig = filter2empty(d[1]);
13651373
Plotly.newPlot(gd, fig).catch(failTest).then(done);
13661374
});
@@ -1376,7 +1384,7 @@ describe('filter resulting in empty coordinate arrays', function() {
13761384

13771385
mockList.forEach(function(d) {
13781386
it('@noCI ' + d[0], function(done) {
1379-
var gd = createGraphDiv();
1387+
gd = createGraphDiv();
13801388
var fig = filter2empty(d[1]);
13811389
Plotly.newPlot(gd, fig).catch(failTest).then(done);
13821390
});

test/jasmine/tests/waterfall_test.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ describe('A waterfall plot', function() {
957957
.then(done);
958958
});
959959

960-
it('should be able to deal with blank bars on transform', function(done) {
960+
it('should be able to deal with transform that empty out the data coordinate arrays', function(done) {
961961
Plotly.plot(gd, {
962962
data: [{
963963
type: 'waterfall',
@@ -974,14 +974,11 @@ describe('A waterfall plot', function() {
974974
})
975975
.then(function() {
976976
var traceNodes = getAllTraceNodes(gd);
977-
var waterfallNodes = getAllWaterfallNodes(traceNodes[0]);
978-
var pathNode = waterfallNodes[0].querySelector('path');
977+
expect(traceNodes.length).toBe(0);
979978

980979
expect(gd.calcdata[0][0].x).toEqual(NaN);
981980
expect(gd.calcdata[0][0].y).toEqual(NaN);
982-
expect(gd.calcdata[0][0].isBlank).toBe(true);
983-
984-
expect(pathNode.outerHTML).toEqual('<path d="M0,0Z" style="vector-effect: non-scaling-stroke;"></path>');
981+
expect(gd.calcdata[0][0].isBlank).toBe(undefined);
985982
})
986983
.catch(failTest)
987984
.then(done);

0 commit comments

Comments
 (0)