@geode/opengeodeweb-front 10.0.2-rc.3 → 10.0.2-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/deploy.yml +4 -0
- package/app/components/CrsSelector.vue +1 -0
- package/app/components/ExtensionSelector.vue +2 -1
- package/app/components/FeedBack/ErrorBanner.vue +4 -3
- package/app/components/FeedBack/Snackers.vue +5 -3
- package/app/components/FileSelector.vue +3 -2
- package/app/components/FileUploader.vue +1 -1
- package/app/components/HybridRenderingView.vue +4 -1
- package/app/components/InfraConnected.vue +2 -0
- package/app/components/Inspector/InspectionButton.vue +1 -0
- package/app/components/Inspector/ResultPanel.vue +1 -1
- package/app/components/Launcher.vue +9 -8
- package/app/components/Loading.vue +1 -1
- package/app/components/MissingFilesSelector.vue +3 -2
- package/app/components/ObjectSelector.vue +8 -5
- package/app/components/PackagesVersions.vue +2 -1
- package/app/components/Recaptcha.vue +6 -5
- package/app/components/RemoteRenderingView.vue +3 -3
- package/app/components/Screenshot.vue +2 -0
- package/app/components/Stepper.vue +1 -1
- package/app/components/VeaseViewToolbar.vue +6 -3
- package/app/components/ViewToolbar.vue +3 -2
- package/app/components/Viewer/BreadCrumb.vue +1 -0
- package/app/components/Viewer/ContextMenu.vue +2 -0
- package/app/components/Viewer/EdgedCurve/EdgesOptions.vue +1 -1
- package/app/components/Viewer/EdgedCurve/PointsOptions.vue +1 -1
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +6 -3
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +9 -6
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +6 -3
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +6 -3
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +6 -3
- package/app/components/Viewer/Generic/Model/EdgesOptions.vue +8 -4
- package/app/components/Viewer/Generic/Model/PointsOptions.vue +5 -2
- package/app/components/Viewer/Grid/2D/CellsOptions.vue +1 -1
- package/app/components/Viewer/Grid/2D/EdgesOptions.vue +1 -1
- package/app/components/Viewer/Grid/2D/PointsOptions.vue +1 -1
- package/app/components/Viewer/Grid/3D/CellsOptions.vue +1 -1
- package/app/components/Viewer/Grid/3D/EdgesOptions.vue +1 -1
- package/app/components/Viewer/Grid/3D/FacetsOptions.vue +1 -1
- package/app/components/Viewer/Grid/3D/PointsOptions.vue +1 -1
- package/app/components/Viewer/HybridSolid/EdgesOptions.vue +1 -1
- package/app/components/Viewer/HybridSolid/PointsOptions.vue +1 -1
- package/app/components/Viewer/HybridSolid/PolygonsOptions.vue +1 -1
- package/app/components/Viewer/HybridSolid/PolyhedraOptions.vue +1 -1
- package/app/components/Viewer/Options/CellAttributeSelector.vue +1 -0
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +7 -7
- package/app/components/Viewer/Options/PolygonAttributeSelector.vue +1 -0
- package/app/components/Viewer/Options/PolyhedronAttributeSelector.vue +1 -0
- package/app/components/Viewer/Options/TextureItem.vue +2 -1
- package/app/components/Viewer/Options/TexturesSelector.vue +1 -1
- package/app/components/Viewer/PointSet/PointsOptions.vue +1 -1
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +7 -3
- package/app/components/Viewer/PolygonalSurface/EdgesOptions.vue +1 -1
- package/app/components/Viewer/PolygonalSurface/PointsOptions.vue +1 -1
- package/app/components/Viewer/PolygonalSurface/PolygonsOptions.vue +1 -1
- package/app/components/Viewer/Solid/EdgesOptions.vue +1 -1
- package/app/components/Viewer/Solid/PointsOptions.vue +1 -1
- package/app/components/Viewer/Solid/PolygonsOptions.vue +1 -1
- package/app/components/Viewer/Solid/PolyhedraOptions.vue +1 -1
- package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +1 -1
- package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +1 -1
- package/app/components/Viewer/Tree/ObjectTree.vue +5 -3
- package/app/components/Viewer/TreeComponent.vue +4 -0
- package/app/components/Viewer/TreeObject.vue +6 -0
- package/app/components/Viewer/TriangulatedSurface/EdgesOptions.vue +1 -1
- package/app/components/Viewer/TriangulatedSurface/PointsOptions.vue +1 -1
- package/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue +1 -1
- package/app/components/Wrapper.vue +7 -5
- package/app/composables/project_manager.js +9 -3
- package/app/composables/run_function_when_microservices_connected.js +5 -2
- package/app/plugins/auto_store_register.js +9 -1
- package/app/stores/data_base.js +4 -1
- package/app/stores/data_style.js +5 -5
- package/app/stores/geode.js +14 -12
- package/app/stores/hybrid_viewer.js +3 -2
- package/app/stores/infra.js +4 -2
- package/app/stores/lambda.js +2 -1
- package/app/stores/menu.js +24 -24
- package/app/stores/viewer.js +9 -8
- package/app/utils/file_import_workflow.js +5 -1
- package/app/utils/upload_file.js +6 -3
- package/internal/stores/mesh/cells.js +4 -5
- package/internal/stores/mesh/edges.js +5 -3
- package/internal/stores/mesh/index.js +9 -6
- package/internal/stores/mesh/points.js +5 -4
- package/internal/stores/mesh/polygons.js +5 -5
- package/internal/stores/mesh/polyhedra.js +5 -2
- package/internal/stores/model/blocks.js +6 -2
- package/internal/stores/model/corners.js +6 -2
- package/internal/stores/model/edges.js +5 -1
- package/internal/stores/model/index.js +11 -8
- package/internal/stores/model/lines.js +6 -2
- package/internal/stores/model/points.js +5 -2
- package/internal/stores/model/surfaces.js +6 -2
- package/internal/utils/api_fetch.js +2 -1
- package/internal/utils/viewer_call.js +5 -4
- package/nuxt.config.js +1 -3
- package/package.json +6 -7
- package/scripts/generate_geode_objects.js +1 -1
- package/tests/integration/microservices/back/requirements.txt +1 -1
- package/tests/integration/microservices/viewer/requirements.txt +1 -1
- package/tests/integration/setup.js +1 -1
- package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +3 -1
- package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +3 -1
- package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +3 -1
- package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +3 -1
- package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +3 -1
- package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +3 -1
- package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +4 -1
- package/tests/integration/stores/data_style/model/corners.nuxt.test.js +4 -1
- package/tests/integration/stores/data_style/model/edges.nuxt.test.js +3 -1
- package/tests/integration/stores/data_style/model/index.nuxt.test.js +3 -1
- package/tests/integration/stores/data_style/model/lines.nuxt.test.js +4 -1
- package/tests/integration/stores/data_style/model/points.nuxt.test.js +2 -1
- package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +4 -1
- package/tests/unit/components/CrsSelector.nuxt.test.js +4 -2
- package/tests/unit/components/ExtensionSelector.nuxt.test.js +4 -2
- package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +9 -8
- package/tests/unit/components/FeedBack/Snackers.nuxt.test.js +6 -5
- package/tests/unit/components/FileSelector.nuxt.test.js +6 -7
- package/tests/unit/components/FileUploader.nuxt.test.js +4 -3
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +3 -2
- package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +5 -4
- package/tests/unit/components/Launcher.nuxt.test.js +7 -5
- package/tests/unit/components/MissingFilesSelector.nuxt.test.js +5 -4
- package/tests/unit/components/ObjectSelector.nuxt.test.js +16 -7
- package/tests/unit/components/PackagesVersions.nuxt.test.js +3 -2
- package/tests/unit/components/Step.nuxt.test.js +3 -3
- package/tests/unit/components/Stepper.nuxt.test.js +3 -3
- package/tests/unit/components/Wrapper.nuxt.test.js +3 -3
- package/tests/unit/composables/ProjectManager.nuxt.test.js +15 -17
- package/tests/unit/composables/api_fetch.nuxt.test.js +5 -2
- package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +11 -1
- package/tests/unit/composables/upload_file.nuxt.test.js +6 -3
- package/tests/unit/plugins/project_load.nuxt.test.js +8 -2
- package/tests/unit/stores/App.nuxt.test.js +34 -32
- package/tests/unit/stores/Feedback.nuxt.test.js +25 -25
- package/tests/unit/stores/Geode.nuxt.test.js +27 -25
- package/tests/unit/stores/Infra.nuxt.test.js +73 -70
- package/tests/unit/stores/Lambda.nuxt.test.js +5 -3
- package/tests/unit/stores/Viewer.nuxt.test.js +27 -27
- package/tests/unit/utils/recaptcha.nuxt.test.js +2 -2
- package/tests/unit/utils/validate_schema.nuxt.test.js +2 -2
- package/tests/vitest.config.js +0 -1
|
@@ -14,70 +14,70 @@ beforeEach(async () => {
|
|
|
14
14
|
describe("Feedback Store", () => {
|
|
15
15
|
describe("state", () => {
|
|
16
16
|
test("initial state", () => {
|
|
17
|
-
const
|
|
18
|
-
expectTypeOf(
|
|
19
|
-
expectTypeOf(
|
|
17
|
+
const feedbackStore = useFeedbackStore()
|
|
18
|
+
expectTypeOf(feedbackStore.feedbacks).toEqualTypeOf([])
|
|
19
|
+
expectTypeOf(feedbackStore.server_error).toBeBoolean()
|
|
20
20
|
})
|
|
21
21
|
})
|
|
22
22
|
describe("actions", () => {
|
|
23
23
|
describe("add_error", () => {
|
|
24
24
|
test("test add_error", () => {
|
|
25
|
-
const
|
|
26
|
-
|
|
25
|
+
const feedbackStore = useFeedbackStore()
|
|
26
|
+
feedbackStore.add_error(
|
|
27
27
|
500,
|
|
28
28
|
"/test",
|
|
29
29
|
"test message",
|
|
30
30
|
"test description",
|
|
31
31
|
)
|
|
32
|
-
expect(
|
|
33
|
-
expect(
|
|
32
|
+
expect(feedbackStore.feedbacks.length).toBe(1)
|
|
33
|
+
expect(feedbackStore.feedbacks[0].type).toBe("error")
|
|
34
34
|
})
|
|
35
35
|
})
|
|
36
36
|
|
|
37
37
|
describe("add_error", () => {
|
|
38
38
|
test("test feedbacks_timeout", () => {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const feedbackStore = useFeedbackStore()
|
|
40
|
+
feedbackStore.feedbacks_timeout_miliseconds = 500
|
|
41
|
+
feedbackStore.add_error(
|
|
42
42
|
500,
|
|
43
43
|
"/test",
|
|
44
44
|
"test message",
|
|
45
45
|
"test description",
|
|
46
46
|
)
|
|
47
|
-
expect(
|
|
47
|
+
expect(feedbackStore.feedbacks.length).toBe(1)
|
|
48
48
|
setTimeout(() => {
|
|
49
|
-
expect(
|
|
49
|
+
expect(feedbackStore.feedbacks.length).toBe(0)
|
|
50
50
|
}, 1000)
|
|
51
51
|
})
|
|
52
52
|
})
|
|
53
53
|
|
|
54
54
|
describe("add_success", () => {
|
|
55
55
|
test("test add_success", () => {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
expect(
|
|
60
|
-
expect(
|
|
56
|
+
const feedbackStore = useFeedbackStore()
|
|
57
|
+
feedbackStore.feedbacks_timeout_miliseconds = 500
|
|
58
|
+
feedbackStore.add_success("test description")
|
|
59
|
+
expect(feedbackStore.feedbacks.length).toBe(1)
|
|
60
|
+
expect(feedbackStore.feedbacks[0].type).toBe("success")
|
|
61
61
|
|
|
62
62
|
setTimeout(() => {
|
|
63
|
-
expect(
|
|
63
|
+
expect(feedbackStore.feedbacks.length).toBe(0)
|
|
64
64
|
}, 1000)
|
|
65
65
|
})
|
|
66
66
|
})
|
|
67
67
|
describe("delete_feedback", () => {
|
|
68
68
|
test("test", () => {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
expect(
|
|
69
|
+
const feedbackStore = useFeedbackStore()
|
|
70
|
+
feedbackStore.delete_feedback(0)
|
|
71
|
+
expect(feedbackStore.feedbacks.length).toBe(0)
|
|
72
72
|
})
|
|
73
73
|
})
|
|
74
74
|
|
|
75
75
|
describe("delete_server_error", () => {
|
|
76
76
|
test("test", () => {
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
expect(
|
|
77
|
+
const feedbackStore = useFeedbackStore()
|
|
78
|
+
feedbackStore.$patch({ server_error: true })
|
|
79
|
+
feedbackStore.delete_server_error()
|
|
80
|
+
expect(feedbackStore.server_error).toBe(false)
|
|
81
81
|
})
|
|
82
82
|
})
|
|
83
83
|
})
|
|
@@ -5,6 +5,8 @@ import { registerEndpoint } from "@nuxt/test-utils/runtime"
|
|
|
5
5
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
6
6
|
import Status from "@ogw_front/utils/status"
|
|
7
7
|
import { appMode } from "@ogw_front/utils/app_mode"
|
|
8
|
+
import { useInfraStore } from "@ogw_front/stores/infra"
|
|
9
|
+
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
8
10
|
|
|
9
11
|
beforeEach(async () => {
|
|
10
12
|
const pinia = createTestingPinia({
|
|
@@ -27,49 +29,49 @@ describe("Geode store", () => {
|
|
|
27
29
|
describe("getters", () => {
|
|
28
30
|
describe("protocol", () => {
|
|
29
31
|
test("test app_mode CLOUD", () => {
|
|
30
|
-
const
|
|
32
|
+
const infraStore = useInfraStore()
|
|
31
33
|
const geodeStore = useGeodeStore()
|
|
32
|
-
|
|
34
|
+
infraStore.app_mode = appMode.CLOUD
|
|
33
35
|
expect(geodeStore.protocol).toBe("https")
|
|
34
36
|
})
|
|
35
37
|
test("test app_mode BROWSER", () => {
|
|
36
|
-
const
|
|
38
|
+
const infraStore = useInfraStore()
|
|
37
39
|
const geodeStore = useGeodeStore()
|
|
38
|
-
|
|
40
|
+
infraStore.app_mode = appMode.BROWSER
|
|
39
41
|
expect(geodeStore.protocol).toBe("http")
|
|
40
42
|
})
|
|
41
43
|
test("test app_mode DESKTOP", () => {
|
|
42
|
-
const
|
|
44
|
+
const infraStore = useInfraStore()
|
|
43
45
|
const geodeStore = useGeodeStore()
|
|
44
|
-
|
|
46
|
+
infraStore.app_mode = appMode.DESKTOP
|
|
45
47
|
expect(geodeStore.protocol).toBe("http")
|
|
46
48
|
})
|
|
47
49
|
})
|
|
48
50
|
|
|
49
51
|
describe("port", () => {
|
|
50
52
|
test("test app_mode CLOUD", () => {
|
|
51
|
-
const
|
|
53
|
+
const infraStore = useInfraStore()
|
|
52
54
|
const geodeStore = useGeodeStore()
|
|
53
|
-
|
|
55
|
+
infraStore.app_mode = appMode.CLOUD
|
|
54
56
|
expect(geodeStore.port).toBe("443")
|
|
55
57
|
})
|
|
56
58
|
test("test app_mode BROWSER", () => {
|
|
57
|
-
const
|
|
59
|
+
const infraStore = useInfraStore()
|
|
58
60
|
const geodeStore = useGeodeStore()
|
|
59
|
-
|
|
61
|
+
infraStore.app_mode = appMode.BROWSER
|
|
60
62
|
expect(geodeStore.port).toBe(geodeStore.default_local_port)
|
|
61
63
|
})
|
|
62
64
|
test("test app_mode DESKTOP", () => {
|
|
63
|
-
const
|
|
65
|
+
const infraStore = useInfraStore()
|
|
64
66
|
const geodeStore = useGeodeStore()
|
|
65
|
-
|
|
67
|
+
infraStore.app_mode = appMode.DESKTOP
|
|
66
68
|
expect(geodeStore.port).toBe(geodeStore.default_local_port)
|
|
67
69
|
})
|
|
68
70
|
|
|
69
71
|
test("test override default_local_port", () => {
|
|
70
|
-
const
|
|
72
|
+
const infraStore = useInfraStore()
|
|
71
73
|
const geodeStore = useGeodeStore()
|
|
72
|
-
|
|
74
|
+
infraStore.app_mode = appMode.DESKTOP
|
|
73
75
|
geodeStore.default_local_port = "12"
|
|
74
76
|
expect(geodeStore.port).toBe("12")
|
|
75
77
|
})
|
|
@@ -77,26 +79,26 @@ describe("Geode store", () => {
|
|
|
77
79
|
|
|
78
80
|
describe("base_url", () => {
|
|
79
81
|
test("test app_mode BROWSER", () => {
|
|
80
|
-
const
|
|
82
|
+
const infraStore = useInfraStore()
|
|
81
83
|
const geodeStore = useGeodeStore()
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
infraStore.app_mode = appMode.BROWSER
|
|
85
|
+
infraStore.domain_name = "localhost"
|
|
84
86
|
expect(geodeStore.base_url).toBe("http://localhost:5000")
|
|
85
87
|
})
|
|
86
88
|
test("test app_mode CLOUD", () => {
|
|
87
|
-
const
|
|
89
|
+
const infraStore = useInfraStore()
|
|
88
90
|
const geodeStore = useGeodeStore()
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
infraStore.app_mode = appMode.CLOUD
|
|
92
|
+
infraStore.ID = "123456"
|
|
93
|
+
infraStore.domain_name = "example.com"
|
|
92
94
|
expect(geodeStore.base_url).toBe("https://example.com:443/123456/geode")
|
|
93
95
|
})
|
|
94
96
|
test("test app_mode CLOUD, ID empty", () => {
|
|
95
|
-
const
|
|
97
|
+
const infraStore = useInfraStore()
|
|
96
98
|
const geodeStore = useGeodeStore()
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
infraStore.app_mode = appMode.CLOUD
|
|
100
|
+
infraStore.ID = ""
|
|
101
|
+
infraStore.domain_name = "example.com"
|
|
100
102
|
expect(() => geodeStore.base_url).toThrowError(
|
|
101
103
|
"ID must not be empty in cloud mode",
|
|
102
104
|
)
|
|
@@ -6,8 +6,12 @@ import { setActivePinia } from "pinia"
|
|
|
6
6
|
import { createTestingPinia } from "@pinia/testing"
|
|
7
7
|
import { beforeEach, describe, expect, expectTypeOf, test, vi } from "vitest"
|
|
8
8
|
// Local imports
|
|
9
|
-
import Status from "@ogw_front/utils/status
|
|
9
|
+
import Status from "@ogw_front/utils/status"
|
|
10
10
|
import { appMode } from "@ogw_front/utils/app_mode"
|
|
11
|
+
import { useInfraStore } from "@ogw_front/stores/infra"
|
|
12
|
+
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
13
|
+
import { useViewerStore } from "@ogw_front/stores/viewer"
|
|
14
|
+
import { useLambdaStore } from "@ogw_front/stores/lambda"
|
|
11
15
|
|
|
12
16
|
// Mock navigator.locks API
|
|
13
17
|
const mockLockRequest = vi.fn().mockImplementation(async (name, callback) => {
|
|
@@ -32,54 +36,54 @@ beforeEach(async () => {
|
|
|
32
36
|
describe("Infra Store", () => {
|
|
33
37
|
describe("state", () => {
|
|
34
38
|
test("initial state", () => {
|
|
35
|
-
const
|
|
36
|
-
expectTypeOf(
|
|
37
|
-
expectTypeOf(
|
|
38
|
-
expectTypeOf(
|
|
39
|
+
const infraStore = useInfraStore()
|
|
40
|
+
expectTypeOf(infraStore.ID).toBeString()
|
|
41
|
+
expectTypeOf(infraStore.is_captcha_validated).toBeBoolean()
|
|
42
|
+
expectTypeOf(infraStore.status).toBeString()
|
|
39
43
|
})
|
|
40
44
|
})
|
|
41
45
|
describe("getters", () => {
|
|
42
46
|
describe("app_mode", () => {
|
|
43
47
|
test("test type", () => {
|
|
44
|
-
const
|
|
45
|
-
expectTypeOf(
|
|
48
|
+
const infraStore = useInfraStore()
|
|
49
|
+
expectTypeOf(infraStore.app_mode).toBeString()
|
|
46
50
|
})
|
|
47
51
|
})
|
|
48
52
|
|
|
49
53
|
describe("domain_name", () => {
|
|
50
54
|
test("test app_mode BROWSER", () => {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
expect(
|
|
55
|
+
const infraStore = useInfraStore()
|
|
56
|
+
infraStore.app_mode = appMode.BROWSER
|
|
57
|
+
expect(infraStore.domain_name).toBe("localhost")
|
|
54
58
|
})
|
|
55
59
|
test("test app_mode DESKTOP", () => {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
expect(
|
|
60
|
+
const infraStore = useInfraStore()
|
|
61
|
+
infraStore.app_mode = appMode.DESKTOP
|
|
62
|
+
expect(infraStore.domain_name).toBe("localhost")
|
|
59
63
|
})
|
|
60
64
|
test("test app_mode CLOUD", () => {
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
expect(
|
|
65
|
+
const infraStore = useInfraStore()
|
|
66
|
+
infraStore.app_mode = appMode.CLOUD
|
|
67
|
+
expect(infraStore.domain_name).toBe("api.geode-solutions.com")
|
|
64
68
|
})
|
|
65
69
|
})
|
|
66
70
|
|
|
67
71
|
describe("microservices_connected", () => {
|
|
68
72
|
test("test no microservices registered", () => {
|
|
69
|
-
const
|
|
70
|
-
expect(
|
|
73
|
+
const infraStore = useInfraStore()
|
|
74
|
+
expect(infraStore.microservices_connected).toBe(true)
|
|
71
75
|
})
|
|
72
76
|
test("test geode false & viewer false", () => {
|
|
73
|
-
const
|
|
77
|
+
const infraStore = useInfraStore()
|
|
74
78
|
const geodeStore = useGeodeStore()
|
|
75
79
|
const viewerStore = useViewerStore()
|
|
76
80
|
|
|
77
|
-
|
|
81
|
+
infraStore.register_microservice(geodeStore, {
|
|
78
82
|
request: vi.fn(),
|
|
79
83
|
connect: vi.fn(),
|
|
80
84
|
launch: vi.fn(),
|
|
81
85
|
})
|
|
82
|
-
|
|
86
|
+
infraStore.register_microservice(viewerStore, {
|
|
83
87
|
request: vi.fn(),
|
|
84
88
|
connect: vi.fn(),
|
|
85
89
|
launch: vi.fn(),
|
|
@@ -87,19 +91,19 @@ describe("Infra Store", () => {
|
|
|
87
91
|
|
|
88
92
|
geodeStore.$patch({ status: Status.NOT_CONNECTED })
|
|
89
93
|
viewerStore.$patch({ status: Status.NOT_CONNECTED })
|
|
90
|
-
expect(
|
|
94
|
+
expect(infraStore.microservices_connected).toBe(false)
|
|
91
95
|
})
|
|
92
96
|
test("test geode true & viewer false", () => {
|
|
93
|
-
const
|
|
97
|
+
const infraStore = useInfraStore()
|
|
94
98
|
const geodeStore = useGeodeStore()
|
|
95
99
|
const viewerStore = useViewerStore()
|
|
96
100
|
|
|
97
|
-
|
|
101
|
+
infraStore.register_microservice(geodeStore, {
|
|
98
102
|
request: vi.fn(),
|
|
99
103
|
connect: vi.fn(),
|
|
100
104
|
launch: vi.fn(),
|
|
101
105
|
})
|
|
102
|
-
|
|
106
|
+
infraStore.register_microservice(viewerStore, {
|
|
103
107
|
request: vi.fn(),
|
|
104
108
|
connect: vi.fn(),
|
|
105
109
|
launch: vi.fn(),
|
|
@@ -107,19 +111,19 @@ describe("Infra Store", () => {
|
|
|
107
111
|
|
|
108
112
|
geodeStore.$patch({ status: Status.CONNECTED })
|
|
109
113
|
viewerStore.$patch({ status: Status.NOT_CONNECTED })
|
|
110
|
-
expect(
|
|
114
|
+
expect(infraStore.microservices_connected).toBe(false)
|
|
111
115
|
})
|
|
112
116
|
test("test geode false & viewer true", () => {
|
|
113
|
-
const
|
|
117
|
+
const infraStore = useInfraStore()
|
|
114
118
|
const geodeStore = useGeodeStore()
|
|
115
119
|
const viewerStore = useViewerStore()
|
|
116
120
|
|
|
117
|
-
|
|
121
|
+
infraStore.register_microservice(geodeStore, {
|
|
118
122
|
request: vi.fn(),
|
|
119
123
|
connect: vi.fn(),
|
|
120
124
|
launch: vi.fn(),
|
|
121
125
|
})
|
|
122
|
-
|
|
126
|
+
infraStore.register_microservice(viewerStore, {
|
|
123
127
|
request: vi.fn(),
|
|
124
128
|
connect: vi.fn(),
|
|
125
129
|
launch: vi.fn(),
|
|
@@ -127,19 +131,19 @@ describe("Infra Store", () => {
|
|
|
127
131
|
|
|
128
132
|
geodeStore.$patch({ status: Status.NOT_CONNECTED })
|
|
129
133
|
viewerStore.$patch({ status: Status.CONNECTED })
|
|
130
|
-
expect(
|
|
134
|
+
expect(infraStore.microservices_connected).toBe(false)
|
|
131
135
|
})
|
|
132
136
|
test("test geode true & viewer true", () => {
|
|
133
|
-
const
|
|
137
|
+
const infraStore = useInfraStore()
|
|
134
138
|
const geodeStore = useGeodeStore()
|
|
135
139
|
const viewerStore = useViewerStore()
|
|
136
140
|
|
|
137
|
-
|
|
141
|
+
infraStore.register_microservice(geodeStore, {
|
|
138
142
|
request: vi.fn(),
|
|
139
143
|
connect: vi.fn(),
|
|
140
144
|
launch: vi.fn(),
|
|
141
145
|
})
|
|
142
|
-
|
|
146
|
+
infraStore.register_microservice(viewerStore, {
|
|
143
147
|
request: vi.fn(),
|
|
144
148
|
connect: vi.fn(),
|
|
145
149
|
launch: vi.fn(),
|
|
@@ -147,26 +151,26 @@ describe("Infra Store", () => {
|
|
|
147
151
|
|
|
148
152
|
geodeStore.$patch({ status: Status.CONNECTED })
|
|
149
153
|
viewerStore.$patch({ status: Status.CONNECTED })
|
|
150
|
-
expect(
|
|
154
|
+
expect(infraStore.microservices_connected).toBe(true)
|
|
151
155
|
})
|
|
152
156
|
})
|
|
153
157
|
|
|
154
158
|
describe("microservices_busy", () => {
|
|
155
159
|
test("test no microservices registered", () => {
|
|
156
|
-
const
|
|
157
|
-
expect(
|
|
160
|
+
const infraStore = useInfraStore()
|
|
161
|
+
expect(infraStore.microservices_busy).toBe(false)
|
|
158
162
|
})
|
|
159
163
|
test("test geode false & viewer false", () => {
|
|
160
|
-
const
|
|
164
|
+
const infraStore = useInfraStore()
|
|
161
165
|
const geodeStore = useGeodeStore()
|
|
162
166
|
const viewerStore = useViewerStore()
|
|
163
167
|
|
|
164
|
-
|
|
168
|
+
infraStore.register_microservice(geodeStore, {
|
|
165
169
|
request: vi.fn(),
|
|
166
170
|
connect: vi.fn(),
|
|
167
171
|
launch: vi.fn(),
|
|
168
172
|
})
|
|
169
|
-
|
|
173
|
+
infraStore.register_microservice(viewerStore, {
|
|
170
174
|
request: vi.fn(),
|
|
171
175
|
connect: vi.fn(),
|
|
172
176
|
launch: vi.fn(),
|
|
@@ -174,19 +178,19 @@ describe("Infra Store", () => {
|
|
|
174
178
|
|
|
175
179
|
geodeStore.$patch({ request_counter: 0 })
|
|
176
180
|
viewerStore.$patch({ request_counter: 0 })
|
|
177
|
-
expect(
|
|
181
|
+
expect(infraStore.microservices_busy).toBe(false)
|
|
178
182
|
})
|
|
179
183
|
test("test geode true & viewer false", () => {
|
|
180
|
-
const
|
|
184
|
+
const infraStore = useInfraStore()
|
|
181
185
|
const geodeStore = useGeodeStore()
|
|
182
186
|
const viewerStore = useViewerStore()
|
|
183
187
|
|
|
184
|
-
|
|
188
|
+
infraStore.register_microservice(geodeStore, {
|
|
185
189
|
request: vi.fn(),
|
|
186
190
|
connect: vi.fn(),
|
|
187
191
|
launch: vi.fn(),
|
|
188
192
|
})
|
|
189
|
-
|
|
193
|
+
infraStore.register_microservice(viewerStore, {
|
|
190
194
|
request: vi.fn(),
|
|
191
195
|
connect: vi.fn(),
|
|
192
196
|
launch: vi.fn(),
|
|
@@ -194,19 +198,19 @@ describe("Infra Store", () => {
|
|
|
194
198
|
|
|
195
199
|
geodeStore.$patch({ request_counter: 1 })
|
|
196
200
|
viewerStore.$patch({ request_counter: 0 })
|
|
197
|
-
expect(
|
|
201
|
+
expect(infraStore.microservices_busy).toBe(true)
|
|
198
202
|
})
|
|
199
203
|
test("test geode false & viewer true", () => {
|
|
200
|
-
const
|
|
204
|
+
const infraStore = useInfraStore()
|
|
201
205
|
const geodeStore = useGeodeStore()
|
|
202
206
|
const viewerStore = useViewerStore()
|
|
203
207
|
|
|
204
|
-
|
|
208
|
+
infraStore.register_microservice(geodeStore, {
|
|
205
209
|
request: vi.fn(),
|
|
206
210
|
connect: vi.fn(),
|
|
207
211
|
launch: vi.fn(),
|
|
208
212
|
})
|
|
209
|
-
|
|
213
|
+
infraStore.register_microservice(viewerStore, {
|
|
210
214
|
request: vi.fn(),
|
|
211
215
|
connect: vi.fn(),
|
|
212
216
|
launch: vi.fn(),
|
|
@@ -214,19 +218,19 @@ describe("Infra Store", () => {
|
|
|
214
218
|
|
|
215
219
|
geodeStore.$patch({ request_counter: 0 })
|
|
216
220
|
viewerStore.$patch({ request_counter: 1 })
|
|
217
|
-
expect(
|
|
221
|
+
expect(infraStore.microservices_busy).toBe(true)
|
|
218
222
|
})
|
|
219
223
|
test("test geode true & viewer true", () => {
|
|
220
|
-
const
|
|
224
|
+
const infraStore = useInfraStore()
|
|
221
225
|
const geodeStore = useGeodeStore()
|
|
222
226
|
const viewerStore = useViewerStore()
|
|
223
227
|
|
|
224
|
-
|
|
228
|
+
infraStore.register_microservice(geodeStore, {
|
|
225
229
|
request: vi.fn(),
|
|
226
230
|
connect: vi.fn(),
|
|
227
231
|
launch: vi.fn(),
|
|
228
232
|
})
|
|
229
|
-
|
|
233
|
+
infraStore.register_microservice(viewerStore, {
|
|
230
234
|
request: vi.fn(),
|
|
231
235
|
connect: vi.fn(),
|
|
232
236
|
launch: vi.fn(),
|
|
@@ -234,7 +238,7 @@ describe("Infra Store", () => {
|
|
|
234
238
|
|
|
235
239
|
geodeStore.$patch({ request_counter: 1 })
|
|
236
240
|
viewerStore.$patch({ request_counter: 1 })
|
|
237
|
-
expect(
|
|
241
|
+
expect(infraStore.microservices_busy).toBe(true)
|
|
238
242
|
})
|
|
239
243
|
})
|
|
240
244
|
})
|
|
@@ -242,63 +246,62 @@ describe("Infra Store", () => {
|
|
|
242
246
|
describe("actions", () => {
|
|
243
247
|
describe("register_microservice", () => {
|
|
244
248
|
test("register geode microservice", () => {
|
|
245
|
-
const
|
|
249
|
+
const infraStore = useInfraStore()
|
|
246
250
|
const geodeStore = useGeodeStore()
|
|
247
251
|
|
|
248
|
-
|
|
252
|
+
infraStore.register_microservice(geodeStore, {
|
|
249
253
|
request: vi.fn(),
|
|
250
254
|
connect: vi.fn(),
|
|
251
255
|
launch: vi.fn(),
|
|
252
256
|
})
|
|
253
257
|
|
|
254
|
-
expect(
|
|
255
|
-
expect(
|
|
258
|
+
expect(infraStore.microservices.length).toBe(1)
|
|
259
|
+
expect(infraStore.microservices[0].$id).toBe("geode")
|
|
256
260
|
})
|
|
257
261
|
|
|
258
262
|
test("register multiple microservices", () => {
|
|
259
|
-
const
|
|
263
|
+
const infraStore = useInfraStore()
|
|
260
264
|
const geodeStore = useGeodeStore()
|
|
261
265
|
const viewerStore = useViewerStore()
|
|
262
266
|
|
|
263
|
-
|
|
267
|
+
infraStore.register_microservice(geodeStore, {
|
|
264
268
|
request: vi.fn(),
|
|
265
269
|
connect: vi.fn(),
|
|
266
270
|
launch: vi.fn(),
|
|
267
271
|
})
|
|
268
272
|
|
|
269
|
-
|
|
273
|
+
infraStore.register_microservice(viewerStore, {
|
|
270
274
|
request: vi.fn(),
|
|
271
275
|
connect: vi.fn(),
|
|
272
276
|
launch: vi.fn(),
|
|
273
277
|
})
|
|
274
278
|
|
|
275
|
-
expect(
|
|
279
|
+
expect(infraStore.microservices.length).toBe(2)
|
|
276
280
|
})
|
|
277
281
|
})
|
|
278
282
|
|
|
279
283
|
describe("create_backend", () => {
|
|
280
284
|
test("test without microservices", async () => {
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
await
|
|
284
|
-
expect(
|
|
285
|
+
const infraStore = useInfraStore()
|
|
286
|
+
infraStore.app_mode = appMode.BROWSER
|
|
287
|
+
await infraStore.create_backend()
|
|
288
|
+
expect(infraStore.status).toBe(Status.CREATED)
|
|
285
289
|
})
|
|
286
290
|
test("test with end-point", async () => {
|
|
287
|
-
const
|
|
291
|
+
const infraStore = useInfraStore()
|
|
288
292
|
const geodeStore = useGeodeStore()
|
|
289
293
|
const viewerStore = useViewerStore()
|
|
290
|
-
const feedback_store = useFeedbackStore()
|
|
291
294
|
const lambdaStore = useLambdaStore()
|
|
292
295
|
|
|
293
|
-
|
|
296
|
+
infraStore.app_mode = appMode.CLOUD
|
|
294
297
|
const ID = "123456"
|
|
295
298
|
registerEndpoint(lambdaStore.base_url, {
|
|
296
299
|
method: "POST",
|
|
297
300
|
handler: () => ({ ID }),
|
|
298
301
|
})
|
|
299
|
-
await
|
|
300
|
-
expect(
|
|
301
|
-
expect(
|
|
302
|
+
await infraStore.create_backend()
|
|
303
|
+
expect(infraStore.status).toBe(Status.CREATED)
|
|
304
|
+
expect(infraStore.ID).toBe(ID)
|
|
302
305
|
|
|
303
306
|
expect(geodeStore.status).toBe(Status.NOT_CONNECTED)
|
|
304
307
|
expect(viewerStore.status).toBe(Status.NOT_CONNECTED)
|
|
@@ -6,8 +6,11 @@ import { setActivePinia } from "pinia"
|
|
|
6
6
|
import { createTestingPinia } from "@pinia/testing"
|
|
7
7
|
import { beforeEach, describe, expect, expectTypeOf, test, vi } from "vitest"
|
|
8
8
|
|
|
9
|
+
import { useFeedbackStore } from "@ogw_front/stores/feedback"
|
|
10
|
+
import { useLambdaStore } from "@ogw_front/stores/lambda"
|
|
11
|
+
|
|
9
12
|
// Local imports
|
|
10
|
-
import Status from "@ogw_front/utils/status
|
|
13
|
+
import Status from "@ogw_front/utils/status"
|
|
11
14
|
|
|
12
15
|
beforeEach(async () => {
|
|
13
16
|
const pinia = createTestingPinia({
|
|
@@ -73,6 +76,7 @@ describe("Lambda Store", () => {
|
|
|
73
76
|
useRuntimeConfig().public.SITE_BRANCH = "/test"
|
|
74
77
|
useRuntimeConfig().public.PROJECT = "/project"
|
|
75
78
|
|
|
79
|
+
lambdaStore.base_url = "test-base-url"
|
|
76
80
|
registerEndpoint(lambdaStore.base_url, {
|
|
77
81
|
method: "POST",
|
|
78
82
|
handler: postFakeCall,
|
|
@@ -121,9 +125,7 @@ describe("Lambda Store", () => {
|
|
|
121
125
|
describe("connect", () => {
|
|
122
126
|
test("successful connect", async () => {
|
|
123
127
|
const lambdaStore = useLambdaStore()
|
|
124
|
-
|
|
125
128
|
await lambdaStore.connect()
|
|
126
|
-
|
|
127
129
|
expect(lambdaStore.status).toBe(Status.CONNECTED)
|
|
128
130
|
})
|
|
129
131
|
})
|