Convert element.line mock tests to fixtures (#6730)

This commit is contained in:
Jukka Kurkela
2019-11-12 20:59:29 +02:00
committed by Evert Timberg
parent 2354e2ff6b
commit 30cbdc6a4d
31 changed files with 440 additions and 1516 deletions

26
test/fixtures/element.line/default.js vendored Normal file
View File

@@ -0,0 +1,26 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [
{
data: [{x: 1, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
}
]
},
options: {
legend: false,
title: false,
scales: {
xAxes: [{type: 'linear', display: false, ticks: {min: 0, max: 20}}],
yAxes: [{display: false, ticks: {min: -15, max: 15}}]
}
}
},
options: {
canvas: {
height: 256,
width: 512
}
}
};

BIN
test/fixtures/element.line/default.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

29
test/fixtures/element.line/skip/all.js vendored Normal file
View File

@@ -0,0 +1,29 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [
{
data: [{x: 0, y: NaN}, {x: NaN, y: 0}, {x: NaN, y: -10}, {x: 19, y: NaN}],
borderColor: 'red',
fill: true,
lineTension: 0
}
]
},
options: {
legend: false,
title: false,
scales: {
xAxes: [{type: 'linear', display: false, ticks: {min: 0, max: 20}}],
yAxes: [{display: false, ticks: {min: -15, max: 15}}]
}
}
},
options: {
canvas: {
height: 256,
width: 512
}
}
};

