@geode/opengeodeweb-front 10.0.2-rc.4 → 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.
Files changed (143) hide show
  1. package/app/components/CrsSelector.vue +1 -0
  2. package/app/components/ExtensionSelector.vue +2 -1
  3. package/app/components/FeedBack/ErrorBanner.vue +4 -3
  4. package/app/components/FeedBack/Snackers.vue +5 -3
  5. package/app/components/FileSelector.vue +3 -2
  6. package/app/components/FileUploader.vue +1 -1
  7. package/app/components/HybridRenderingView.vue +4 -1
  8. package/app/components/InfraConnected.vue +2 -0
  9. package/app/components/Inspector/InspectionButton.vue +1 -0
  10. package/app/components/Inspector/ResultPanel.vue +1 -1
  11. package/app/components/Launcher.vue +9 -8
  12. package/app/components/Loading.vue +1 -1
  13. package/app/components/MissingFilesSelector.vue +3 -2
  14. package/app/components/ObjectSelector.vue +8 -5
  15. package/app/components/PackagesVersions.vue +2 -1
  16. package/app/components/Recaptcha.vue +6 -5
  17. package/app/components/RemoteRenderingView.vue +3 -3
  18. package/app/components/Screenshot.vue +2 -0
  19. package/app/components/Stepper.vue +1 -1
  20. package/app/components/VeaseViewToolbar.vue +6 -3
  21. package/app/components/ViewToolbar.vue +3 -2
  22. package/app/components/Viewer/BreadCrumb.vue +1 -0
  23. package/app/components/Viewer/ContextMenu.vue +2 -0
  24. package/app/components/Viewer/EdgedCurve/EdgesOptions.vue +1 -1
  25. package/app/components/Viewer/EdgedCurve/PointsOptions.vue +1 -1
  26. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +6 -3
  27. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +9 -6
  28. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +6 -3
  29. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +6 -3
  30. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +6 -3
  31. package/app/components/Viewer/Generic/Model/EdgesOptions.vue +8 -4
  32. package/app/components/Viewer/Generic/Model/PointsOptions.vue +5 -2
  33. package/app/components/Viewer/Grid/2D/CellsOptions.vue +1 -1
  34. package/app/components/Viewer/Grid/2D/EdgesOptions.vue +1 -1
  35. package/app/components/Viewer/Grid/2D/PointsOptions.vue +1 -1
  36. package/app/components/Viewer/Grid/3D/CellsOptions.vue +1 -1
  37. package/app/components/Viewer/Grid/3D/EdgesOptions.vue +1 -1
  38. package/app/components/Viewer/Grid/3D/FacetsOptions.vue +1 -1
  39. package/app/components/Viewer/Grid/3D/PointsOptions.vue +1 -1
  40. package/app/components/Viewer/HybridSolid/EdgesOptions.vue +1 -1
  41. package/app/components/Viewer/HybridSolid/PointsOptions.vue +1 -1
  42. package/app/components/Viewer/HybridSolid/PolygonsOptions.vue +1 -1
  43. package/app/components/Viewer/HybridSolid/PolyhedraOptions.vue +1 -1
  44. package/app/components/Viewer/Options/CellAttributeSelector.vue +1 -0
  45. package/app/components/Viewer/Options/ColoringTypeSelector.vue +7 -7
  46. package/app/components/Viewer/Options/PolygonAttributeSelector.vue +1 -0
  47. package/app/components/Viewer/Options/PolyhedronAttributeSelector.vue +1 -0
  48. package/app/components/Viewer/Options/TextureItem.vue +2 -1
  49. package/app/components/Viewer/Options/TexturesSelector.vue +1 -1
  50. package/app/components/Viewer/PointSet/PointsOptions.vue +1 -1
  51. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +7 -3
  52. package/app/components/Viewer/PolygonalSurface/EdgesOptions.vue +1 -1
  53. package/app/components/Viewer/PolygonalSurface/PointsOptions.vue +1 -1
  54. package/app/components/Viewer/PolygonalSurface/PolygonsOptions.vue +1 -1
  55. package/app/components/Viewer/Solid/EdgesOptions.vue +1 -1
  56. package/app/components/Viewer/Solid/PointsOptions.vue +1 -1
  57. package/app/components/Viewer/Solid/PolygonsOptions.vue +1 -1
  58. package/app/components/Viewer/Solid/PolyhedraOptions.vue +1 -1
  59. package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +1 -1
  60. package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +1 -1
  61. package/app/components/Viewer/Tree/ObjectTree.vue +5 -3
  62. package/app/components/Viewer/TreeComponent.vue +4 -0
  63. package/app/components/Viewer/TreeObject.vue +6 -0
  64. package/app/components/Viewer/TriangulatedSurface/EdgesOptions.vue +1 -1
  65. package/app/components/Viewer/TriangulatedSurface/PointsOptions.vue +1 -1
  66. package/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue +1 -1
  67. package/app/components/Wrapper.vue +7 -5
  68. package/app/composables/project_manager.js +9 -3
  69. package/app/composables/run_function_when_microservices_connected.js +5 -2
  70. package/app/plugins/auto_store_register.js +9 -1
  71. package/app/stores/data_base.js +4 -1
  72. package/app/stores/data_style.js +5 -5
  73. package/app/stores/geode.js +14 -12
  74. package/app/stores/hybrid_viewer.js +3 -2
  75. package/app/stores/infra.js +4 -2
  76. package/app/stores/lambda.js +2 -1
  77. package/app/stores/menu.js +24 -24
  78. package/app/stores/viewer.js +9 -8
  79. package/app/utils/file_import_workflow.js +5 -1
  80. package/app/utils/upload_file.js +6 -3
  81. package/internal/stores/mesh/cells.js +4 -5
  82. package/internal/stores/mesh/edges.js +5 -3
  83. package/internal/stores/mesh/index.js +9 -6
  84. package/internal/stores/mesh/points.js +5 -4
  85. package/internal/stores/mesh/polygons.js +5 -5
  86. package/internal/stores/mesh/polyhedra.js +5 -2
  87. package/internal/stores/model/blocks.js +6 -2
  88. package/internal/stores/model/corners.js +6 -2
  89. package/internal/stores/model/edges.js +5 -1
  90. package/internal/stores/model/index.js +11 -8
  91. package/internal/stores/model/lines.js +6 -2
  92. package/internal/stores/model/points.js +5 -2
  93. package/internal/stores/model/surfaces.js +6 -2
  94. package/internal/utils/api_fetch.js +2 -1
  95. package/internal/utils/viewer_call.js +5 -4
  96. package/nuxt.config.js +1 -3
  97. package/package.json +6 -7
  98. package/scripts/generate_geode_objects.js +1 -1
  99. package/tests/integration/microservices/back/requirements.txt +1 -1
  100. package/tests/integration/microservices/viewer/requirements.txt +1 -1
  101. package/tests/integration/setup.js +1 -1
  102. package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +3 -1
  103. package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +3 -1
  104. package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +3 -1
  105. package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +3 -1
  106. package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +3 -1
  107. package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +3 -1
  108. package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +4 -1
  109. package/tests/integration/stores/data_style/model/corners.nuxt.test.js +4 -1
  110. package/tests/integration/stores/data_style/model/edges.nuxt.test.js +3 -1
  111. package/tests/integration/stores/data_style/model/index.nuxt.test.js +3 -1
  112. package/tests/integration/stores/data_style/model/lines.nuxt.test.js +4 -1
  113. package/tests/integration/stores/data_style/model/points.nuxt.test.js +2 -1
  114. package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +4 -1
  115. package/tests/unit/components/CrsSelector.nuxt.test.js +4 -2
  116. package/tests/unit/components/ExtensionSelector.nuxt.test.js +4 -2
  117. package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +9 -8
  118. package/tests/unit/components/FeedBack/Snackers.nuxt.test.js +6 -5
  119. package/tests/unit/components/FileSelector.nuxt.test.js +6 -7
  120. package/tests/unit/components/FileUploader.nuxt.test.js +4 -3
  121. package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +3 -2
  122. package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +5 -4
  123. package/tests/unit/components/Launcher.nuxt.test.js +7 -5
  124. package/tests/unit/components/MissingFilesSelector.nuxt.test.js +5 -4
  125. package/tests/unit/components/ObjectSelector.nuxt.test.js +16 -7
  126. package/tests/unit/components/PackagesVersions.nuxt.test.js +3 -2
  127. package/tests/unit/components/Step.nuxt.test.js +3 -3
  128. package/tests/unit/components/Stepper.nuxt.test.js +3 -3
  129. package/tests/unit/components/Wrapper.nuxt.test.js +3 -3
  130. package/tests/unit/composables/ProjectManager.nuxt.test.js +15 -17
  131. package/tests/unit/composables/api_fetch.nuxt.test.js +5 -2
  132. package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +11 -1
  133. package/tests/unit/composables/upload_file.nuxt.test.js +6 -3
  134. package/tests/unit/plugins/project_load.nuxt.test.js +8 -2
  135. package/tests/unit/stores/App.nuxt.test.js +34 -32
  136. package/tests/unit/stores/Feedback.nuxt.test.js +25 -25
  137. package/tests/unit/stores/Geode.nuxt.test.js +27 -25
  138. package/tests/unit/stores/Infra.nuxt.test.js +73 -70
  139. package/tests/unit/stores/Lambda.nuxt.test.js +5 -3
  140. package/tests/unit/stores/Viewer.nuxt.test.js +27 -27
  141. package/tests/unit/utils/recaptcha.nuxt.test.js +2 -2
  142. package/tests/unit/utils/validate_schema.nuxt.test.js +2 -2
  143. 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 feedback_store = useFeedbackStore()
