Skip to content

Commit a4c8095

Browse files
committed
add jasmine tests
1 parent 2b26e5a commit a4c8095

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/jasmine/tests/bar_test.js

+27
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,33 @@ describe('Bar.calc', function() {
423423
var cd = gd.calcdata;
424424
assertPointField(cd, 'mlw', [[2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 10]]);
425425
});
426+
427+
it('should translate sizes e.g. 2000 to milliseconds not to year when base is present (vertical case)', function() {
428+
var gd = mockBarPlot([{
429+
type: 'bar',
430+
base: [0],
431+
y: [2000],
432+
x: ['A']
433+
}], {});
434+
435+
var cd = gd.calcdata;
436+
assertPointField(cd, 'b', [[0]]);
437+
assertPointField(cd, 's', [[2000]]);
438+
});
439+
440+
it('should translate sizes e.g. 2000 to milliseconds not to year when base is present (horizontal case)', function() {
441+
var gd = mockBarPlot([{
442+
type: 'bar',
443+
orientation: 'h',
444+
base: [0],
445+
x: [2000],
446+
y: ['A']
447+
}], {});
448+
449+
var cd = gd.calcdata;
450+
assertPointField(cd, 'b', [[0]]);
451+
assertPointField(cd, 's', [[2000]]);
452+
});
426453
});
427454

428455
describe('Bar.crossTraceCalc (formerly known as setPositions)', function() {

0 commit comments

Comments
 (0)