BIN
test/fixtures/element.line/skip/all.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -0,0 +1,30 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [
{
data: [{x: NaN, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
borderColor: 'red',
fill: true,
spanGaps: true,
lineTension: 0
}
]
},
options: {
legend: false,
title: false,
scales: {
xAxes: [{type: 'linear', display: false, ticks: {min: 0, max: 20}}],
yAxes: [{display: false, ticks: {min: -15, max: 15}}]
}
}
},
options: {
canvas: {
height: 256,
width: 512
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -0,0 +1,29 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [
{
data: [{x: NaN, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
borderColor: 'red',
fill: true,
lineTension: 0
}
]
},
options: {
legend: false,
title: false,
scales: {
xAxes: [{type: 'linear', display: false, ticks: {min: 0, max: 20}}],
yAxes: [{display: false, ticks: {min: -15, max: 15}}]
}
}
},
options: {
canvas: {
height: 256,
width: 512
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -0,0 +1,30 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [
{
data: [{x: 0, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: NaN, y: -5}],
borderColor: 'red',
fill: true,
spanGaps: true,
lineTension: 0
}
]
},
options: {
legend: false,
title: false,
scales: {
xAxes: [{type: 'linear', display: false, ticks: {min: 0, max: 20}}],
yAxes: [{display: false, ticks: {min: -15, max: 15}}]
}
}
},
options: {
canvas: {
height: 256,
width: 512
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

29
test/fixtures/element.line/skip/last.js vendored Normal file
View File

@@ -0,0 +1,29 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [
{
data: [{x: 0, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: NaN, y: -5}],
borderColor: 'red',
fill: true,
lineTension: 0
}
]
},
options: {
legend: false,
title: false,
scales: {
xAxes: [{type: 'linear', display: false, ticks: {min: 0, max: 20}}],
yAxes: [{display: false, ticks: {min: -15, max: 15}}]
}
}
},
options: {
canvas: {
height: 256,
width: 512
}
}
};

BIN
test/fixtures/element.line/skip/last.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -0,0 +1,30 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [
{
data: [{x: 0, y: 10}, {x: 5, y: 0}, {x: NaN, y: -10}, {x: 19, y: -5}],
borderColor: 'red',
fill: true,
spanGaps: true,
lineTension: 0
}
]
},
options: {
legend: false,
title: false,
scales: {
xAxes: [{type: 'linear', display: false, ticks: {min: 0, max: 20}}],
yAxes: [{display: false, ticks: {min: -15, max: 15}}]
}
}
},
options: {
canvas: {
height: 256,
width: 512
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -0,0 +1,29 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [
{
data: [{x: 0, y: 10}, {x: 5, y: 0}, {x: NaN, y: -10}, {x: 19, y: -5}],
borderColor: 'red',
fill: true,
lineTension: 0
}
]
},
options: {
legend: false,
title: false,
scales: {
xAxes: [{type: 'linear', display: false, ticks: {min: 0, max: 20}}],
yAxes: [{display: false, ticks: {min: -15, max: 15}}]
}
}
},
options: {
canvas: {
height: 256,
width: 512
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -0,0 +1,30 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [
{
data: [{x: 1, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
borderColor: 'red',
fill: false,
lineTension: 0,
steppedLine: 'after'
}
]
},
options: {
legend: false,
title: false,
scales: {
xAxes: [{type: 'linear', display: false, ticks: {min: 0, max: 20}}],
yAxes: [{display: false, ticks: {min: -15, max: 15}}]
}
}
},
options: {
canvas: {
height: 256,
width: 512
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@@ -0,0 +1,30 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [
{
data: [{x: 1, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
borderColor: 'red',
fill: false,
lineTension: 0,
steppedLine: 'before'
}
]
},
options: {
legend: false,
title: false,
scales: {
xAxes: [{type: 'linear', display: false, ticks: {min: 0, max: 20}}],
yAxes: [{display: false, ticks: {min: -15, max: 15}}]
}
}
},
options: {
canvas: {
height: 256,
width: 512
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -0,0 +1,30 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [
{
data: [{x: 1, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
borderColor: 'red',
fill: false,
lineTension: 0,
steppedLine: true
}
]
},
options: {
legend: false,
title: false,
scales: {
xAxes: [{type: 'linear', display: false, ticks: {min: 0, max: 20}}],
yAxes: [{display: false, ticks: {min: -15, max: 15}}]
}
}
},
options: {
canvas: {
height: 256,
width: 512
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -0,0 +1,30 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [
{
data: [{x: 1, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
borderColor: 'red',
fill: false,
lineTension: 0,
steppedLine: 'middle'
}
]
},
options: {
legend: false,
title: false,
scales: {
xAxes: [{type: 'linear', display: false, ticks: {min: 0, max: 20}}],
yAxes: [{display: false, ticks: {min: -15, max: 15}}]
}
}
},
options: {
canvas: {
height: 256,
width: 512
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -0,0 +1,28 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [
{
data: [{x: 1, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
borderColor: 'red',
fill: false
}
]
},
options: {
legend: false,
title: false,
scales: {
xAxes: [{type: 'linear', display: false, ticks: {min: 0, max: 20}}],
yAxes: [{display: false, ticks: {min: -15, max: 15}}]
}
}
},
options: {
canvas: {
height: 256,
width: 512
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@@ -0,0 +1,29 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [
{
data: [{x: 1, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
borderColor: 'red',
fill: false,
lineTension: 1
}
]
},
options: {
legend: false,
title: false,
scales: {
xAxes: [{type: 'linear', display: false, ticks: {min: 0, max: 20}}],
yAxes: [{display: false, ticks: {min: -15, max: 15}}]
}
}
},
options: {
canvas: {
height: 256,
width: 512
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@@ -0,0 +1,29 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [
{
data: [{x: 1, y: 10}, {x: 5, y: 0}, {x: 15, y: -10}, {x: 19, y: -5}],
borderColor: 'red',
fill: false,
lineTension: 0
}
]
},
options: {
legend: false,
title: false,
scales: {
xAxes: [{type: 'linear', display: false, ticks: {min: 0, max: 20}}],
yAxes: [{display: false, ticks: {min: -15, max: 15}}]
}
}
},
options: {
canvas: {
height: 256,
width: 512
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

File diff suppressed because it is too large Load Diff