Skip to content

Commit 35048a2

Browse files
save wip [no ci]
1 parent e4ab676 commit 35048a2

File tree

16 files changed

+1493
-148
lines changed

16 files changed

+1493
-148
lines changed

package-lock.json

Lines changed: 1227 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22
"name": "@geode/opengeodeweb-front",
33
"scripts": {
44
"lint": "eslint --fix --ext .js,.vue --ignore-path .gitignore .",
5-
"test": "vitest",
5+
"tests": "vitest --config ./tests/vitest.config.js",
6+
"tests:unit": "npm run tests --project unit",
7+
"tests:integration": "npm run tests --project integration",
68
"coverage": "vitest run --coverage",
79
"geode_objects": "node scripts/generate_geode_objects.js && prettier ./assets/geode_objects.js --write"
810
},
911
"devDependencies": {
1012
"@nuxt/test-utils": "3.18.0",
1113
"@pinia/testing": "0.1.7",
1214
"@vitejs/plugin-vue": "5.2.3",
15+
"@vitest/coverage-v8": "3.1.2",
1316
"@vue/test-utils": "2.4.6",
17+
"electron": "36.4.0",
1418
"eslint": "9.26.0",
1519
"eslint-plugin-import": "2.31.0",
1620
"eslint-plugin-nuxt": "4.0.0",
@@ -24,6 +28,7 @@
2428
"playwright-core": "1.52.0",
2529
"prettier": "3.3.3",
2630
"resize-observer-polyfill": "1.5.1",
31+
"unplugin-auto-import": "^20.0.0",
2732
"vite": "6.3.5",
2833
"vite-plugin-vuetify": "2.1.1",
2934
"vitest": "3.1.2",
@@ -46,9 +51,11 @@
4651
"@vueuse/components": "13.1.0",
4752
"@vueuse/nuxt": "13.1.0",
4853
"ajv": "8.17.1",
54+
"get-port-please": "^3.2.0",
4955
"is-electron": "2.2.2",
5056
"js-file-download": "0.4.12",
5157
"nuxt": "3.13.2",
58+
"pidtree": "^0.6.0",
5259
"pinia": "2.3.1",
5360
"sass": "1.87.0",
5461
"semver": "7.7.1",
@@ -75,4 +82,4 @@
7582
"publishConfig": {
7683
"access": "public"
7784
}
78-
}
85+
}

