Skip to content

Commit

Permalink
Update scale.linear.tests.js
Browse files Browse the repository at this point in the history
  • Loading branch information
teroman committed May 25, 2018
1 parent 2629677 commit fd7f051
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/specs/scale.linear.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -905,4 +905,33 @@ describe('Linear Scale', function() {
expect(chart.scales['x-axis-0'].min).toEqual(20);
expect(chart.scales['x-axis-0'].max).toEqual(21);
});

it('max setting should be used if it set to zero', function() {
var barData = {
labels: ['S1', 'S2', 'S3'],
datasets: [{
label: 'dataset 1',
backgroundColor: '#382765',
data: [-2500, -2000, -1500],
hidden: true,
}]
};

var chart = window.acquireChart({
type: 'horizontalBar',
data: barData,
options: {
scales: {
xAxes: [{
ticks: {
min: -3000,
max: 0
}
}]
}
}
});

expect(chart.scales['x-axis-0'].max).toEqual(0);
});
});

0 comments on commit fd7f051

Please sign in to comment.