Skip to content

Commit ca23287

Browse files
committed
integration test: add option tests
1 parent eed8210 commit ca23287

17 files changed

+249
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { colors } from "/test/integration/test_options/style/colors.js";
2+
3+
4+
export default class Hex {
5+
static color(url) {
6+
let name = url.pathname.split("/").pop().split(".").shift();
7+
let color1 = "#" + colors[name.split("-").shift()].hex;
8+
let color2 = "#" + colors[name.split("-").pop()].hex;
9+
return {color1, color2};
10+
}
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Chart from "/test/integration/test_options/style/plot/backgroundColor/chart.js";
2+
import Hex from "/test/integration/test_options/style/plot/backgroundColor/animated/hex.js";
3+
4+
5+
const testSteps = [
6+
Chart.static(Hex.color(new URL(import.meta.url)).color1),
7+
Chart.animated(Hex.color(new URL(import.meta.url)).color2)
8+
]
9+
10+
11+
export default testSteps
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Chart from "/test/integration/test_options/style/plot/backgroundColor/chart.js";
2+
import Hex from "/test/integration/test_options/style/plot/backgroundColor/animated/hex.js";
3+
4+
5+
const testSteps = [
6+
Chart.static(Hex.color(new URL(import.meta.url)).color1),
7+
Chart.animated(Hex.color(new URL(import.meta.url)).color2)
8+
]
9+
10+
11+
export default testSteps
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Chart from "/test/integration/test_options/style/plot/backgroundColor/chart.js";
2+
import Hex from "/test/integration/test_options/style/plot/backgroundColor/animated/hex.js";
3+
4+
5+
const testSteps = [
6+
Chart.static(Hex.color(new URL(import.meta.url)).color1),
7+
Chart.animated(Hex.color(new URL(import.meta.url)).color2)
8+
]
9+
10+
11+
export default testSteps
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Chart from "/test/integration/test_options/style/plot/backgroundColor/chart.js";
2+
import Hex from "/test/integration/test_options/style/plot/backgroundColor/animated/hex.js";
3+
4+
5+
const testSteps = [
6+
Chart.static(Hex.color(new URL(import.meta.url)).color1),
7+
Chart.animated(Hex.color(new URL(import.meta.url)).color2)
8+
]
9+
10+
11+
export default testSteps
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { colors } from "/test/integration/test_options/style/colors.js";
2+
import { transparency } from "/test/integration/test_options/style/transparency.js";
3+
4+
5+
export default class Hexa {
6+
static color(url) {
7+
let nameParts = url.pathname.split("/").pop().split(".");
8+
nameParts.pop();
9+
let name = nameParts.slice().join(".");
10+
let color1 = name.split("-")[0];
11+
let tr1 = name.split("-")[1];
12+
let color2 = name.split("-")[2];
13+
let tr2 = name.split("-")[3];
14+
color1 = "#" + colors[color1].hex + transparency[tr1];
15+
color2 = "#" + colors[color2].hex + transparency[tr2];
16+
return {color1, color2};
17+
}
18+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Chart from "/test/integration/test_options/style/plot/backgroundColor/chart.js";
2+
import Hexa from "/test/integration/test_options/style/plot/backgroundColor/animated/hexa.js";
3+
4+
5+
const testSteps = [
6+
Chart.static(Hexa.color(new URL(import.meta.url)).color1),
7+
Chart.animated(Hexa.color(new URL(import.meta.url)).color2)
8+
]
9+
10+
11+
export default testSteps
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Chart from "/test/integration/test_options/style/plot/backgroundColor/chart.js";
2+
import Hexa from "/test/integration/test_options/style/plot/backgroundColor/animated/hexa.js";
3+
4+
5+
const testSteps = [
6+
Chart.static(Hexa.color(new URL(import.meta.url)).color1),
7+
Chart.animated(Hexa.color(new URL(import.meta.url)).color2)
8+
]
9+
10+
11+
export default testSteps
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { colors } from "/test/integration/test_options/style/colors.js";
2+
3+
4+
export default class Rgb {
5+
static color(url) {
6+
let name = url.pathname.split("/").pop().split(".").shift();
7+
let color1 = "rgb(" + colors[name.split("-").shift()].rgb + ")";
8+
let color2 = "rgb(" + colors[name.split("-").pop()].rgb + ")";
9+
return {color1, color2};
10+
}
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Chart from "/test/integration/test_options/style/plot/backgroundColor/chart.js";
2+
import Rgb from "/test/integration/test_options/style/plot/backgroundColor/animated/rgb.js";
3+
4+
5+
const testSteps = [
6+
Chart.static(Rgb.color(new URL(import.meta.url)).color1),
7+
Chart.animated(Rgb.color(new URL(import.meta.url)).color2)
8+
]
9+
10+
11+
export default testSteps

0 commit comments

Comments
 (0)