stores/viewer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const use_viewer_store = defineStore("viewer", {
6060
this.picking_mode = false
6161
},
6262
async ws_connect() {
63-
if (process.env.NODE_ENV == "test") return
63+
// if (process.env.NODE_ENV == "test") return
6464
if (this.status === Status.CONNECTED) return
6565
return navigator.locks.request("viewer.ws_connect", async (lock) => {
6666
if (this.status === Status.CONNECTED) return
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
OpenGeodeWeb-Viewer
1+
OpenGeodeWeb-Viewer[gpu]

tests/integration/microservices/viewer/requirements.txt

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@ attrs==25.3.0
2222
# via
2323
# aiohttp
2424
# opengeodeweb-viewer
25+
contourpy==1.3.3
26+
# via matplotlib
27+
cycler==0.12.1
28+
# via matplotlib
2529
fastjsonschema==2.21.1
2630
# via opengeodeweb-viewer
31+
fonttools==4.59.0
32+
# via matplotlib
2733
frozenlist==1.7.0
2834
# via
2935
# aiohttp
@@ -33,22 +39,42 @@ idna==3.10
3339
# via
3440
# opengeodeweb-viewer
3541
# yarl
42+
kiwisolver==1.4.8
43+
# via matplotlib
44+
matplotlib==3.10.5
45+
# via vtk
3646
multidict==6.6.3
3747
# via
3848
# aiohttp
3949
# opengeodeweb-viewer
4050
# yarl
41-
opengeodeweb-viewer==1.10.1
51+
numpy==2.3.2
52+
# via
53+
# contourpy
54+
# matplotlib
55+
opengeodeweb-viewer[gpu]==1.10.1
4256
# via -r requirements.in
57+
packaging==25.0
58+
# via matplotlib
59+
pillow==11.3.0
60+
# via matplotlib
4361
propcache==0.3.2
4462
# via
4563
# aiohttp
4664
# opengeodeweb-viewer
4765
# yarl
66+
pyparsing==3.2.3
67+
# via matplotlib
68+
python-dateutil==2.9.0.post0
69+
# via matplotlib
70+
six==1.17.0
71+
# via python-dateutil
4872
typing-extensions==4.14.1
4973
# via
5074
# aiosignal
5175
# opengeodeweb-viewer
76+
vtk==9.3.1
77+
# via opengeodeweb-viewer
5278
websocket-client==1.8.0
5379
# via opengeodeweb-viewer
5480
wslink==1.12.4
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// Global imports
2+
import path from "path"
3+
4+
// Third party imports
5+
import { setActivePinia } from "pinia"
6+
import { createTestingPinia } from "@pinia/testing"
7+
8+
import {
9+
afterEach,
10+
beforeEach,
11+
describe,
12+
expect,
13+
expectTypeOf,
14+
test,
15+
vi,
16+
} from "vitest"
17+
18+
// Local imports
19+
import {
20+
executable_name,
21+
executable_path,
22+
kill_processes,
23+
run_viewer,
24+
} from "@ogw_f/utils/local"
25+
import { useDataStyleStore } from "@ogw_f/stores/data_style"
26+
27+
describe("DataStyle Store", () => {
28+
const pinia = createTestingPinia({
29+
stubActions: false,
30+
createSpy: vi.fn,
31+
})
32+
33+
const dataStyleStore = useDataStyleStore()
34+
beforeEach(async () => {
35+
setActivePinia(pinia)
36+
console.log("__dirname", __dirname)
37+
const viewer_path = path.join(
38+
executable_path(
39+
path.join("tests", "integration", "microservices", "viewer"),
40+
),
41+
executable_name("opengeodeweb_viewer"),
42+
)
43+
await run_viewer(viewer_path, { port: 1234, data_folder_path: "./data" })
44+
})
45+
46+
afterEach(() => {
47+
kill_processes()
48+
})
49+
50+
describe("state", () => {
51+
test("initial state", () => {
52+
expectTypeOf(true).toBeBoolean()
53+
})
54+
})
55+
})

tests/unit/components/CrsSelector.nuxt.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { describe, expect, test } from "vitest"
21
import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
32

43
import { setActivePinia } from "pinia"

tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ const vuetify = createVuetify({
1313
})
1414

1515
describe("FeedBackErrorBanner.vue", async () => {
16-
;(test(`Test reload`, async () => {
16+
test(`Test reload`, async () => {
1717
const wrapper = mount(FeedBackErrorBanner, {
1818
global: {
19-
plugins: [createTestingPinia(), vuetify],
19+
plugins: [
20+
createTestingPinia({
21+
createSpy: vi.fn,
22+
}),
23+
vuetify,
24+
],
2025
},
2126
})
2227
const reload_spy = vi.spyOn(wrapper.vm, "reload")
@@ -38,6 +43,7 @@ describe("FeedBackErrorBanner.vue", async () => {
3843
},
3944
},
4045
stubActions: false,
46+
createSpy: vi.fn,
4147
}),
4248
vuetify,
4349
],
@@ -48,5 +54,5 @@ describe("FeedBackErrorBanner.vue", async () => {
4854
const v_btn = wrapper.findAll(".v-btn")
4955
await v_btn[1].trigger("click")
5056
expect(feedback_store.server_error).toBe(false)
51-
}))
57+
})
5258
})

tests/unit/components/PackagesVersions.nuxt.test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, expect, test } from "vitest"
1+
import { describe, expect, test, vi } from "vitest"
22
import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime"
33

44
import { createVuetify } from "vuetify"
@@ -17,7 +17,9 @@ const vuetify = createVuetify({
1717

1818
describe("PackagesVersions.vue", async () => {
1919
test(`Mount`, async () => {
20-
const pinia = createTestingPinia()
20+
const pinia = createTestingPinia({
21+
createSpy: vi.fn,
22+
})
2123
setActivePinia(pinia)
2224
const geode_store = use_geode_store()
2325
geode_store.base_url = ""

tests/unit/components/Wrapper.nuxt.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// // import { describe, expect, test } from "vitest"
1+
import { describe, expect, test } from "vitest"
22
// import { mountSuspended } from "@nuxt/test-utils/runtime"
33

44
// import { createVuetify } from "vuetify"

0 commit comments

Comments
 (0)