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 Jun 19, 2018
1 parent 998840c commit b880921
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions test/specs/scale.linear.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -906,14 +906,13 @@ describe('Linear Scale', function() {
expect(chart.scales['x-axis-0'].max).toEqual(21);
});

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

Expand All @@ -925,16 +924,41 @@ describe('Linear Scale', function() {
xAxes: [{
ticks: {
min: 0,
max: 0,
stepSize: 0
max: 3000
}
}]
}
}
});

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

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

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);
expect(chart.scales['x-axis-0'].stepSize).toEqual(0);
});
});

0 comments on commit b880921

Please sign in to comment.