Skip to content

Commit 0d76bf5

Browse files
committed
added a jasmine test
1 parent 572b218 commit 0d76bf5

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/jasmine/tests/waterfall_test.js

+30
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,36 @@ describe('A waterfall plot', function() {
948948
.then(done);
949949
});
950950

951+
it('should be able to deal with blank bars on transform', function(done) {
952+
Plotly.plot(gd, {
953+
data: [{
954+
type: 'waterfall',
955+
x: [1, 2, 3],
956+
xsrc: 'ints',
957+
transforms: [{
958+
type: 'filter',
959+
target: [1, 2, 3],
960+
targetsrc: 'ints',
961+
operation: '<',
962+
value: 0
963+
}]
964+
}]
965+
})
966+
.then(function() {
967+
var traceNodes = getAllTraceNodes(gd);
968+
var waterfallNodes = getAllWaterfallNodes(traceNodes[0]);
969+
var pathNode = waterfallNodes[0].querySelector('path');
970+
971+
expect(gd.calcdata[0][0].x).toEqual(NaN);
972+
expect(gd.calcdata[0][0].y).toEqual(NaN);
973+
expect(gd.calcdata[0][0].isBlank).toBe(true);
974+
975+
expect(pathNode.outerHTML).toEqual('<path d="M0,0Z" style="vector-effect: non-scaling-stroke;"></path>');
976+
})
977+
.catch(failTest)
978+
.then(done);
979+
});
980+
951981
it('should coerce text-related attributes', function(done) {
952982
var data = [{
953983
y: [10, 20, 30, 40],

0 commit comments

Comments
 (0)