Skip to content

Commit ee98f38

Browse files
authored
Merge pull request #52 from vizzuhq/veghdev
integration test: add option tests
2 parents 4f5119d + be1f5c0 commit ee98f38

40 files changed

+738
-0
lines changed
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+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Chart from "/test/integration/test_options/style/plot/xAxis/label/backgroundColor/chart.js";
2+
import Hexa from "/test/integration/test_options/style/plot/xAxis/label/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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Chart from "/test/integration/test_options/style/plot/xAxis/label/backgroundColor/chart.js";
2+
import Hexa from "/test/integration/test_options/style/plot/xAxis/label/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: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { data } from "/test/integration/test_options/data.js";
2+
3+
4+
export default class Chart {
5+
static static(color) {
6+
return chart => {
7+
console.log("plot xAxis label backgroundColor: " + color);
8+
return chart.animate(
9+
{
10+
data: data,
11+
config : {
12+
channels: {
13+
x: { attach: [ "Foo"] },
14+
y: { attach: [ "Bar"] }
15+
},
16+
title: null,
17+
legend: null,
18+
},
19+
style: {
20+
plot: {
21+
xAxis: {
22+
label: {
23+
backgroundColor: color
24+
}
25+
}
26+
}
27+
}
28+
});
29+
}
30+
}
31+
32+
static animated(color) {
33+
return chart => {
34+
console.log("plot xAxis label backgroundColor: " + color);
35+
return chart.animate(
36+
{
37+
style: {
38+
plot: {
39+
xAxis: {
40+
label: {
41+
backgroundColor: color
42+
}
43+
}
44+
}
45+
}
46+
})
47+
};
48+
}
49+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 color = name.split("-")[0];
11+
let tr = name.split("-")[1];
12+
let type = name.split("-")[2];
13+
let ans = ("#" + colors[color].hex + transparency[tr]).toUpperCase();
14+
if (type === "lowercase") {
15+
ans = ans.toLowerCase();
16+
}
17+
return ans;
18+
}
19+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Chart from "/test/integration/test_options/style/plot/xAxis/label/backgroundColor/chart.js";
2+
import Hexa from "/test/integration/test_options/style/plot/xAxis/label/backgroundColor/static/hexa.js";
3+
4+
5+
const testSteps = [
6+
Chart.static(Hexa.color(new URL(import.meta.url)))
7+
]
8+
9+
10+
export default testSteps
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Chart from "/test/integration/test_options/style/plot/xAxis/label/backgroundColor/chart.js";
2+
import Hexa from "/test/integration/test_options/style/plot/xAxis/label/backgroundColor/static/hexa.js";
3+
4+
5+
const testSteps = [
6+
Chart.static(Hexa.color(new URL(import.meta.url)))
7+
]
8+
9+
10+
export default testSteps
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Chart from "/test/integration/test_options/style/plot/xAxis/label/backgroundColor/chart.js";
2+
import Hexa from "/test/integration/test_options/style/plot/xAxis/label/backgroundColor/static/hexa.js";
3+
4+
5+
const testSteps = [
6+
Chart.static(Hexa.color(new URL(import.meta.url)))
7+
]
8+
9+
10+
export default testSteps
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Chart from "/test/integration/test_options/style/plot/xAxis/label/backgroundColor/chart.js";
2+
import Hexa from "/test/integration/test_options/style/plot/xAxis/label/backgroundColor/static/hexa.js";
3+
4+
5+
const testSteps = [
6+
Chart.static(Hexa.color(new URL(import.meta.url)))
7+
]
8+
9+
10+
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+
}

0 commit comments

Comments
 (0)