18
- expectTypeOf(feedback_store.feedbacks).toEqualTypeOf([])
19
- expectTypeOf(feedback_store.server_error).toBeBoolean()
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 feedback_store = useFeedbackStore()
26
- feedback_store.add_error(
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(feedback_store.feedbacks.length).toBe(1)
33
- expect(feedback_store.feedbacks[0].type).toBe("error")
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 feedback_store = useFeedbackStore()
40
- feedback_store.feedbacks_timeout_miliseconds = 500
41
- feedback_store.add_error(
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(feedback_store.feedbacks.length).toBe(1)
47
+ expect(feedbackStore.feedbacks.length).toBe(1)
48
48
  setTimeout(() => {
49
- expect(feedback_store.feedbacks.length).toBe(0)
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 feedback_store = useFeedbackStore()
57
- feedback_store.feedbacks_timeout_miliseconds = 500
58
- feedback_store.add_success("test description")
59
- expect(feedback_store.feedbacks.length).toBe(1)
60
- expect(feedback_store.feedbacks[0].type).toBe("success")
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(feedback_store.feedbacks.length).toBe(0)
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 feedback_store = useFeedbackStore()
70
- feedback_store.delete_feedback(0)
71
- expect(feedback_store.feedbacks.length).toBe(0)
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 feedback_store = useFeedbackStore()
78
- feedback_store.$patch({ server_error: true })
79
- feedback_store.delete_server_error()
80
- expect(feedback_store.server_error).toBe(false)
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 infra_store = useInfraStore()
32
+ const infraStore = useInfraStore()
31
33
  const geodeStore = useGeodeStore()
32
- infra_store.app_mode = appMode.CLOUD
34
+ infraStore.app_mode = appMode.CLOUD
33
35
  expect(geodeStore.protocol).toBe("https")
34
36
  })
35
37
  test("test app_mode BROWSER", () => {
36
- const infra_store = useInfraStore()
38
+ const infraStore = useInfraStore()
37
39
  const geodeStore = useGeodeStore()
38
- infra_store.app_mode = appMode.BROWSER
40
+ infraStore.app_mode = appMode.BROWSER
39
41
  expect(geodeStore.protocol).toBe("http")
40
42
  })
41
43
  test("test app_mode DESKTOP", () => {
42
- const infra_store = useInfraStore()
44
+ const infraStore = useInfraStore()
43
45
  const geodeStore = useGeodeStore()
44
- infra_store.app_mode = appMode.DESKTOP
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 infra_store = useInfraStore()
53
+ const infraStore = useInfraStore()
52
54
  const geodeStore = useGeodeStore()
53
- infra_store.app_mode = appMode.CLOUD
55
+ infraStore.app_mode = appMode.CLOUD
54
56
  expect(geodeStore.port).toBe("443")
55
57
  })
56
58
  test("test app_mode BROWSER", () => {
57
- const infra_store = useInfraStore()
59
+ const infraStore = useInfraStore()
58
60
  const geodeStore = useGeodeStore()
59
- infra_store.app_mode = appMode.BROWSER
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 infra_store = useInfraStore()
65
+ const infraStore = useInfraStore()
64
66
  const geodeStore = useGeodeStore()
65
- infra_store.app_mode = appMode.DESKTOP
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 infra_store = useInfraStore()
72
+ const infraStore = useInfraStore()
71
73
  const geodeStore = useGeodeStore()
72
- infra_store.app_mode = appMode.DESKTOP
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 infra_store = useInfraStore()
82
+ const infraStore = useInfraStore()
81
83
  const geodeStore = useGeodeStore()
82
- infra_store.app_mode = appMode.BROWSER
83
- infra_store.domain_name = "localhost"
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 infra_store = useInfraStore()
89
+ const infraStore = useInfraStore()
88
90
  const geodeStore = useGeodeStore()
89
- infra_store.app_mode = appMode.CLOUD
90
- infra_store.ID = "123456"
91
- infra_store.domain_name = "example.com"
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 infra_store = useInfraStore()
97
+ const infraStore = useInfraStore()
96
98
  const geodeStore = useGeodeStore()
97
- infra_store.app_mode = appMode.CLOUD
98
- infra_store.ID = ""
99
- infra_store.domain_name = "example.com"
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.js"
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 infra_store = useInfraStore()
36
- expectTypeOf(infra_store.ID).toBeString()
37
- expectTypeOf(infra_store.is_captcha_validated).toBeBoolean()
38
- expectTypeOf(infra_store.status).toBeString()
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 infra_store = useInfraStore()
45
- expectTypeOf(infra_store.app_mode).toBeString()
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 infra_store = useInfraStore()
52
- infra_store.app_mode = appMode.BROWSER
53
- expect(infra_store.domain_name).toBe("localhost")
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 infra_store = useInfraStore()
57
- infra_store.app_mode = appMode.DESKTOP
58
- expect(infra_store.domain_name).toBe("localhost")
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 infra_store = useInfraStore()
62
- infra_store.app_mode = appMode.CLOUD
63
- expect(infra_store.domain_name).toBe("api.geode-solutions.com")
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 infra_store = useInfraStore()
70
- expect(infra_store.microservices_connected).toBe(true)
73
+ const infraStore = useInfraStore()
74
+ expect(infraStore.microservices_connected).toBe(true)
71
75
  })
72
76
  test("test geode false & viewer false", () => {
73
- const infra_store = useInfraStore()
77
+ const infraStore = useInfraStore()
74
78
  const geodeStore = useGeodeStore()
75
79
  const viewerStore = useViewerStore()
76
80
 
77
- infra_store.register_microservice(geodeStore, {
81
+ infraStore.register_microservice(geodeStore, {
78
82
  request: vi.fn(),
79
83
  connect: vi.fn(),
80
84
  launch: vi.fn(),
81
85
  })
82
- infra_store.register_microservice(viewerStore, {
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(infra_store.microservices_connected).toBe(false)
94
+ expect(infraStore.microservices_connected).toBe(false)
91
95
  })
92
96
  test("test geode true & viewer false", () => {
93
- const infra_store = useInfraStore()
97
+ const infraStore = useInfraStore()
94
98
  const geodeStore = useGeodeStore()
95
99
  const viewerStore = useViewerStore()
96
100
 
97
- infra_store.register_microservice(geodeStore, {
101
+ infraStore.register_microservice(geodeStore, {
98
102
  request: vi.fn(),
99
103
  connect: vi.fn(),
100
104
  launch: vi.fn(),
101
105
  })
102
- infra_store.register_microservice(viewerStore, {
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(infra_store.microservices_connected).toBe(false)
114
+ expect(infraStore.microservices_connected).toBe(false)
111
115
  })
112
116
  test("test geode false & viewer true", () => {
113
- const infra_store = useInfraStore()
117
+ const infraStore = useInfraStore()
114
118
  const geodeStore = useGeodeStore()
115
119
  const viewerStore = useViewerStore()
116
120
 
117
- infra_store.register_microservice(geodeStore, {
121
+ infraStore.register_microservice(geodeStore, {
118
122
  request: vi.fn(),
119
123
  connect: vi.fn(),
120
124
  launch: vi.fn(),
121
125
  })
122
- infra_store.register_microservice(viewerStore, {
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(infra_store.microservices_connected).toBe(false)
134
+ expect(infraStore.microservices_connected).toBe(false)
131
135
  })
132
136
  test("test geode true & viewer true", () => {
133
- const infra_store = useInfraStore()
137
+ const infraStore = useInfraStore()
134
138
  const geodeStore = useGeodeStore()
135
139
  const viewerStore = useViewerStore()
136
140
 
137
- infra_store.register_microservice(geodeStore, {
141
+ infraStore.register_microservice(geodeStore, {
138
142
  request: vi.fn(),
139
143
  connect: vi.fn(),
140
144
  launch: vi.fn(),
141
145
  })
142
- infra_store.register_microservice(viewerStore, {
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(infra_store.microservices_connected).toBe(true)
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 infra_store = useInfraStore()
157
- expect(infra_store.microservices_busy).toBe(false)
160
+ const infraStore = useInfraStore()
161
+ expect(infraStore.microservices_busy).toBe(false)
158
162
  })
159
163
  test("test geode false & viewer false", () => {
160
- const infra_store = useInfraStore()
164
+ const infraStore = useInfraStore()
161
165
  const geodeStore = useGeodeStore()
162
166
  const viewerStore = useViewerStore()
163
167
 
164
- infra_store.register_microservice(geodeStore, {
168
+ infraStore.register_microservice(geodeStore, {
165
169
  request: vi.fn(),
166
170
  connect: vi.fn(),
167
171
  launch: vi.fn(),
168
172
  })
169
- infra_store.register_microservice(viewerStore, {
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(infra_store.microservices_busy).toBe(false)
181
+ expect(infraStore.microservices_busy).toBe(false)
178
182
  })
179
183
  test("test geode true & viewer false", () => {
180
- const infra_store = useInfraStore()
184
+ const infraStore = useInfraStore()
181
185
  const geodeStore = useGeodeStore()
182
186
  const viewerStore = useViewerStore()
183
187
 
184
- infra_store.register_microservice(geodeStore, {
188
+ infraStore.register_microservice(geodeStore, {
185
189
  request: vi.fn(),
186
190
  connect: vi.fn(),
187
191
  launch: vi.fn(),
188
192
  })
189
- infra_store.register_microservice(viewerStore, {
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(infra_store.microservices_busy).toBe(true)
201
+ expect(infraStore.microservices_busy).toBe(true)
198
202
  })
199
203
  test("test geode false & viewer true", () => {
200
- const infra_store = useInfraStore()
204
+ const infraStore = useInfraStore()
201
205
  const geodeStore = useGeodeStore()
202
206
  const viewerStore = useViewerStore()
203
207
 
204
- infra_store.register_microservice(geodeStore, {
208
+ infraStore.register_microservice(geodeStore, {
205
209
  request: vi.fn(),
206
210
  connect: vi.fn(),
207
211
  launch: vi.fn(),
208
212
  })
209
- infra_store.register_microservice(viewerStore, {
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(infra_store.microservices_busy).toBe(true)
221
+ expect(infraStore.microservices_busy).toBe(true)
218
222
  })
219
223
  test("test geode true & viewer true", () => {
220
- const infra_store = useInfraStore()
224
+ const infraStore = useInfraStore()
221
225
  const geodeStore = useGeodeStore()
222
226
  const viewerStore = useViewerStore()
223
227
 
224
- infra_store.register_microservice(geodeStore, {
228
+ infraStore.register_microservice(geodeStore, {
225
229
  request: vi.fn(),
226
230
  connect: vi.fn(),
227
231
  launch: vi.fn(),
228
232
  })
229
- infra_store.register_microservice(viewerStore, {
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(infra_store.microservices_busy).toBe(true)
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 infra_store = useInfraStore()
249
+ const infraStore = useInfraStore()
246
250
  const geodeStore = useGeodeStore()
247
251
 
248
- infra_store.register_microservice(geodeStore, {
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(infra_store.microservices.length).toBe(1)
255
- expect(infra_store.microservices[0].$id).toBe("geode")
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 infra_store = useInfraStore()
263
+ const infraStore = useInfraStore()
260
264
  const geodeStore = useGeodeStore()
261
265
  const viewerStore = useViewerStore()
262
266
 
263
- infra_store.register_microservice(geodeStore, {
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
- infra_store.register_microservice(viewerStore, {
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(infra_store.microservices.length).toBe(2)
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 infra_store = useInfraStore()
282
- infra_store.app_mode = appMode.BROWSER
283
- await infra_store.create_backend()
284
- expect(infra_store.status).toBe(Status.CREATED)
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 infra_store = useInfraStore()
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
- infra_store.app_mode = appMode.CLOUD
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 infra_store.create_backend()
300
- expect(infra_store.status).toBe(Status.CREATED)
301
- expect(infra_store.ID).toBe(ID)
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.js"
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
  })