Skip to content

Commit

Permalink
Add app test
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Nov 8, 2024
1 parent b1968f6 commit 78ad05c
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 95 deletions.
79 changes: 34 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@vitest/ui": "^2.1.2",
"@vue/test-utils": "^2.4.6",
"autoprefixer": "^10.4.19",
"axios": "^1.7.2",
"axios": "^1.7.7",
"galaxy-charts-xml-parser": "^1.0.3",
"jsdom": "^25.0.1",
"naive-ui": "^2.39.0",
Expand Down
24 changes: 24 additions & 0 deletions src/App.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { describe, test, expect, mount } from "vitest";
import { mount } from "@vue/test-utils";

import App from "./App.vue";

describe("build user interface", () => {
test("Show error if dataset id and url are missing", async () => {
const wrapper = mount(App);
expect(wrapper.html()).toContain("Visualization requires `dataset_id` or `dataset_url`.");
});

test("Load user interface using incoming prop", async () => {
const incoming = {
visualization_config: {
dataset_url: null,
dataset_id: "MY_DATASET_ID",
},
};
const wrapper = mount(App, { props: { incoming: incoming } });
expect(wrapper.html()).toContain("Please wait...");
await wrapper.vm.$nextTick();
expect(wrapper.html()).toContain('fill="#E30A17"');
});
});
92 changes: 43 additions & 49 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -211,22 +211,22 @@
js-tokens "^4.0.0"
picocolors "^1.0.0"

"@babel/helper-string-parser@^7.24.8":
version "7.24.8"
resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz"
integrity sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==
"@babel/helper-string-parser@^7.25.9":
version "7.25.9"
resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz"
integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==

"@babel/helper-validator-identifier@^7.24.7", "@babel/helper-validator-identifier@^7.25.9":
"@babel/helper-validator-identifier@^7.25.9":
version "7.25.9"
resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz"
integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==

"@babel/parser@^7.24.7", "@babel/parser@^7.25.3":
version "7.25.3"
resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.25.3.tgz"
integrity sha512-iLTJKDbJ4hMvFPgQwwsVoxtHyWpKKPBrxkANrSYewDPaPpT5py5yeVkgPIJ7XYXhndxJpaA3PyALSXQ7u8e/Dw==
version "7.26.2"
resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz"
integrity sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==
dependencies:
"@babel/types" "^7.25.2"
"@babel/types" "^7.26.0"

"@babel/runtime@^7.21.0":
version "7.25.0"
Expand All @@ -235,14 +235,13 @@
dependencies:
regenerator-runtime "^0.14.0"

"@babel/types@^7.25.2":
version "7.25.2"
resolved "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz"
integrity sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==
"@babel/types@^7.26.0":
version "7.26.0"
resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz"
integrity sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==
dependencies:
"@babel/helper-string-parser" "^7.24.8"
"@babel/helper-validator-identifier" "^7.24.7"
to-fast-properties "^2.0.0"
"@babel/helper-string-parser" "^7.25.9"
"@babel/helper-validator-identifier" "^7.25.9"

"@css-render/plugin-bem@^0.15.12":
version "0.15.14"
Expand Down Expand Up @@ -869,7 +868,7 @@ autoprefixer@^10.4.19:
picocolors "^1.0.0"
postcss-value-parser "^4.2.0"

axios@^1, axios@^1.7.2, axios@^1.7.7:
axios@^1, axios@^1.7.7:
version "1.7.7"
resolved "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz"
integrity sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==
Expand Down Expand Up @@ -916,14 +915,14 @@ braces@^3.0.3, braces@~3.0.2:
fill-range "^7.1.1"

browserslist@^4.23.0, "browserslist@>= 4.21.0":
version "4.23.2"
resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.23.2.tgz"
integrity sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==
version "4.24.2"
resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz"
integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==
dependencies:
caniuse-lite "^1.0.30001640"
electron-to-chromium "^1.4.820"
node-releases "^2.0.14"
update-browserslist-db "^1.1.0"
caniuse-lite "^1.0.30001669"
electron-to-chromium "^1.5.41"
node-releases "^2.0.18"
update-browserslist-db "^1.1.1"

