mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Replace ineffective test with a fixture (#7491)
This commit is contained in:
parent
281ee42def
commit
0b3ef9c1a6
@ -44,7 +44,7 @@ function specFromFixture(description, inputs) {
|
||||
loadConfig(input, function(json) {
|
||||
var chart = utils.acquireChart(json.config, json.options);
|
||||
if (!inputs.png) {
|
||||
fail('Missing PNG comparison file for ' + inputs.json);
|
||||
fail('Missing PNG comparison file for ' + input);
|
||||
done();
|
||||
}
|
||||
|
||||
|
18
test/fixtures/scale.linear/tiny-numbers.js
vendored
Normal file
18
test/fixtures/scale.linear/tiny-numbers.js
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
// Should generate max and min that are not equal when data contains values that are very close to each other
|
||||
|
||||
module.exports = {
|
||||
config: {
|
||||
type: 'scatter',
|
||||
data: {
|
||||
datasets: [{
|
||||
data: [
|
||||
{x: 1, y: 1.8548483304974972},
|
||||
{x: 2, y: 1.8548483304974974},
|
||||
]
|
||||
}],
|
||||
},
|
||||
},
|
||||
options: {
|
||||
spriteText: true
|
||||
}
|
||||
};
|
BIN
test/fixtures/scale.linear/tiny-numbers.png
vendored
Normal file
BIN
test/fixtures/scale.linear/tiny-numbers.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
@ -3,6 +3,8 @@ function getLabels(scale) {
|
||||
}
|
||||
|
||||
describe('Linear Scale', function() {
|
||||
describe('auto', jasmine.fixture.specs('scale.linear'));
|
||||
|
||||
it('Should register the constructor with the scale service', function() {
|
||||
var Constructor = Chart.scaleService.getScaleConstructor('linear');
|
||||
expect(Constructor).not.toBe(undefined);
|
||||
@ -1106,30 +1108,6 @@ describe('Linear Scale', function() {
|
||||
expect(chart.scales.x.max).toEqual(0);
|
||||
});
|
||||
|
||||
it('Should generate 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: {
|
||||
y: {
|
||||
type: 'linear',
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
expect(chart.scales.y).not.toEqual(undefined); // must construct
|
||||
expect(chart.scales.y.max).toBeGreaterThan(chart.scales.y.min);
|
||||
});
|
||||
|
||||
it('Should get correct pixel values when horizontal', function() {
|
||||
var chart = window.acquireChart({
|
||||
type: 'horizontalBar',
|
||||
|
Loading…
Reference in New Issue
Block a user