@geode/opengeodeweb-front 10.0.2-rc.1 → 10.0.2-rc.2
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/app/components/CrsSelector.vue +5 -7
- package/app/components/ExtensionSelector.vue +14 -19
- package/app/components/FileSelector.vue +5 -10
- package/app/components/FileUploader.vue +1 -0
- package/app/components/Inspector/InspectionButton.vue +8 -10
- package/app/components/MissingFilesSelector.vue +9 -19
- package/app/components/ObjectSelector.vue +3 -3
- package/app/components/PackagesVersions.vue +10 -22
- package/app/components/RemoteRenderingView.vue +12 -12
- package/app/components/Screenshot.vue +6 -7
- package/app/components/VeaseViewToolbar.vue +4 -7
- package/app/components/ViewToolbar.vue +6 -10
- package/app/components/Viewer/Options/CellAttributeSelector.vue +4 -5
- package/app/components/Viewer/Options/PolygonAttributeSelector.vue +4 -5
- package/app/components/Viewer/Options/PolyhedronAttributeSelector.vue +4 -7
- package/app/components/Viewer/Options/TextureItem.vue +6 -8
- package/app/components/Viewer/Options/VertexAttributeSelector.vue +3 -7
- package/app/composables/project_manager.js +8 -12
- package/app/stores/data_base.js +10 -16
- package/app/stores/data_style.js +3 -3
- package/app/stores/geode.js +30 -4
- package/app/stores/hybrid_viewer.js +18 -18
- package/app/stores/infra.js +58 -44
- package/app/stores/lambda.js +63 -0
- package/app/stores/viewer.js +34 -7
- package/app/utils/file_import_workflow.js +9 -8
- package/app/{composables → utils}/upload_file.js +6 -6
- package/{internal_stores → internal/stores}/mesh/cells.js +20 -20
- package/{internal_stores → internal/stores}/mesh/edges.js +12 -6
- package/{internal_stores → internal/stores}/mesh/index.js +4 -5
- package/{internal_stores → internal/stores}/mesh/points.js +16 -11
- package/{internal_stores → internal/stores}/mesh/polygons.js +20 -19
- package/{internal_stores → internal/stores}/mesh/polyhedra.js +17 -19
- package/{internal_stores → internal/stores}/model/blocks.js +8 -10
- package/{internal_stores → internal/stores}/model/corners.js +8 -10
- package/{internal_stores → internal/stores}/model/edges.js +4 -5
- package/{internal_stores → internal/stores}/model/index.js +8 -10
- package/{internal_stores → internal/stores}/model/lines.js +8 -10
- package/{internal_stores → internal/stores}/model/points.js +8 -10
- package/{internal_stores → internal/stores}/model/surfaces.js +8 -10
- package/{app/composables → internal/utils}/api_fetch.js +11 -11
- package/{app/composables → internal/utils}/viewer_call.js +5 -5
- package/nuxt.config.js +1 -1
- package/package.json +1 -1
- package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +12 -21
- package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +6 -11
- package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +3 -6
- package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +9 -16
- package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +12 -21
- package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +6 -11
- package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +6 -11
- package/tests/integration/stores/data_style/model/corners.nuxt.test.js +6 -11
- package/tests/integration/stores/data_style/model/edges.nuxt.test.js +3 -6
- package/tests/integration/stores/data_style/model/index.nuxt.test.js +3 -6
- package/tests/integration/stores/data_style/model/lines.nuxt.test.js +6 -11
- package/tests/integration/stores/data_style/model/points.nuxt.test.js +6 -12
- package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +6 -11
- package/tests/unit/components/CrsSelector.nuxt.test.js +10 -7
- package/tests/unit/components/ExtensionSelector.nuxt.test.js +17 -2
- package/tests/unit/components/FileSelector.nuxt.test.js +2 -2
- package/tests/unit/components/FileUploader.nuxt.test.js +2 -2
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +12 -7
- package/tests/unit/components/MissingFilesSelector.nuxt.test.js +20 -9
- package/tests/unit/components/ObjectSelector.nuxt.test.js +2 -2
- package/tests/unit/components/PackagesVersions.nuxt.test.js +2 -2
- package/tests/unit/composables/ProjectManager.nuxt.test.js +9 -11
- package/tests/unit/composables/api_fetch.nuxt.test.js +17 -40
- package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +27 -12
- package/tests/unit/composables/upload_file.nuxt.test.js +3 -3
- package/tests/unit/plugins/project_load.nuxt.test.js +2 -3
- package/tests/unit/stores/Geode.nuxt.test.js +47 -49
- package/tests/unit/stores/Infra.nuxt.test.js +179 -53
- package/tests/unit/stores/Lambda.nuxt.test.js +131 -0
- package/tests/unit/stores/Viewer.nuxt.test.js +48 -46
- /package/{internal_stores → internal/stores}/data_style_state.js +0 -0
- /package/tests/unit/stores/{Appstore.nuxt.test.js → App.nuxt.test.js} +0 -0
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
kill_back,
|
|
10
10
|
kill_viewer,
|
|
11
11
|
} from "@ogw_front/utils/local"
|
|
12
|
-
import * as composables from "@ogw_front/composables/viewer_call"
|
|
13
12
|
import { setupIntegrationTests } from "../../../setup.js"
|
|
14
13
|
|
|
15
14
|
// Local constants
|
|
@@ -41,13 +40,11 @@ describe("Mesh", () => {
|
|
|
41
40
|
const dataStyleStore = useDataStyleStore()
|
|
42
41
|
const viewerStore = useViewerStore()
|
|
43
42
|
const visibility = true
|
|
44
|
-
const spy = vi.spyOn(
|
|
43
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
45
44
|
await dataStyleStore.setMeshVisibility(id, visibility)
|
|
46
45
|
expect(spy).toHaveBeenCalledWith(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
params: { id, visibility },
|
|
50
|
-
},
|
|
46
|
+
mesh_schemas.visibility,
|
|
47
|
+
{ id, visibility },
|
|
51
48
|
{
|
|
52
49
|
response_function: expect.any(Function),
|
|
53
50
|
},
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
kill_back,
|
|
10
10
|
kill_viewer,
|
|
11
11
|
} from "@ogw_front/utils/local"
|
|
12
|
-
import * as composables from "@ogw_front/composables/viewer_call"
|
|
13
12
|
import { setupIntegrationTests } from "../../../setup.js"
|
|
14
13
|
|
|
15
14
|
// Local constants
|
|
@@ -41,13 +40,11 @@ describe("Mesh points", () => {
|
|
|
41
40
|
const dataStyleStore = useDataStyleStore()
|
|
42
41
|
const viewerStore = useViewerStore()
|
|
43
42
|
const visibility = true
|
|
44
|
-
const spy = vi.spyOn(
|
|
43
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
45
44
|
await dataStyleStore.setMeshPointsVisibility(id, visibility)
|
|
46
45
|
expect(spy).toHaveBeenCalledWith(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
params: { id, visibility },
|
|
50
|
-
},
|
|
46
|
+
mesh_points_schemas.visibility,
|
|
47
|
+
{ id, visibility },
|
|
51
48
|
{
|
|
52
49
|
response_function: expect.any(Function),
|
|
53
50
|
},
|
|
@@ -62,13 +59,11 @@ describe("Mesh points", () => {
|
|
|
62
59
|
const dataStyleStore = useDataStyleStore()
|
|
63
60
|
const viewerStore = useViewerStore()
|
|
64
61
|
const color = { r: 255, g: 0, b: 0 }
|
|
65
|
-
const spy = vi.spyOn(
|
|
62
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
66
63
|
await dataStyleStore.setMeshPointsColor(id, color)
|
|
67
64
|
expect(spy).toHaveBeenCalledWith(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
params: { id, color },
|
|
71
|
-
},
|
|
65
|
+
mesh_points_schemas.color,
|
|
66
|
+
{ id, color },
|
|
72
67
|
{
|
|
73
68
|
response_function: expect.any(Function),
|
|
74
69
|
},
|
|
@@ -98,13 +93,11 @@ describe("Mesh points", () => {
|
|
|
98
93
|
const dataStyleStore = useDataStyleStore()
|
|
99
94
|
const viewerStore = useViewerStore()
|
|
100
95
|
const size = 20
|
|
101
|
-
const spy = vi.spyOn(
|
|
96
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
102
97
|
await dataStyleStore.setMeshPointsSize(id, size)
|
|
103
98
|
expect(spy).toHaveBeenCalledWith(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
params: { id, size },
|
|
107
|
-
},
|
|
99
|
+
mesh_points_schemas.size,
|
|
100
|
+
{ id, size },
|
|
108
101
|
{
|
|
109
102
|
response_function: expect.any(Function),
|
|
110
103
|
},
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
kill_back,
|
|
10
10
|
kill_viewer,
|
|
11
11
|
} from "@ogw_front/utils/local"
|
|
12
|
-
import * as composables from "@ogw_front/composables/viewer_call"
|
|
13
12
|
import { setupIntegrationTests } from "../../../setup.js"
|
|
14
13
|
|
|
15
14
|
// Local constants
|
|
@@ -42,13 +41,11 @@ describe("Mesh polygons", () => {
|
|
|
42
41
|
const dataStyleStore = useDataStyleStore()
|
|
43
42
|
const viewerStore = useViewerStore()
|
|
44
43
|
const visibility = true
|
|
45
|
-
const spy = vi.spyOn(
|
|
44
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
46
45
|
await dataStyleStore.setMeshPolygonsVisibility(id, visibility)
|
|
47
46
|
expect(spy).toHaveBeenCalledWith(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
params: { id, visibility },
|
|
51
|
-
},
|
|
47
|
+
mesh_polygons_schemas.visibility,
|
|
48
|
+
{ id, visibility },
|
|
52
49
|
{
|
|
53
50
|
response_function: expect.any(Function),
|
|
54
51
|
},
|
|
@@ -63,13 +60,11 @@ describe("Mesh polygons", () => {
|
|
|
63
60
|
const dataStyleStore = useDataStyleStore()
|
|
64
61
|
const viewerStore = useViewerStore()
|
|
65
62
|
const color = { r: 255, g: 0, b: 0 }
|
|
66
|
-
const spy = vi.spyOn(
|
|
63
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
67
64
|
await dataStyleStore.setMeshPolygonsColor(id, color)
|
|
68
65
|
expect(spy).toHaveBeenCalledWith(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
params: { id, color },
|
|
72
|
-
},
|
|
66
|
+
mesh_polygons_schemas.color,
|
|
67
|
+
{ id, color },
|
|
73
68
|
{
|
|
74
69
|
response_function: expect.any(Function),
|
|
75
70
|
},
|
|
@@ -84,13 +79,11 @@ describe("Mesh polygons", () => {
|
|
|
84
79
|
const dataStyleStore = useDataStyleStore()
|
|
85
80
|
const viewerStore = useViewerStore()
|
|
86
81
|
const vertex_attribute = { name: "points" }
|
|
87
|
-
const spy = vi.spyOn(
|
|
82
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
88
83
|
await dataStyleStore.setMeshPolygonsVertexAttribute(id, vertex_attribute)
|
|
89
84
|
expect(spy).toHaveBeenCalledWith(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
params: { id, ...vertex_attribute },
|
|
93
|
-
},
|
|
85
|
+
mesh_polygons_schemas.vertex_attribute,
|
|
86
|
+
{ id, ...vertex_attribute },
|
|
94
87
|
{
|
|
95
88
|
response_function: expect.any(Function),
|
|
96
89
|
},
|
|
@@ -107,16 +100,14 @@ describe("Mesh polygons", () => {
|
|
|
107
100
|
const dataStyleStore = useDataStyleStore()
|
|
108
101
|
const viewerStore = useViewerStore()
|
|
109
102
|
const polygon_attribute = { name: "test_attribute" }
|
|
110
|
-
const spy = vi.spyOn(
|
|
103
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
111
104
|
await dataStyleStore.setMeshPolygonsPolygonAttribute(
|
|
112
105
|
id,
|
|
113
106
|
polygon_attribute,
|
|
114
107
|
)
|
|
115
108
|
expect(spy).toHaveBeenCalledWith(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
params: { id, ...polygon_attribute },
|
|
119
|
-
},
|
|
109
|
+
mesh_polygons_schemas.polygon_attribute,
|
|
110
|
+
{ id, ...polygon_attribute },
|
|
120
111
|
{
|
|
121
112
|
response_function: expect.any(Function),
|
|
122
113
|
},
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
kill_back,
|
|
10
10
|
kill_viewer,
|
|
11
11
|
} from "@ogw_front/utils/local"
|
|
12
|
-
import * as composables from "@ogw_front/composables/viewer_call"
|
|
13
12
|
import { setupIntegrationTests } from "../../../setup.js"
|
|
14
13
|
|
|
15
14
|
// Local constants
|
|
@@ -41,13 +40,11 @@ describe("Mesh polyhedra", () => {
|
|
|
41
40
|
const dataStyleStore = useDataStyleStore()
|
|
42
41
|
const viewerStore = useViewerStore()
|
|
43
42
|
const visibility = true
|
|
44
|
-
const spy = vi.spyOn(
|
|
43
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
45
44
|
await dataStyleStore.setMeshPolyhedraVisibility(id, visibility)
|
|
46
45
|
expect(spy).toHaveBeenCalledWith(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
params: { id, visibility },
|
|
50
|
-
},
|
|
46
|
+
mesh_polyhedra_schemas.visibility,
|
|
47
|
+
{ id, visibility },
|
|
51
48
|
{
|
|
52
49
|
response_function: expect.any(Function),
|
|
53
50
|
},
|
|
@@ -75,13 +72,11 @@ describe("Mesh polyhedra", () => {
|
|
|
75
72
|
const dataStyleStore = useDataStyleStore()
|
|
76
73
|
const viewerStore = useViewerStore()
|
|
77
74
|
const color = { r: 255, g: 0, b: 0 }
|
|
78
|
-
const spy = vi.spyOn(
|
|
75
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
79
76
|
await dataStyleStore.setMeshPolyhedraColor(id, color)
|
|
80
77
|
expect(spy).toHaveBeenCalledWith(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
params: { id, color },
|
|
84
|
-
},
|
|
78
|
+
mesh_polyhedra_schemas.color,
|
|
79
|
+
{ id, color },
|
|
85
80
|
{
|
|
86
81
|
response_function: expect.any(Function),
|
|
87
82
|
},
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
kill_back,
|
|
10
10
|
kill_viewer,
|
|
11
11
|
} from "@ogw_front/utils/local"
|
|
12
|
-
import * as composables from "@ogw_front/composables/viewer_call"
|
|
13
12
|
import { setupIntegrationTests } from "../../../setup.js"
|
|
14
13
|
|
|
15
14
|
// Local constants
|
|
@@ -44,13 +43,11 @@ describe("Model blocks", () => {
|
|
|
44
43
|
const block_ids = dataBaseStore.getBlocksUuids(id)
|
|
45
44
|
const block_flat_indexes = dataBaseStore.getFlatIndexes(id, block_ids)
|
|
46
45
|
const visibility = false
|
|
47
|
-
const spy = vi.spyOn(
|
|
46
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
48
47
|
await dataStyleStore.setModelBlocksVisibility(id, block_ids, visibility)
|
|
49
48
|
expect(spy).toHaveBeenCalledWith(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
params: { id, block_ids: block_flat_indexes, visibility },
|
|
53
|
-
},
|
|
49
|
+
model_blocks_schemas.visibility,
|
|
50
|
+
{ id, block_ids: block_flat_indexes, visibility },
|
|
54
51
|
{
|
|
55
52
|
response_function: expect.any(Function),
|
|
56
53
|
},
|
|
@@ -72,13 +69,11 @@ describe("Model blocks", () => {
|
|
|
72
69
|
// const block_ids = dataBaseStore.getBlocksUuids(id)
|
|
73
70
|
// const block_flat_indexes = dataBaseStore.getFlatIndexes(id, block_ids)
|
|
74
71
|
// const color = { r: 255, g: 0, b: 0 }
|
|
75
|
-
// const spy = vi.spyOn(
|
|
72
|
+
// const spy = vi.spyOn(viewerStore, "request")
|
|
76
73
|
// await dataStyleStore.setModelBlocksColor(id, block_ids, color)
|
|
77
74
|
// expect(spy).toHaveBeenCalledWith(
|
|
78
|
-
//
|
|
79
|
-
//
|
|
80
|
-
// params: { id, block_ids: block_flat_indexes, color },
|
|
81
|
-
// },
|
|
75
|
+
// model_blocks_schemas.color,
|
|
76
|
+
// { id, block_ids: block_flat_indexes, color },
|
|
82
77
|
// {
|
|
83
78
|
// response_function: expect.any(Function),
|
|
84
79
|
// },
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
kill_back,
|
|
10
10
|
kill_viewer,
|
|
11
11
|
} from "@ogw_front/utils/local"
|
|
12
|
-
import * as composables from "@ogw_front/composables/viewer_call"
|
|
13
12
|
import { setupIntegrationTests } from "../../../setup.js"
|
|
14
13
|
|
|
15
14
|
// Local constants
|
|
@@ -44,13 +43,11 @@ describe("Model corners", () => {
|
|
|
44
43
|
const corner_ids = dataBaseStore.getCornersUuids(id)
|
|
45
44
|
const corner_flat_indexes = dataBaseStore.getFlatIndexes(id, corner_ids)
|
|
46
45
|
const visibility = false
|
|
47
|
-
const spy = vi.spyOn(
|
|
46
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
48
47
|
await dataStyleStore.setModelCornersVisibility(id, corner_ids, visibility)
|
|
49
48
|
expect(spy).toHaveBeenCalledWith(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
params: { id, block_ids: corner_flat_indexes, visibility },
|
|
53
|
-
},
|
|
49
|
+
model_corners_schemas.visibility,
|
|
50
|
+
{ id, block_ids: corner_flat_indexes, visibility },
|
|
54
51
|
{
|
|
55
52
|
response_function: expect.any(Function),
|
|
56
53
|
},
|
|
@@ -72,13 +69,11 @@ describe("Model corners", () => {
|
|
|
72
69
|
const corner_ids = dataBaseStore.getCornersUuids(id)
|
|
73
70
|
const corner_flat_indexes = dataBaseStore.getFlatIndexes(id, corner_ids)
|
|
74
71
|
const color = { r: 255, g: 0, b: 0 }
|
|
75
|
-
const spy = vi.spyOn(
|
|
72
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
76
73
|
await dataStyleStore.setModelCornersColor(id, corner_ids, color)
|
|
77
74
|
expect(spy).toHaveBeenCalledWith(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
params: { id, block_ids: corner_flat_indexes, color },
|
|
81
|
-
},
|
|
75
|
+
model_corners_schemas.color,
|
|
76
|
+
{ id, block_ids: corner_flat_indexes, color },
|
|
82
77
|
{
|
|
83
78
|
response_function: expect.any(Function),
|
|
84
79
|
},
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
kill_back,
|
|
10
10
|
kill_viewer,
|
|
11
11
|
} from "@ogw_front/utils/local"
|
|
12
|
-
import * as composables from "@ogw_front/composables/viewer_call"
|
|
13
12
|
import { setupIntegrationTests } from "../../../setup.js"
|
|
14
13
|
|
|
15
14
|
// Local constants
|
|
@@ -41,13 +40,11 @@ describe("Model edges", () => {
|
|
|
41
40
|
const dataStyleStore = useDataStyleStore()
|
|
42
41
|
const viewerStore = useViewerStore()
|
|
43
42
|
const visibility = true
|
|
44
|
-
const spy = vi.spyOn(
|
|
43
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
45
44
|
await dataStyleStore.setModelEdgesVisibility(id, visibility)
|
|
46
45
|
expect(spy).toHaveBeenCalledWith(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
params: { id, visibility },
|
|
50
|
-
},
|
|
46
|
+
model_edges_schemas.visibility,
|
|
47
|
+
{ id, visibility },
|
|
51
48
|
{
|
|
52
49
|
response_function: expect.any(Function),
|
|
53
50
|
},
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
kill_back,
|
|
10
10
|
kill_viewer,
|
|
11
11
|
} from "@ogw_front/utils/local"
|
|
12
|
-
import * as composables from "@ogw_front/composables/viewer_call"
|
|
13
12
|
import { setupIntegrationTests } from "../../../setup.js"
|
|
14
13
|
|
|
15
14
|
// Local constants
|
|
@@ -41,13 +40,11 @@ describe("Model", () => {
|
|
|
41
40
|
const dataStyleStore = useDataStyleStore()
|
|
42
41
|
const viewerStore = useViewerStore()
|
|
43
42
|
const visibility = true
|
|
44
|
-
const spy = vi.spyOn(
|
|
43
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
45
44
|
await dataStyleStore.setModelVisibility(id, visibility)
|
|
46
45
|
expect(spy).toHaveBeenCalledWith(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
params: { id, visibility },
|
|
50
|
-
},
|
|
46
|
+
model_schemas.visibility,
|
|
47
|
+
{ id, visibility },
|
|
51
48
|
{
|
|
52
49
|
response_function: expect.any(Function),
|
|
53
50
|
},
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
kill_back,
|
|
10
10
|
kill_viewer,
|
|
11
11
|
} from "@ogw_front/utils/local"
|
|
12
|
-
import * as composables from "@ogw_front/composables/viewer_call"
|
|
13
12
|
import { setupIntegrationTests } from "../../../setup.js"
|
|
14
13
|
|
|
15
14
|
// Local constants
|
|
@@ -40,13 +39,11 @@ describe("Model lines", () => {
|
|
|
40
39
|
const line_ids = dataBaseStore.getLinesUuids(id)
|
|
41
40
|
const lines_flat_indexes = dataBaseStore.getFlatIndexes(id, line_ids)
|
|
42
41
|
const visibility = false
|
|
43
|
-
const spy = vi.spyOn(
|
|
42
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
44
43
|
await dataStyleStore.setModelLinesVisibility(id, line_ids, visibility)
|
|
45
44
|
expect(spy).toHaveBeenCalledWith(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
params: { id, block_ids: lines_flat_indexes, visibility },
|
|
49
|
-
},
|
|
45
|
+
model_lines_schemas.visibility,
|
|
46
|
+
{ id, block_ids: lines_flat_indexes, visibility },
|
|
50
47
|
{
|
|
51
48
|
response_function: expect.any(Function),
|
|
52
49
|
},
|
|
@@ -66,13 +63,11 @@ describe("Model lines", () => {
|
|
|
66
63
|
const line_ids = dataBaseStore.getLinesUuids(id)
|
|
67
64
|
const lines_flat_indexes = dataBaseStore.getFlatIndexes(id, line_ids)
|
|
68
65
|
const color = { r: 255, g: 0, b: 0 }
|
|
69
|
-
const spy = vi.spyOn(
|
|
66
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
70
67
|
await dataStyleStore.setModelLinesColor(id, line_ids, color)
|
|
71
68
|
expect(spy).toHaveBeenCalledWith(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
params: { id, block_ids: lines_flat_indexes, color },
|
|
75
|
-
},
|
|
69
|
+
model_lines_schemas.color,
|
|
70
|
+
{ id, block_ids: lines_flat_indexes, color },
|
|
76
71
|
{
|
|
77
72
|
response_function: expect.any(Function),
|
|
78
73
|
},
|
|
@@ -4,8 +4,6 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schem
|
|
|
4
4
|
|
|
5
5
|
// Local imports
|
|
6
6
|
import Status from "@ogw_front/utils/status"
|
|
7
|
-
import * as composables from "@ogw_front/composables/viewer_call"
|
|
8
|
-
import { useDataStyleStore } from "@ogw_front/stores/data_style"
|
|
9
7
|
import { useViewerStore } from "@ogw_front/stores/viewer"
|
|
10
8
|
import {
|
|
11
9
|
delete_folder_recursive,
|
|
@@ -38,13 +36,11 @@ describe("Model points", () => {
|
|
|
38
36
|
const dataStyleStore = useDataStyleStore()
|
|
39
37
|
const viewerStore = useViewerStore()
|
|
40
38
|
const visibility = true
|
|
41
|
-
const spy = vi.spyOn(
|
|
39
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
42
40
|
await dataStyleStore.setModelPointsVisibility(id, visibility)
|
|
43
41
|
expect(spy).toHaveBeenCalledWith(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
params: { id, visibility },
|
|
47
|
-
},
|
|
42
|
+
model_points_schemas.visibility,
|
|
43
|
+
{ id, visibility },
|
|
48
44
|
{
|
|
49
45
|
response_function: expect.any(Function),
|
|
50
46
|
},
|
|
@@ -59,13 +55,11 @@ describe("Model points", () => {
|
|
|
59
55
|
const dataStyleStore = useDataStyleStore()
|
|
60
56
|
const viewerStore = useViewerStore()
|
|
61
57
|
const size = 20
|
|
62
|
-
const spy = vi.spyOn(
|
|
58
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
63
59
|
await dataStyleStore.setModelPointsSize(id, size)
|
|
64
60
|
expect(spy).toHaveBeenCalledWith(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
params: { id, size },
|
|
68
|
-
},
|
|
61
|
+
model_points_schemas.size,
|
|
62
|
+
{ id, size },
|
|
69
63
|
{
|
|
70
64
|
response_function: expect.any(Function),
|
|
71
65
|
},
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
kill_back,
|
|
10
10
|
kill_viewer,
|
|
11
11
|
} from "@ogw_front/utils/local"
|
|
12
|
-
import * as composables from "@ogw_front/composables/viewer_call"
|
|
13
12
|
import { setupIntegrationTests } from "../../../setup.js"
|
|
14
13
|
|
|
15
14
|
// Local constants
|
|
@@ -44,17 +43,15 @@ describe("Model surfaces", () => {
|
|
|
44
43
|
const surface_ids = dataBaseStore.getSurfacesUuids(id)
|
|
45
44
|
const surface_flat_indexes = dataBaseStore.getFlatIndexes(id, surface_ids)
|
|
46
45
|
const visibility = true
|
|
47
|
-
const spy = vi.spyOn(
|
|
46
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
48
47
|
await dataStyleStore.setModelSurfacesVisibility(
|
|
49
48
|
id,
|
|
50
49
|
surface_ids,
|
|
51
50
|
visibility,
|
|
52
51
|
)
|
|
53
52
|
expect(spy).toHaveBeenCalledWith(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
params: { id, block_ids: surface_flat_indexes, visibility },
|
|
57
|
-
},
|
|
53
|
+
model_surfaces_schemas.visibility,
|
|
54
|
+
{ id, block_ids: surface_flat_indexes, visibility },
|
|
58
55
|
{
|
|
59
56
|
response_function: expect.any(Function),
|
|
60
57
|
},
|
|
@@ -76,13 +73,11 @@ describe("Model surfaces", () => {
|
|
|
76
73
|
const surface_ids = dataBaseStore.getSurfacesUuids(id)
|
|
77
74
|
const surface_flat_indexes = dataBaseStore.getFlatIndexes(id, surface_ids)
|
|
78
75
|
const color = { r: 255, g: 0, b: 0 }
|
|
79
|
-
const spy = vi.spyOn(
|
|
76
|
+
const spy = vi.spyOn(viewerStore, "request")
|
|
80
77
|
await dataStyleStore.setModelSurfacesColor(id, surface_ids, color)
|
|
81
78
|
expect(spy).toHaveBeenCalledWith(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
params: { id, block_ids: surface_flat_indexes, color },
|
|
85
|
-
},
|
|
79
|
+
model_surfaces_schemas.color,
|
|
80
|
+
{ id, block_ids: surface_flat_indexes, color },
|
|
86
81
|
{
|
|
87
82
|
response_function: expect.any(Function),
|
|
88
83
|
},
|
|
@@ -24,8 +24,8 @@ describe("CrsSelector.vue", () => {
|
|
|
24
24
|
createSpy: vi.fn,
|
|
25
25
|
})
|
|
26
26
|
setActivePinia(pinia)
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const geodeStore = useGeodeStore()
|
|
28
|
+
geodeStore.base_url = ""
|
|
29
29
|
|
|
30
30
|
test(`Default behavior`, async () => {
|
|
31
31
|
const crs_list = [
|
|
@@ -35,12 +35,15 @@ describe("CrsSelector.vue", () => {
|
|
|
35
35
|
name: "Anguilla 1957 / British West Indies Grid",
|
|
36
36
|
},
|
|
37
37
|
]
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
|
|
39
|
+
// Mock geodeStore.request instead of registerEndpoint
|
|
40
|
+
geodeStore.request = vi.fn((schema, params, callbacks) => {
|
|
41
|
+
if (callbacks?.response_function) {
|
|
42
|
+
callbacks.response_function({ _data: { crs_list } })
|
|
43
|
+
}
|
|
44
|
+
return Promise.resolve({ _data: { crs_list } })
|
|
43
45
|
})
|
|
46
|
+
|
|
44
47
|
const key_to_update = "key"
|
|
45
48
|
const wrapper = await mountSuspended(CrsSelector, {
|
|
46
49
|
global: {
|
|
@@ -24,8 +24,23 @@ describe("ExtensionSelector.vue", async () => {
|
|
|
24
24
|
createSpy: vi.fn,
|
|
25
25
|
})
|
|
26
26
|
setActivePinia(pinia)
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const geodeStore = useGeodeStore()
|
|
28
|
+
geodeStore.base_url = ""
|
|
29
|
+
|
|
30
|
+
// Mock the request method to simulate API call
|
|
31
|
+
geodeStore.request = vi.fn((schema, params, callbacks) => {
|
|
32
|
+
const response = {
|
|
33
|
+
_data: {
|
|
34
|
+
geode_objects_and_output_extensions: {
|
|
35
|
+
BRep: { msh: { is_saveable: true } },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
if (callbacks?.response_function) {
|
|
40
|
+
callbacks.response_function(response)
|
|
41
|
+
}
|
|
42
|
+
return Promise.resolve(response)
|
|
43
|
+
})
|
|
29
44
|
|
|
30
45
|
test(`Select geode_object & extension`, async () => {
|
|
31
46
|
const output_geode_object = "BRep"
|
|
@@ -28,8 +28,8 @@ describe("FileSelector.vue", async () => {
|
|
|
28
28
|
createSpy: vi.fn,
|
|
29
29
|
})
|
|
30
30
|
setActivePinia(pinia)
|
|
31
|
-
const
|
|
32
|
-
|
|
31
|
+
const geodeStore = useGeodeStore()
|
|
32
|
+
geodeStore.base_url = ""
|
|
33
33
|
|
|
34
34
|
test(`Select file`, async () => {
|
|
35
35
|
registerEndpoint(allowed_files_schema.$id, {
|
|
@@ -25,8 +25,8 @@ describe("FileUploader.vue", async () => {
|
|
|
25
25
|
createSpy: vi.fn,
|
|
26
26
|
})
|
|
27
27
|
setActivePinia(pinia)
|
|
28
|
-
const
|
|
29
|
-
|
|
28
|
+
const geodeStore = useGeodeStore()
|
|
29
|
+
geodeStore.base_url = ""
|
|
30
30
|
|
|
31
31
|
registerEndpoint(upload_file_schema.$id, {
|
|
32
32
|
method: upload_file_schema.methods[0],
|
|
@@ -23,8 +23,8 @@ describe("Inspector/InspectionButton.vue", async () => {
|
|
|
23
23
|
createSpy: vi.fn,
|
|
24
24
|
})
|
|
25
25
|
setActivePinia(pinia)
|
|
26
|
-
const
|
|
27
|
-
|
|
26
|
+
const geodeStore = useGeodeStore()
|
|
27
|
+
geodeStore.base_url = ""
|
|
28
28
|
|
|
29
29
|
test(`Test with issues`, async () => {
|
|
30
30
|
var inspection_result = {
|
|
@@ -44,12 +44,17 @@ describe("Inspector/InspectionButton.vue", async () => {
|
|
|
44
44
|
],
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
geodeStore.request = vi.fn((schema, params, callbacks) => {
|
|
48
|
+
if (callbacks?.response_function) {
|
|
49
|
+
callbacks.response_function({
|
|
50
|
+
_data: { inspection_result },
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
return Promise.resolve({
|
|
54
|
+
_data: { inspection_result },
|
|
55
|
+
})
|
|
52
56
|
})
|
|
57
|
+
|
|
53
58
|
const geode_object_type = "BRep"
|
|
54
59
|
const filename = "test.txt"
|
|
55
60
|
|
|
@@ -27,18 +27,29 @@ describe("MissingFilesSelector.vue", async () => {
|
|
|
27
27
|
createSpy: vi.fn,
|
|
28
28
|
})
|
|
29
29
|
setActivePinia(pinia)
|
|
30
|
-
const
|
|
31
|
-
|
|
30
|
+
const geodeStore = useGeodeStore()
|
|
31
|
+
geodeStore.base_url = ""
|
|
32
32
|
|
|
33
33
|
test(`Select file`, async () => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
geodeStore.request = vi.fn((schema, params, callbacks) => {
|
|
35
|
+
if (callbacks?.response_function) {
|
|
36
|
+
callbacks.response_function({
|
|
37
|
+
_data: {
|
|
38
|
+
has_missing_files: true,
|
|
39
|
+
mandatory_files: ["fake_file.txt"],
|
|
40
|
+
additional_files: ["fake_file_2.txt"],
|
|
41
|
+
},
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
return Promise.resolve({
|
|
45
|
+
_data: {
|
|
46
|
+
has_missing_files: true,
|
|
47
|
+
mandatory_files: ["fake_file.txt"],
|
|
48
|
+
additional_files: ["fake_file_2.txt"],
|
|
49
|
+
},
|
|
50
|
+
})
|
|
41
51
|
})
|
|
52
|
+
|
|
42
53
|
const wrapper = await mountSuspended(MissingFilesSelector, {
|
|
43
54
|
global: {
|
|
44
55
|
plugins: [vuetify, pinia],
|
|
@@ -25,8 +25,8 @@ describe("ObjectSelector.vue", async () => {
|
|
|
25
25
|
createSpy: vi.fn,
|
|
26
26
|
})
|
|
27
27
|
setActivePinia(pinia)
|
|
28
|
-
const
|
|
29
|
-
|
|
28
|
+
const geodeStore = useGeodeStore()
|
|
29
|
+
geodeStore.base_url = ""
|
|
30
30
|
|
|
31
31
|
test(`test loadable with one class`, async () => {
|
|
32
32
|
var response = {
|
|
@@ -21,8 +21,8 @@ describe("PackagesVersions.vue", async () => {
|
|
|
21
21
|
createSpy: vi.fn,
|
|
22
22
|
})
|
|
23
23
|
setActivePinia(pinia)
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const geodeStore = useGeodeStore()
|
|
25
|
+
geodeStore.base_url = ""
|
|
26
26
|
|
|
27
27
|
const schema = {
|
|
28
28
|
$id: "/versions",
|