Skip to content

Commit

Permalink
Make bar tests independent from scales
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Aug 22, 2017
1 parent 0e5ce3f commit 9280243
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions test/specs/controller.bar.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1174,11 +1174,17 @@ describe('Bar controller tests', function() {
xAxes: [{
type: 'category',
stacked: true,
barPercentage: 1
barPercentage: 1,
ticks: {
display: false
}
}],
yAxes: [{
type: 'logarithmic',
stacked: true,
ticks: {
display: false
}
}]
}
}
Expand All @@ -1187,10 +1193,10 @@ describe('Bar controller tests', function() {
var meta0 = chart.getDatasetMeta(0);

[
{b: 484, w: 92, x: 94, y: 484},
{b: 484, w: 92, x: 208, y: 136},
{b: 484, w: 92, x: 322, y: 484},
{b: 484, w: 92, x: 436, y: 136}
{b: 502, w: 100, x: 73, y: 502},
{b: 502, w: 100, x: 198, y: 140},
{b: 502, w: 100, x: 324, y: 502},
{b: 502, w: 100, x: 449, y: 140}
].forEach(function(values, i) {
expect(meta0.data[i]._model.base).toBeCloseToPixel(values.b);
expect(meta0.data[i]._model.width).toBeCloseToPixel(values.w);
Expand All @@ -1201,10 +1207,10 @@ describe('Bar controller tests', function() {
var meta1 = chart.getDatasetMeta(1);

[
{b: 484, w: 92, x: 94, y: 122},
{b: 136, w: 92, x: 208, y: 122},
{b: 484, w: 92, x: 322, y: 484},
{b: 136, w: 92, x: 436, y: 32}
{b: 502, w: 100, x: 73, y: 125},
{b: 140, w: 100, x: 198, y: 125},
{b: 502, w: 100, x: 324, y: 502},
{b: 140, w: 100, x: 449, y: 32}
].forEach(function(values, i) {
expect(meta1.data[i]._model.base).toBeCloseToPixel(values.b);
expect(meta1.data[i]._model.width).toBeCloseToPixel(values.w);
Expand Down

0 comments on commit 9280243

Please sign in to comment.