Skip to content

Commit 494775b

Browse files
committed
add transition tests for blank bars - as currently pass on master too
1 parent c83839f commit 494775b

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

test/jasmine/tests/bar_test.js

+61
Original file line numberDiff line numberDiff line change
@@ -2870,6 +2870,67 @@ describe('bar tweening', function() {
28702870
.catch(failTest)
28712871
.then(done);
28722872
});
2873+
2874+
it('blank vertical bars', function(done) {
2875+
var mockCopy = {
2876+
data: [{
2877+
type: 'bar',
2878+
x: ['A', 'B', 'C'],
2879+
y: [null, 5, 3],
2880+
marker: {
2881+
line: {
2882+
width: 10
2883+
}
2884+
}
2885+
}],
2886+
layout: {
2887+
width: 400,
2888+
height: 300
2889+
}
2890+
};
2891+
2892+
var tests = [
2893+
[0, '.point path', 'attr', 'd', ['M8,120V120H72V120Z', 'M88,120V6H152V120Z', 'M168,120V52H232V120Z']],
2894+
[300, '.point path', 'attr', 'd', ['M8,120V52H72V120Z', 'M88,120V74H152V120Z', 'M168,120V65H232V120Z']],
2895+
[600, '.point path', 'attr', 'd', ['M8,120V6H72V120Z', 'M88,120V120H152V120Z', 'M168,120V74H232V120Z']]
2896+
];
2897+
var animateOpts = {data: [{y: [5, null, 2]}]};
2898+
2899+
checkTransition(gd, mockCopy, animateOpts, transitionOpts, tests)
2900+
.catch(failTest)
2901+
.then(done);
2902+
});
2903+
2904+
it('blank horizontal bars', function(done) {
2905+
var mockCopy = {
2906+
data: [{
2907+
type: 'bar',
2908+
orientation: 'h',
2909+
y: ['A', 'B', 'C'],
2910+
x: [null, 5, 3],
2911+
marker: {
2912+
line: {
2913+
width: 10
2914+
}
2915+
}
2916+
}],
2917+
layout: {
2918+
width: 400,
2919+
height: 300
2920+
}
2921+
};
2922+
2923+
var tests = [
2924+
[0, '.point path', 'attr', 'd', ['M0,116V84H0V116Z', 'M0,76V44H228V76Z', 'M0,36V4H137V36Z']],
2925+
[300, '.point path', 'attr', 'd', ['M0,116V84H137V116Z', 'M0,76V44H91V76Z', 'M0,36V4H109V36Z']],
2926+
[600, '.point path', 'attr', 'd', ['M0,116V84H228V116Z', 'M0,76V44H0V76Z', 'M0,36V4H91V36Z']]
2927+
];
2928+
var animateOpts = {data: [{x: [5, null, 2]}]};
2929+
2930+
checkTransition(gd, mockCopy, animateOpts, transitionOpts, tests)
2931+
.catch(failTest)
2932+
.then(done);
2933+
});
28732934
});
28742935

28752936
describe('bar uniformtext', function() {

0 commit comments

Comments
 (0)