expect(scale.max).toBe(1);
});
+ it('Should use the suggestedMin and suggestedMax options', function() {
+ var scaleID = 'myScale';
+
+ var mockData = {
+ datasets: [{
+ yAxisID: scaleID,
+ data: [1, 1, 1, 2, 1, 0]
+ }]
+ };
+
+ var config = Chart.helpers.clone(Chart.scaleService.getScaleDefaults('linear'));
+ config.ticks.suggestedMin = -10;
+ config.ticks.suggestedMax = 10;
+
+ var Constructor = Chart.scaleService.getScaleConstructor('linear');
+ var scale = new Constructor({
+ ctx: {},
+ options: config,
+ data: mockData,
+ id: scaleID
+ });
+
+ // Set arbitrary width and height for now
+ scale.width = 50;
+ scale.height = 400;
+
+ scale.buildTicks();
+ expect(scale.min).toBe(-10);
+ expect(scale.max).toBe(10);
+ });
+
it('should forcibly include 0 in the range if the beginAtZero option is used', function() {
var scaleID = 'myScale';