Skip to content

Commit

Permalink
add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed Jan 1, 2019
1 parent 2eabb16 commit 10c36c2
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/specs/scale.linear.tests.js
Expand Up @@ -1170,4 +1170,29 @@ describe('Linear Scale', function() {
expect(data[0]._model.base + minBarLength).toEqual(data[0]._model.x);
expect(data[1]._model.base - minBarLength).toEqual(data[1]._model.x);
});

it('Should ensure that the scale has a max and min that are not equal when data contains values that are very close to each other', function() {
var chart = window.acquireChart({
type: 'scatter',
data: {
datasets: [{
data: [
{x: 1, y: 1.8548483304974972},
{x: 2, y: 1.8548483304974974},
]
}],
},
options: {
scales: {
yAxes: [{
id: 'yScale0',
type: 'linear',
}]
}
}
});

expect(chart.scales.yScale0).not.toEqual(undefined); // must construct
expect(chart.scales.yScale0.max).toBeGreaterThan(chart.scales.yScale0.min);
});
});

0 comments on commit 10c36c2

Please sign in to comment.