cac@^6.7.14:
version "6.7.14"
Expand All @@ -935,10 +934,10 @@ camelcase-css@^2.0.1:
resolved "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz"
integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==

caniuse-lite@^1.0.30001599, caniuse-lite@^1.0.30001640:
version "1.0.30001646"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001646.tgz"
integrity sha512-dRg00gudiBDDTmUhClSdv3hqRfpbOnU28IpI1T6PBTLWa+kOj0681C8uML3PifYfREuBrVjDGhL3adYpBT6spw==
caniuse-lite@^1.0.30001599, caniuse-lite@^1.0.30001669:
version "1.0.30001679"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001679.tgz"
integrity sha512-j2YqID/YwpLnKzCmBOS4tlZdWprXm3ZmQLBH9ZBXFOhoxLA46fwyBvx6toCBWBmnuwUY/qB3kEU6gFx8qgCroA==

chai@^5.1.1:
version "5.1.1"
Expand Down Expand Up @@ -1144,10 +1143,10 @@ editorconfig@^1.0.4:
minimatch "9.0.1"
semver "^7.5.3"

electron-to-chromium@^1.4.820:
version "1.5.4"
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.4.tgz"
integrity sha512-orzA81VqLyIGUEA77YkVA1D+N+nNfl2isJVjjmOyrlxuooZ19ynb+dOlaDTqd/idKRS9lDCSBmtzM+kyCsMnkA==
electron-to-chromium@^1.5.41:
version "1.5.55"
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.55.tgz"
integrity sha512-6maZ2ASDOTBtjt9FhqYPRnbvKU5tjG0IN9SztUOWYw2AzNDNpKJYLJmlK0/En4Hs/aiWnB+JZ+gW19PIGszgKg==

emoji-regex@^8.0.0:
version "8.0.0"
Expand Down Expand Up @@ -1193,10 +1192,10 @@ esbuild@^0.21.3:
"@esbuild/win32-ia32" "0.21.5"
"@esbuild/win32-x64" "0.21.5"

escalade@^3.1.2:
version "3.1.2"
resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz"
integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==
escalade@^3.2.0:
version "3.2.0"
resolved "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz"
integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==

estree-walker@^2.0.2:
version "2.0.2"
Expand Down Expand Up @@ -1706,7 +1705,7 @@ nanoid@^3.3.7:
resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz"
integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==

node-releases@^2.0.14:
node-releases@^2.0.18:
version "2.0.18"
resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz"
integrity sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==
Expand Down Expand Up @@ -1800,7 +1799,7 @@ perfect-debounce@^1.0.0:
resolved "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-1.0.0.tgz"
integrity sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==

picocolors@^1.0.0, picocolors@^1.0.1, picocolors@^1.1.0:
picocolors@^1.0.0, picocolors@^1.1.0:
version "1.1.0"
resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz"
integrity sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==
Expand Down Expand Up @@ -2251,11 +2250,6 @@ tldts@^6.1.32:
dependencies:
tldts-core "^6.1.57"

to-fast-properties@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz"
integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==

to-regex-range@^5.0.1:
version "5.0.1"
resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz"
Expand Down Expand Up @@ -2312,13 +2306,13 @@ universalify@^2.0.0:
resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz"
integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==

update-browserslist-db@^1.1.0:
version "1.1.0"
resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz"
integrity sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==
update-browserslist-db@^1.1.1:
version "1.1.1"
resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz"
integrity sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==
dependencies:
escalade "^3.1.2"
picocolors "^1.0.1"
escalade "^3.2.0"
picocolors "^1.1.0"

util-deprecate@^1.0.2:
version "1.0.2"
Expand Down

0 comments on commit 78ad05c

Please sign in to comment.