@geode/opengeodeweb-front 10.0.2-rc.4 → 10.0.2-rc.6

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 +4 -1
@@ -9,7 +9,9 @@ import * as directives from "vuetify/directives"
9
9
  import { setActivePinia } from "pinia"
10
10
  import { createTestingPinia } from "@pinia/testing"
11
11
 
12
- import Launcher from "@ogw_front/components/Launcher.vue"
12
+ import Launcher from "@ogw_front/components/Launcher"
13
+
14
+ import { useInfraStore } from "@ogw_front/stores/infra"
13
15
 
14
16
  const vuetify = createVuetify({
15
17
  components,
@@ -30,22 +32,22 @@ vi.stubGlobal("navigator", {
30
32
 
31
33
  global.ResizeObserver = require("resize-observer-polyfill")
32
34
 
33
- describe("Launcher.vue", async () => {
35
+ describe("Launcher", async () => {
34
36
  test(`Mount`, async () => {
35
37
  const pinia = createTestingPinia({
36
38
  stubActions: false,
37
39
  createSpy: vi.fn,
38
40
  })
39
41
  setActivePinia(pinia)
40
- const infra_store = useInfraStore()
42
+ const infraStore = useInfraStore()
41
43
  const wrapper = await mountSuspended(Launcher, {
42
44
  global: {
43
45
  plugins: [pinia, vuetify],
44
46
  },
45
47
  })
46
48
  expect(wrapper.exists()).toBe(true)
47
- await infra_store.$patch({ is_captcha_validated: true })
49
+ await infraStore.$patch({ is_captcha_validated: true })
48
50
  await flushPromises()
49
- expect(infra_store.create_backend).toHaveBeenCalled()
51
+ expect(infraStore.create_backend).toHaveBeenCalled()
50
52
  })
51
53
  })
@@ -8,11 +8,12 @@ import * as directives from "vuetify/directives"
8
8
  import { setActivePinia } from "pinia"
9
9
  import { createTestingPinia } from "@pinia/testing"
10
10
 
11
- import MissingFilesSelector from "@ogw_front/components/MissingFilesSelector.vue"
12
- import FileUploader from "@ogw_front/components/FileUploader.vue"
13
-
14
11
  import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
15
12
 
13
+ import MissingFilesSelector from "@ogw_front/components/MissingFilesSelector"
14
+ import FileUploader from "@ogw_front/components/FileUploader"
15
+ import { useGeodeStore } from "@ogw_front/stores/geode"
16
+
16
17
  const missing_files_schema = schemas.opengeodeweb_back.missing_files
17
18
  const upload_file_schema = schemas.opengeodeweb_back.upload_file
18
19
 
@@ -21,7 +22,7 @@ const vuetify = createVuetify({
21
22
  directives,
22
23
  })
23
24
 
24
- describe("MissingFilesSelector.vue", async () => {
25
+ describe("MissingFilesSelector", async () => {
25
26
  const pinia = createTestingPinia({
26
27
  stubActions: false,
27
28
  createSpy: vi.fn,
@@ -8,7 +8,9 @@ import * as directives from "vuetify/directives"
8
8
  import { setActivePinia } from "pinia"
9
9
  import { createTestingPinia } from "@pinia/testing"
10
10
 
11
- import ObjectSelector from "@ogw_front/components/ObjectSelector.vue"
11
+ import ObjectSelector from "@ogw_front/components/ObjectSelector"
12
+
13
+ import { useGeodeStore } from "@ogw_front/stores/geode"
12
14
 
13
15
  import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
14
16
 
@@ -19,7 +21,7 @@ const vuetify = createVuetify({
19
21
  directives,
20
22
  })
21
23
 
22
- describe("ObjectSelector.vue", async () => {
24
+ describe("ObjectSelector", async () => {
23
25
  const pinia = createTestingPinia({
24
26
  stubActions: false,
25
27
  createSpy: vi.fn,
@@ -42,7 +44,7 @@ describe("ObjectSelector.vue", async () => {
42
44
  global: {
43
45
  plugins: [vuetify, pinia],
44
46
  },
45
- props: { filenames: ["test.toto"], supported_feature: "test" },
47
+ props: { filenames: ["test.toto"] },
46
48
  })
47
49
  const v_card = wrapper.findComponent(components.VCard)
48
50
  const v_img = v_card.findComponent(components.VImg)
@@ -52,6 +54,7 @@ describe("ObjectSelector.vue", async () => {
52
54
  expect(wrapper.emitted().update_values[0][0]).toEqual({
53
55
  geode_object_type: geode_object_1,
54
56
  })
57
+ wrapper.unmount()
55
58
  })
56
59
 
57
60
  test(`test loabable with multiple classes`, async () => {
@@ -70,21 +73,24 @@ describe("ObjectSelector.vue", async () => {
70
73
  global: {
71
74
  plugins: [vuetify, pinia],
72
75
  },
73
- props: { filenames: ["test.toto"], supported_feature: "test" },
76
+ props: { filenames: ["test.toto"] },
74
77
  })
75
78
  const v_card = wrapper.findComponent(components.VCard)
76
79
  const v_img = v_card.findComponent(components.VImg)
77
80
  expect(v_img.vm.src).toContain(`${geode_object_1}.svg`)
78
81
  await flushPromises()
79
- await flushPromises()
80
82
  await v_card.trigger("click")
81
83
  await flushPromises()
82
- await flushPromises()
83
84
  expect(wrapper.emitted()).toHaveProperty("update_values")
85
+ console.log(
86
+ "wrapper.emitted().update_values",
87
+ wrapper.emitted().update_values,
88
+ )
84
89
  expect(wrapper.emitted().update_values).toHaveLength(1)
85
90
  expect(wrapper.emitted().update_values[0][0]).toEqual({
86
91
  geode_object_type: geode_object_1,
87
92
  })
93
+ wrapper.unmount()
88
94
  })
89
95
 
90
96
  test(`test object_priority when is_loadable scores equal`, async () => {
@@ -107,12 +113,15 @@ describe("ObjectSelector.vue", async () => {
107
113
  global: {
108
114
  plugins: [vuetify, pinia],
109
115
  },
110
- props: { filenames: ["test.toto"], supported_feature: "test" },
116
+ props: { filenames: ["test.toto"] },
111
117
  })
118
+
119
+ await flushPromises()
112
120
  expect(wrapper.emitted()).toHaveProperty("update_values")
113
121
  expect(wrapper.emitted().update_values).toHaveLength(1)
114
122
  expect(wrapper.emitted().update_values[0][0]).toEqual({
115
123
  geode_object_type: geode_object_1,
116
124
  })
125
+ wrapper.unmount()
117
126
  })
118
127
  })
@@ -8,14 +8,15 @@ import * as directives from "vuetify/directives"
8
8
  import { setActivePinia } from "pinia"
9
9
  import { createTestingPinia } from "@pinia/testing"
10
10
 
11
- import PackagesVersions from "@ogw_front/components/PackagesVersions.vue"
11
+ import PackagesVersions from "@ogw_front/components/PackagesVersions"
12
+ import { useGeodeStore } from "@ogw_front/stores/geode"
12
13
 
13
14
  const vuetify = createVuetify({
14
15
  components,
15
16
  directives,
16
17
  })
17
18
 
18
- describe("PackagesVersions.vue", async () => {
19
+ describe("PackagesVersions", async () => {
19
20
  test(`Mount`, async () => {
20
21
  const pinia = createTestingPinia({
21
22
  createSpy: vi.fn,
@@ -5,8 +5,8 @@ import { createVuetify } from "vuetify"
5
5
  import * as components from "vuetify/components"
6
6
  import * as directives from "vuetify/directives"
7
7
 
8
- import Step from "@ogw_front/components/Step.vue"
9
- import ObjectSelector from "@ogw_front/components/ObjectSelector.vue"
8
+ import Step from "@ogw_front/components/Step"
9
+ import ObjectSelector from "@ogw_front/components/ObjectSelector"
10
10
 
11
11
  const vuetify = createVuetify({
12
12
  components,
@@ -15,7 +15,7 @@ const vuetify = createVuetify({
15
15
 
16
16
  global.ResizeObserver = require("resize-observer-polyfill")
17
17
 
18
- describe("Step.vue", async () => {
18
+ describe("Step", async () => {
19
19
  test(`BRep`, async () => {
20
20
  const geode_object_type = ref("BRep")
21
21
  const files = ref([])
@@ -5,8 +5,8 @@ import { createVuetify } from "vuetify"
5
5
  import * as components from "vuetify/components"
6
6
  import * as directives from "vuetify/directives"
7
7
 
8
- import Stepper from "@ogw_front/components/Stepper.vue"
9
- import ObjectSelector from "@ogw_front/components/ObjectSelector.vue"
8
+ import Stepper from "@ogw_front/components/Stepper"
9
+ import ObjectSelector from "@ogw_front/components/ObjectSelector"
10
10
  import { mountSuspended } from "@nuxt/test-utils/runtime"
11
11
 
12
12
  const vuetify = createVuetify({
@@ -16,7 +16,7 @@ const vuetify = createVuetify({
16
16
 
17
17
  global.ResizeObserver = require("resize-observer-polyfill")
18
18
 
19
- describe("Stepper.vue", async () => {
19
+ describe("Stepper", async () => {
20
20
  test(`Mount`, async () => {
21
21
  const geode_object_type = ref("BRep")
22
22
  const files = ref([])
@@ -5,8 +5,8 @@ import { describe, expect, test } from "vitest"
5
5
  // import * as components from "vuetify/components"
6
6
  // import * as directives from "vuetify/directives"
7
7
 
8
- // // import Wrapper from "@ogw_front/components/Wrapper.vue"
9
- // import ObjectSelector from "@ogw_front/components/ObjectSelector.vue"
8
+ // // import Wrapper from "@ogw_front/components/Wrapper"
9
+ // import ObjectSelector from "@ogw_front/components/ObjectSelector"
10
10
 
11
11
  // const vuetify = createVuetify({
12
12
  // components,
@@ -15,7 +15,7 @@ import { describe, expect, test } from "vitest"
15
15
 
16
16
  // global.ResizeObserver = require("resize-observer-polyfill")
17
17
 
18
- // describe("Step.vue", async () => {
18
+ // describe("Step", async () => {
19
19
  // test(`Mount`, async () => {
20
20
  // const geode_object_type = ref("BRep")
21
21
  // const files = ref([])
@@ -3,8 +3,8 @@ import { setActivePinia } from "pinia"
3
3
  import { createTestingPinia } from "@pinia/testing"
4
4
 
5
5
  // Local imports
6
- import { useProjectManager } from "@ogw_front/composables/project_manager.js"
7
- import { appMode } from "@ogw_front/utils/app_mode.js"
6
+ import { useProjectManager } from "@ogw_front/composables/project_manager"
7
+ import { appMode } from "@ogw_front/utils/app_mode"
8
8
 
9
9
  // Snapshot
10
10
  const snapshotMock = {
@@ -96,7 +96,7 @@ const hybridViewerStoreMock = {
96
96
  }
97
97
  if (snapshot?.camera_options) {
98
98
  const { viewer_call } =
99
- await import("../../../internal/utils/viewer_call.js")
99
+ await import("../../../internal/utils/viewer_call")
100
100
  viewer_call({
101
101
  schema: { $id: "opengeodeweb_viewer.viewer.update_camera" },
102
102
  params: { camera_options: snapshot.camera_options },
@@ -114,11 +114,11 @@ vi.stubGlobal(
114
114
  "$fetch",
115
115
  vi.fn(async () => ({ snapshot: snapshotMock })),
116
116
  )
117
- vi.mock("../../../internal/utils/viewer_call.js", () => ({
117
+ vi.mock("../../../internal/utils/viewer_call", () => ({
118
118
  viewer_call: vi.fn(() => Promise.resolve()),
119
119
  }))
120
120
 
121
- vi.mock("@ogw_front/composables/api_fetch.js", () => ({
121
+ vi.mock("@ogw_front/composables/api_fetch", () => ({
122
122
  api_fetch: vi.fn(async (_req, options = {}) => {
123
123
  const response = {
124
124
  _data: new Blob(["zipcontent"], { type: "application/zip" }),
@@ -131,28 +131,28 @@ vi.mock("@ogw_front/composables/api_fetch.js", () => ({
131
131
  }),
132
132
  }))
133
133
  vi.mock("js-file-download", () => ({ default: vi.fn() }))
134
- vi.mock("@ogw_front/stores/infra.js", () => ({
134
+ vi.mock("@ogw_front/stores/infra", () => ({
135
135
  useInfraStore: () => infraStoreMock,
136
136
  }))
137
- vi.mock("@ogw_front/stores/viewer.js", () => ({
137
+ vi.mock("@ogw_front/stores/viewer", () => ({
138
138
  useViewerStore: () => viewerStoreMock,
139
139
  }))
140
- vi.mock("@ogw_front/stores/treeview.js", () => ({
140
+ vi.mock("@ogw_front/stores/treeview", () => ({
141
141
  useTreeviewStore: () => treeviewStoreMock,
142
142
  }))
143
- vi.mock("@ogw_front/stores/data_base.js", () => ({
143
+ vi.mock("@ogw_front/stores/data_base", () => ({
144
144
  useDataBaseStore: () => dataBaseStoreMock,
145
145
  }))
146
- vi.mock("@ogw_front/stores/data_style.js", () => ({
146
+ vi.mock("@ogw_front/stores/data_style", () => ({
147
147
  useDataStyleStore: () => dataStyleStoreMock,
148
148
  }))
149
- vi.mock("@ogw_front/stores/hybrid_viewer.js", () => ({
149
+ vi.mock("@ogw_front/stores/hybrid_viewer", () => ({
150
150
  useHybridViewerStore: () => hybridViewerStoreMock,
151
151
  }))
152
- vi.mock("@ogw_front/stores/geode.js", () => ({
152
+ vi.mock("@ogw_front/stores/geode", () => ({
153
153
  useGeodeStore: () => geodeStoreMock,
154
154
  }))
155
- vi.mock("@ogw_front/stores/app.js", () => ({
155
+ vi.mock("@ogw_front/stores/app", () => ({
156
156
  useAppStore: () => ({
157
157
  exportStores: vi.fn(() => ({ projectName: "mockedProject" })),
158
158
  }),
@@ -190,8 +190,7 @@ describe("ProjectManager composable (compact)", () => {
190
190
  (v) => typeof v === "function" && v.mockClear && v.mockClear(),
191
191
  )
192
192
  }
193
- const { viewer_call } =
194
- await import("../../../internal/utils/viewer_call.js")
193
+ const { viewer_call } = await import("../../../internal/utils/viewer_call")
195
194
  viewer_call.mockClear()
196
195
  })
197
196
 
@@ -212,8 +211,7 @@ describe("ProjectManager composable (compact)", () => {
212
211
 
213
212
  await importProjectFile(file)
214
213
 
215
- const { viewer_call } =
216
- await import("../../../internal/utils/viewer_call.js")
214
+ const { viewer_call } = await import("../../../internal/utils/viewer_call")
217
215
 
218
216
  expect(viewerStoreMock.ws_connect).toHaveBeenCalled()
219
217
  expect(viewer_call).toHaveBeenCalledTimes(2)
@@ -3,6 +3,9 @@ import { setActivePinia } from "pinia"
3
3
  import { createTestingPinia } from "@pinia/testing"
4
4
  import { registerEndpoint } from "@nuxt/test-utils/runtime"
5
5
 
6
+ import { useGeodeStore } from "@ogw_front/stores/geode"
7
+ import { useFeedbackStore } from "@ogw_front/stores/feedback"
8
+
6
9
  describe("geodeStore.request()", () => {
7
10
  const pinia = createTestingPinia({
8
11
  stubActions: false,
@@ -10,7 +13,7 @@ describe("geodeStore.request()", () => {
10
13
  })
11
14
  setActivePinia(pinia)
12
15
  const geodeStore = useGeodeStore()
13
- const feedback_store = useFeedbackStore()
16
+ const feedbackStore = useFeedbackStore()
14
17
  geodeStore.base_url = ""
15
18
 
16
19
  const schema = {
@@ -27,7 +30,7 @@ describe("geodeStore.request()", () => {
27
30
  }
28
31
 
29
32
  beforeEach(async () => {
30
- await feedback_store.$reset()
33
+ await feedbackStore.$reset()
31
34
  await geodeStore.$reset()
32
35
  geodeStore.base_url = ""
33
36
  })
@@ -1,9 +1,14 @@
1
1
  import { beforeEach, describe, expect, test, vi } from "vitest"
2
- import Status from "@ogw_front/utils/status.js"
2
+ import Status from "@ogw_front/utils/status"
3
3
 
4
4
  import { setActivePinia } from "pinia"
5
5
  import { createTestingPinia } from "@pinia/testing"
6
6
 
7
+ import { run_function_when_microservices_connected } from "@ogw_front/composables/run_function_when_microservices_connected"
8
+ import { useInfraStore } from "@ogw_front/stores/infra"
9
+ import { useGeodeStore } from "@ogw_front/stores/geode"
10
+ import { useViewerStore } from "@ogw_front/stores/viewer"
11
+
7
12
  beforeEach(async () => {
8
13
  const pinia = createTestingPinia({
9
14
  stubActions: false,
@@ -49,10 +54,15 @@ describe("run_function_when_microservices_connected", () => {
49
54
  test("microservices not connected", async () => {
50
55
  const geodeStore = useGeodeStore()
51
56
  const viewerStore = useViewerStore()
57
+ const infraStore = useInfraStore()
52
58
  const spy = vi.spyOn(dumb_obj, "dumb_method")
53
59
  run_function_when_microservices_connected(dumb_obj.dumb_method)
54
60
  await geodeStore.$patch({ status: Status.NOT_CONNECTED })
55
61
  await viewerStore.$patch({ status: Status.NOT_CONNECTED })
62
+ console.log("geodeStore", geodeStore.status)
63
+ console.log("viewerStore", viewerStore.status)
64
+
65
+ console.log("microservices_connected", infraStore.microservices_connected)
56
66
  expect(spy).not.toHaveBeenCalled()
57
67
  })
58
68
  })
@@ -4,6 +4,9 @@ import { createTestingPinia } from "@pinia/testing"
4
4
  import { registerEndpoint } from "@nuxt/test-utils/runtime"
5
5
  import upload_file from "@ogw_front/utils/upload_file"
6
6
  import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
7
+ import { useFeedbackStore } from "@ogw_front/stores/feedback"
8
+
9
+ import { useGeodeStore } from "@ogw_front/stores/geode"
7
10
  const schema = schemas.opengeodeweb_back.upload_file
8
11
 
9
12
  beforeEach(async () => {
@@ -14,7 +17,7 @@ beforeEach(async () => {
14
17
  setActivePinia(pinia)
15
18
  })
16
19
 
17
- describe("upload_file.js", () => {
20
+ describe("upload_file", () => {
18
21
  beforeEach(() => {
19
22
  const geodeStore = useGeodeStore()
20
23
  geodeStore.base_url = ""
@@ -29,7 +32,7 @@ describe("upload_file.js", () => {
29
32
  })
30
33
 
31
34
  test("onResponse", async () => {
32
- const feedback_store = useFeedbackStore()
35
+ const feedbackStore = useFeedbackStore()
33
36
  registerEndpoint(schema.$id, {
34
37
  method: "PUT",
35
38
  handler: () => ({ test: "ok" }),
@@ -44,7 +47,7 @@ describe("upload_file.js", () => {
44
47
  },
45
48
  },
46
49
  )
47
- expect(feedback_store.feedbacks.length).toBe(0)
50
+ expect(feedbackStore.feedbacks.length).toBe(0)
48
51
  expect(response_value).toBe("ok")
49
52
  })
50
53
  })
@@ -2,10 +2,16 @@ import { beforeEach, describe, expect, test, vi } from "vitest"
2
2
  import { createTestingPinia } from "@pinia/testing"
3
3
  import { setActivePinia } from "pinia"
4
4
 
5
- vi.mock("../../../internal/utils/viewer_call.js", () => ({
5
+ import { useTreeviewStore } from "@ogw_front/stores/treeview"
6
+ import { useAppStore } from "@ogw_front/stores/app"
7
+ import { useDataStyleStore } from "@ogw_front/stores/data_style"
8
+ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"
9
+ import { useDataBaseStore } from "@ogw_front/stores/data_base"
10
+
11
+ vi.mock("../../../internal/utils/viewer_call", () => ({
6
12
  viewer_call: vi.fn(() => Promise.resolve()),
7
13
  }))
8
- vi.mock("@/stores/hybrid_viewer.js", () => ({
14
+ vi.mock("@/stores/hybrid_viewer", () => ({
9
15
  useHybridViewerStore: () => ({
10
16
  $id: "hybridViewer",
11
17
  initHybridViewer: vi.fn(),
@@ -2,6 +2,8 @@ import { beforeEach, describe, expect, expectTypeOf, test, vi } from "vitest"
2
2
  import { createTestingPinia } from "@pinia/testing"
3
3
  import { setActivePinia } from "pinia"
4
4
 
5
+ import { useAppStore } from "@ogw_front/stores/app"
6
+
5
7
  beforeEach(async () => {
6
8
  const pinia = createTestingPinia({
7
9
  stubActions: false,
@@ -13,32 +15,32 @@ beforeEach(async () => {
13
15
  describe("App Store", () => {
14
16
  describe("state", () => {
15
17
  test("initial state", () => {
16
- const app_store = useAppStore()
17
- expectTypeOf(app_store.stores).toBeArray()
18
- expectTypeOf(app_store.exportStores).toBeFunction()
19
- expectTypeOf(app_store.importStores).toBeFunction()
20
- expectTypeOf(app_store.registerStore).toBeFunction()
18
+ const appStore = useAppStore()
19
+ expectTypeOf(appStore.stores).toBeArray()
20
+ expectTypeOf(appStore.exportStores).toBeFunction()
21
+ expectTypeOf(appStore.importStores).toBeFunction()
22
+ expectTypeOf(appStore.registerStore).toBeFunction()
21
23
  })
22
24
  })
23
25
 
24
26
  describe("actions", () => {
25
27
  describe("registerStore", () => {
26
28
  test("register single store", () => {
27
- const app_store = useAppStore()
29
+ const appStore = useAppStore()
28
30
  const mock_store = {
29
31
  $id: "testStore",
30
32
  save: vi.fn().mockImplementation(() => ({ data: "test" })),
31
33
  load: vi.fn().mockImplementation(() => {}),
32
34
  }
33
35
 
34
- app_store.registerStore(mock_store)
36
+ appStore.registerStore(mock_store)
35
37
 
36
- expect(app_store.stores.length).toBe(1)
37
- expect(app_store.stores[0]).toStrictEqual(mock_store)
38
+ expect(appStore.stores.length).toBe(1)
39
+ expect(appStore.stores[0]).toStrictEqual(mock_store)
38
40
  })
39
41
 
40
42
  test("register multiple stores", () => {
41
- const app_store = useAppStore()
43
+ const appStore = useAppStore()
42
44
  const mock_store_1 = {
43
45
  $id: "userStore",
44
46
  save: vi.fn().mockImplementation(() => {}),
@@ -50,18 +52,18 @@ describe("App Store", () => {
50
52
  load: vi.fn().mockImplementation(() => {}),
51
53
  }
52
54
 
53
- app_store.registerStore(mock_store_1)
54
- app_store.registerStore(mock_store_2)
55
+ appStore.registerStore(mock_store_1)
56
+ appStore.registerStore(mock_store_2)
55
57
 
56
- expect(app_store.stores.length).toBe(2)
57
- expect(app_store.stores[0].$id).toBe("userStore")
58
- expect(app_store.stores[1].$id).toBe("geodeStore")
58
+ expect(appStore.stores.length).toBe(2)
59
+ expect(appStore.stores[0].$id).toBe("userStore")
60
+ expect(appStore.stores[1].$id).toBe("geodeStore")
59
61
  })
60
62
  })
61
63
 
62
64
  describe("Export", () => {
63
65
  test("export stores with exportStores method", () => {
64
- const app_store = useAppStore()
66
+ const appStore = useAppStore()
65
67
  const mock_store_1 = {
66
68
  $id: "userStore",
67
69
  exportStores: vi.fn().mockImplementation(() => ({
@@ -78,10 +80,10 @@ describe("App Store", () => {
78
80
  importStores: vi.fn().mockImplementation(() => {}),
79
81
  }
80
82
 
81
- app_store.registerStore(mock_store_1)
82
- app_store.registerStore(mock_store_2)
83
+ appStore.registerStore(mock_store_1)
84
+ appStore.registerStore(mock_store_2)
83
85
 
84
- const snapshot = app_store.exportStores()
86
+ const snapshot = appStore.exportStores()
85
87
 
86
88
  expect(mock_store_1.exportStores).toHaveBeenCalledTimes(1)
87
89
  expect(mock_store_2.exportStores).toHaveBeenCalledTimes(1)
@@ -92,7 +94,7 @@ describe("App Store", () => {
92
94
  })
93
95
 
94
96
  test("skip stores without exportSave method", () => {
95
- const app_store = useAppStore()
97
+ const appStore = useAppStore()
96
98
  const mock_store_1 = {
97
99
  $id: "withSave",
98
100
  exportStores: vi.fn().mockImplementation(() => ({ data: "test" })),
@@ -103,10 +105,10 @@ describe("App Store", () => {
103
105
  importStores: vi.fn().mockImplementation(() => {}),
104
106
  }
105
107
 
106
- app_store.registerStore(mock_store_1)
107
- app_store.registerStore(mock_store_2)
108
+ appStore.registerStore(mock_store_1)
109
+ appStore.registerStore(mock_store_2)
108
110
 
109
- const snapshot = app_store.exportStores()
111
+ const snapshot = appStore.exportStores()
110
112
 
111
113
  expect(mock_store_1.exportStores).toHaveBeenCalledTimes(1)
112
114
  expect(snapshot).toEqual({
@@ -116,8 +118,8 @@ describe("App Store", () => {
116
118
  })
117
119
 
118
120
  test("return empty snapshot when no stores registered", () => {
119
- const app_store = useAppStore()
120
- const snapshot = app_store.exportStores()
121
+ const appStore = useAppStore()
122
+ const snapshot = appStore.exportStores()
121
123
  expect(snapshot).toEqual({})
122
124
  })
123
125
  })
@@ -145,7 +147,7 @@ describe("App Store", () => {
145
147
  })
146
148
 
147
149
  test("skip stores without importStores method", () => {
148
- const app_store = useAppStore()
150
+ const appStore = useAppStore()
149
151
  const mock_store_1 = {
150
152
  $id: "withImport",
151
153
  save: vi.fn().mockImplementation(() => {}),
@@ -155,19 +157,19 @@ describe("App Store", () => {
155
157
  $id: "withoutImport",
156
158
  save: vi.fn().mockImplementation(() => {}),
157
159
  }
158
- app_store.registerStore(mock_store_1)
159
- app_store.registerStore(mock_store_2)
160
+ appStore.registerStore(mock_store_1)
161
+ appStore.registerStore(mock_store_2)
160
162
  const snapshot = {
161
163
  withImport: { data: "test" },
162
164
  withoutImport: { data: "ignored" },
163
165
  }
164
- app_store.importStores(snapshot)
166
+ appStore.importStores(snapshot)
165
167
  expect(mock_store_1.importStores).toHaveBeenCalledTimes(1)
166
168
  expect(mock_store_2.importStores).toBeUndefined()
167
169
  })
168
170
 
169
171
  test("warn when store not found in snapshot", () => {
170
- const app_store = useAppStore()
172
+ const appStore = useAppStore()
171
173
  const console_warn_spy = vi
172
174
  .spyOn(console, "warn")
173
175
  .mockImplementation(() => {})
@@ -175,8 +177,8 @@ describe("App Store", () => {
175
177
  $id: "testStore",
176
178
  importStores: vi.fn().mockImplementation(() => {}),
177
179
  }
178
- app_store.registerStore(mock_store)
179
- app_store.importStores({})
180
+ appStore.registerStore(mock_store)
181
+ appStore.importStores({})
180
182
  expect(console_warn_spy).toHaveBeenCalledWith(
181
183
  expect.stringContaining("Stores not found in snapshot: testStore"),
182
184
  )