@geode/opengeodeweb-front 10.6.2 → 10.6.3-rc.1
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/.eslintrc.cjs +1 -1
- package/.oxlintrc.json +3 -22
- package/app/assets/geode_objects.js +26 -26
- package/app/components/Carousel.vue +62 -66
- package/app/components/CrsSelector.vue +48 -52
- package/app/components/DeleteDialog.vue +21 -37
- package/app/components/DragAndDrop.vue +35 -41
- package/app/components/ExtensionSelector.vue +50 -63
- package/app/components/FeedBack/ErrorBanner.vue +7 -10
- package/app/components/FeedBack/Snackers.vue +12 -14
- package/app/components/FetchingData.vue +1 -6
- package/app/components/FileSelector.vue +41 -47
- package/app/components/FileUploader.vue +62 -79
- package/app/components/GlassCard.vue +19 -19
- package/app/components/HybridRenderingView.vue +37 -38
- package/app/components/InfraConnected.vue +3 -3
- package/app/components/Inspector/InspectionButton.vue +27 -31
- package/app/components/Inspector/ResultPanel.vue +13 -24
- package/app/components/Launcher.vue +13 -13
- package/app/components/Loading.vue +63 -69
- package/app/components/MissingFilesSelector.vue +53 -73
- package/app/components/ObjectSelector.vue +81 -99
- package/app/components/PackagesVersions.vue +27 -30
- package/app/components/Recaptcha.vue +60 -71
- package/app/components/RemoteRenderingView.vue +102 -108
- package/app/components/Screenshot.vue +36 -42
- package/app/components/SearchBar.vue +5 -5
- package/app/components/Step.vue +37 -44
- package/app/components/Stepper.vue +29 -35
- package/app/components/VeaseViewToolbar.vue +69 -78
- package/app/components/ViewToolbar.vue +41 -45
- package/app/components/Viewer/BreadCrumb.vue +18 -30
- package/app/components/Viewer/ContextMenu.vue +176 -179
- package/app/components/Viewer/ContextMenuItem.vue +105 -117
- package/app/components/Viewer/EdgedCurve/PointsOptions.vue +6 -9
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +82 -93
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +84 -99
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +83 -98
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +62 -73
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +84 -108
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +82 -105
- package/app/components/Viewer/Generic/Model/EdgesOptions.vue +19 -23
- package/app/components/Viewer/Generic/Model/PointsOptions.vue +26 -30
- package/app/components/Viewer/Grid/2D/CellsOptions.vue +5 -5
- package/app/components/Viewer/Grid/2D/EdgesOptions.vue +6 -9
- package/app/components/Viewer/Grid/2D/PointsOptions.vue +6 -9
- package/app/components/Viewer/Grid/3D/CellsOptions.vue +5 -5
- package/app/components/Viewer/Grid/3D/EdgesOptions.vue +6 -9
- package/app/components/Viewer/Grid/3D/FacetsOptions.vue +5 -5
- package/app/components/Viewer/Grid/3D/PointsOptions.vue +6 -9
- package/app/components/Viewer/HybridSolid/EdgesOptions.vue +6 -9
- package/app/components/Viewer/HybridSolid/PointsOptions.vue +6 -9
- package/app/components/Viewer/HybridSolid/PolygonsOptions.vue +6 -9
- package/app/components/Viewer/HybridSolid/PolyhedraOptions.vue +6 -9
- package/app/components/Viewer/Options/AttributeColorBar.vue +8 -8
- package/app/components/Viewer/Options/AttributeSelector.vue +73 -78
- package/app/components/Viewer/Options/ColorMapList.vue +115 -140
- package/app/components/Viewer/Options/ColorMapPicker.vue +128 -142
- package/app/components/Viewer/Options/ColorPicker.vue +9 -9
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +77 -91
- package/app/components/Viewer/Options/TextureItem.vue +54 -58
- package/app/components/Viewer/Options/TexturesSelector.vue +22 -26
- package/app/components/Viewer/Options/VisibilitySwitch.vue +1 -1
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +61 -68
- package/app/components/Viewer/PolygonalSurface/EdgesOptions.vue +6 -9
- package/app/components/Viewer/PolygonalSurface/PointsOptions.vue +6 -9
- package/app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue +83 -103
- package/app/components/Viewer/Solid/EdgesOptions.vue +6 -9
- package/app/components/Viewer/Solid/PointsOptions.vue +6 -9
- package/app/components/Viewer/Solid/PolygonsOptions.vue +6 -9
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +82 -105
- package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +5 -5
- package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +5 -5
- package/app/components/Viewer/Tree/ObjectTree.vue +80 -89
- package/app/components/Viewer/TreeComponent.vue +43 -49
- package/app/components/Viewer/TreeObject.vue +48 -50
- package/app/components/Viewer/TriangulatedSurface/EdgesOptions.vue +6 -9
- package/app/components/Viewer/TriangulatedSurface/PointsOptions.vue +5 -5
- package/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue +5 -5
- package/app/components/Wrapper.vue +8 -8
- package/app/components/ZScaling.vue +18 -27
- package/app/composables/project_manager.js +57 -67
- package/app/composables/run_function_when_microservices_connected.js +8 -8
- package/app/plugins/auto_store_register.js +11 -13
- package/app/stores/app.js +118 -138
- package/app/stores/data.js +52 -68
- package/app/stores/data_style.js +36 -36
- package/app/stores/feedback.js +17 -20
- package/app/stores/geode.js +54 -55
- package/app/stores/hybrid_viewer.js +164 -177
- package/app/stores/infra.js +45 -55
- package/app/stores/lambda.js +26 -26
- package/app/stores/menu.js +78 -85
- package/app/stores/treeview.js +57 -65
- package/app/stores/viewer.js +92 -104
- package/app/utils/colormap.js +3 -3
- package/app/utils/config.js +16 -22
- package/app/utils/default_styles.js +50 -62
- package/app/utils/extension.js +44 -44
- package/app/utils/file_import_workflow.js +50 -64
- package/app/utils/local/app_mode.js +2 -2
- package/app/utils/local/cleanup.js +66 -72
- package/app/utils/local/microservices.js +61 -71
- package/app/utils/local/path.js +16 -19
- package/app/utils/local/scripts.js +22 -22
- package/app/utils/recaptcha.js +6 -6
- package/app/utils/server.js +21 -24
- package/app/utils/status.js +2 -2
- package/app/utils/treeview.js +4 -4
- package/app/utils/validate_schema.js +7 -7
- package/commitlint.config.js +2 -2
- package/eslint.config.js +4 -4
- package/internal/database/database.js +38 -46
- package/internal/database/extended_database.js +9 -10
- package/internal/database/tables/data.js +2 -3
- package/internal/database/tables/model_components.js +1 -1
- package/internal/database/tables/model_components_relation.js +1 -1
- package/internal/stores/data_style/mesh/cells/cell.js +47 -63
- package/internal/stores/data_style/mesh/cells/color.js +11 -16
- package/internal/stores/data_style/mesh/cells/common.js +6 -6
- package/internal/stores/data_style/mesh/cells/index.js +37 -47
- package/internal/stores/data_style/mesh/cells/textures.js +11 -12
- package/internal/stores/data_style/mesh/cells/vertex.js +47 -58
- package/internal/stores/data_style/mesh/cells/visibility.js +11 -16
- package/internal/stores/data_style/mesh/edges/color.js +11 -16
- package/internal/stores/data_style/mesh/edges/common.js +6 -6
- package/internal/stores/data_style/mesh/edges/edge.js +47 -63
- package/internal/stores/data_style/mesh/edges/index.js +38 -52
- package/internal/stores/data_style/mesh/edges/vertex.js +47 -58
- package/internal/stores/data_style/mesh/edges/visibility.js +11 -16
- package/internal/stores/data_style/mesh/edges/width.js +11 -16
- package/internal/stores/data_style/mesh/index.js +34 -34
- package/internal/stores/data_style/mesh/points/color.js +11 -16
- package/internal/stores/data_style/mesh/points/common.js +6 -6
- package/internal/stores/data_style/mesh/points/index.js +35 -49
- package/internal/stores/data_style/mesh/points/size.js +11 -16
- package/internal/stores/data_style/mesh/points/vertex.js +47 -58
- package/internal/stores/data_style/mesh/points/visibility.js +11 -16
- package/internal/stores/data_style/mesh/polygons/color.js +11 -16
- package/internal/stores/data_style/mesh/polygons/common.js +6 -6
- package/internal/stores/data_style/mesh/polygons/index.js +36 -45
- package/internal/stores/data_style/mesh/polygons/polygon.js +45 -56
- package/internal/stores/data_style/mesh/polygons/textures.js +11 -16
- package/internal/stores/data_style/mesh/polygons/vertex.js +47 -58
- package/internal/stores/data_style/mesh/polygons/visibility.js +11 -16
- package/internal/stores/data_style/mesh/polyhedra/color.js +11 -16
- package/internal/stores/data_style/mesh/polyhedra/common.js +6 -6
- package/internal/stores/data_style/mesh/polyhedra/index.js +29 -42
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +43 -47
- package/internal/stores/data_style/mesh/polyhedra/vertex.js +47 -58
- package/internal/stores/data_style/mesh/polyhedra/visibility.js +11 -17
- package/internal/stores/data_style/model/blocks/color.js +21 -24
- package/internal/stores/data_style/model/blocks/common.js +6 -6
- package/internal/stores/data_style/model/blocks/index.js +13 -17
- package/internal/stores/data_style/model/blocks/visibility.js +21 -24
- package/internal/stores/data_style/model/corners/color.js +21 -24
- package/internal/stores/data_style/model/corners/common.js +6 -6
- package/internal/stores/data_style/model/corners/index.js +14 -18
- package/internal/stores/data_style/model/corners/visibility.js +21 -25
- package/internal/stores/data_style/model/edges/common.js +4 -4
- package/internal/stores/data_style/model/edges/index.js +7 -7
- package/internal/stores/data_style/model/edges/visibility.js +11 -15
- package/internal/stores/data_style/model/index.js +84 -100
- package/internal/stores/data_style/model/lines/color.js +21 -24
- package/internal/stores/data_style/model/lines/common.js +6 -6
- package/internal/stores/data_style/model/lines/index.js +13 -17
- package/internal/stores/data_style/model/lines/visibility.js +21 -24
- package/internal/stores/data_style/model/points/common.js +4 -4
- package/internal/stores/data_style/model/points/index.js +9 -9
- package/internal/stores/data_style/model/points/size.js +11 -11
- package/internal/stores/data_style/model/points/visibility.js +11 -15
- package/internal/stores/data_style/model/surfaces/color.js +21 -24
- package/internal/stores/data_style/model/surfaces/common.js +6 -6
- package/internal/stores/data_style/model/surfaces/index.js +14 -22
- package/internal/stores/data_style/model/surfaces/visibility.js +18 -22
- package/internal/stores/data_style/state.js +11 -11
- package/internal/utils/api_fetch.js +24 -34
- package/internal/utils/upload_file.js +19 -24
- package/internal/utils/viewer_call.js +23 -36
- package/nuxt.config.js +7 -11
- package/package.json +3 -3
- package/scripts/generate_geode_objects.js +14 -16
- package/server/api/app/kill.post.js +4 -4
- package/server/api/app/project_folder_path.post.js +11 -11
- package/server/api/app/run_back.post.js +12 -12
- package/server/api/app/run_viewer.post.js +12 -12
- package/server/api/extensions/run.post.js +34 -41
- package/server/api/extensions/upload.put.js +48 -62
- package/tests/integration/setup.js +43 -53
- package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +90 -116
- package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +81 -107
- package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +38 -41
- package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +85 -101
- package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +89 -113
- package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +81 -105
- package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +56 -73
- package/tests/integration/stores/data_style/model/corners.nuxt.test.js +59 -76
- package/tests/integration/stores/data_style/model/edges.nuxt.test.js +39 -42
- package/tests/integration/stores/data_style/model/index.nuxt.test.js +31 -34
- package/tests/integration/stores/data_style/model/lines.nuxt.test.js +60 -73
- package/tests/integration/stores/data_style/model/points.nuxt.test.js +52 -55
- package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +59 -80
- package/tests/integration/stores/viewer.nuxt.test.js +35 -38
- package/tests/setup_indexeddb.js +2 -2
- package/tests/unit/components/CrsSelector.nuxt.test.js +28 -28
- package/tests/unit/components/ExtensionSelector.nuxt.test.js +33 -35
- package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +23 -23
- package/tests/unit/components/FeedBack/Snackers.nuxt.test.js +18 -18
- package/tests/unit/components/FileSelector.nuxt.test.js +57 -59
- package/tests/unit/components/FileUploader.nuxt.test.js +35 -39
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +28 -28
- package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +22 -27
- package/tests/unit/components/Launcher.nuxt.test.js +20 -22
- package/tests/unit/components/MissingFilesSelector.nuxt.test.js +37 -37
- package/tests/unit/components/ObjectSelector.nuxt.test.js +62 -62
- package/tests/unit/components/PackagesVersions.nuxt.test.js +16 -16
- package/tests/unit/components/Step.nuxt.test.js +18 -19
- package/tests/unit/components/Stepper.nuxt.test.js +18 -18
- package/tests/unit/composables/api_fetch.nuxt.test.js +34 -36
- package/tests/unit/composables/project_manager.nuxt.test.js +93 -112
- package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +36 -36
- package/tests/unit/composables/upload_file.nuxt.test.js +27 -29
- package/tests/unit/plugins/project_load.nuxt.test.js +31 -33
- package/tests/unit/stores/app.nuxt.test.js +90 -92
- package/tests/unit/stores/feedback.nuxt.test.js +47 -57
- package/tests/unit/stores/geode.nuxt.test.js +111 -115
- package/tests/unit/stores/infra.nuxt.test.js +148 -148
- package/tests/unit/stores/lambda.nuxt.test.js +72 -74
- package/tests/unit/stores/treeview.nuxt.test.js +19 -21
- package/tests/unit/stores/viewer.nuxt.test.js +109 -122
- package/tests/unit/utils/recaptcha.nuxt.test.js +25 -29
- package/tests/unit/utils/validate_schema.nuxt.test.js +17 -17
- package/tests/utils.js +11 -11
- package/tests/vitest.config.js +9 -9
- package/vuetify_config.js +2 -2
|
@@ -1,170 +1,144 @@
|
|
|
1
1
|
// Third party imports
|
|
2
|
-
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"
|
|
3
|
-
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" }
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
|
|
3
|
+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" };
|
|
4
4
|
|
|
5
5
|
// Local imports
|
|
6
|
-
import { Status } from "@ogw_front/utils/status"
|
|
7
|
-
import { cleanupBackend } from "@ogw_front/utils/local/cleanup"
|
|
8
|
-
import { setupIntegrationTests } from "@ogw_tests/integration/setup"
|
|
9
|
-
import { useDataStyleStore } from "@ogw_front/stores/data_style"
|
|
10
|
-
import { useViewerStore } from "@ogw_front/stores/viewer"
|
|
6
|
+
import { Status } from "@ogw_front/utils/status";
|
|
7
|
+
import { cleanupBackend } from "@ogw_front/utils/local/cleanup";
|
|
8
|
+
import { setupIntegrationTests } from "@ogw_tests/integration/setup";
|
|
9
|
+
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
10
|
+
import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
11
11
|
|
|
12
12
|
// Local constants
|
|
13
|
-
const INTERVAL_TIMEOUT = 25_000
|
|
14
|
-
const mesh_edges_schemas = viewer_schemas.opengeodeweb_viewer.mesh.edges
|
|
15
|
-
const file_name = "test.og_edc3d"
|
|
16
|
-
const geode_object = "EdgedCurve3D"
|
|
17
|
-
const vertex_attribute = { name: "vertex_attribute" }
|
|
18
|
-
const edge_attribute = { name: "edge_attribute" }
|
|
13
|
+
const INTERVAL_TIMEOUT = 25_000;
|
|
14
|
+
const mesh_edges_schemas = viewer_schemas.opengeodeweb_viewer.mesh.edges;
|
|
15
|
+
const file_name = "test.og_edc3d";
|
|
16
|
+
const geode_object = "EdgedCurve3D";
|
|
17
|
+
const vertex_attribute = { name: "vertex_attribute" };
|
|
18
|
+
const edge_attribute = { name: "edge_attribute" };
|
|
19
19
|
|
|
20
20
|
let id = "",
|
|
21
|
-
projectFolderPath = ""
|
|
21
|
+
projectFolderPath = "";
|
|
22
22
|
|
|
23
23
|
beforeEach(async () => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
geode_object,
|
|
27
|
-
))
|
|
28
|
-
}, INTERVAL_TIMEOUT)
|
|
24
|
+
({ id, projectFolderPath } = await setupIntegrationTests(file_name, geode_object));
|
|
25
|
+
}, INTERVAL_TIMEOUT);
|
|
29
26
|
|
|
30
27
|
afterEach(async () => {
|
|
31
|
-
console.log("afterEach mesh edges kill", projectFolderPath)
|
|
32
|
-
await cleanupBackend(projectFolderPath)
|
|
33
|
-
})
|
|
28
|
+
console.log("afterEach mesh edges kill", projectFolderPath);
|
|
29
|
+
await cleanupBackend(projectFolderPath);
|
|
30
|
+
});
|
|
34
31
|
|
|
35
32
|
describe("Mesh edges", () => {
|
|
36
33
|
describe("Edges", () => {
|
|
37
34
|
test("Edges visibility", async () => {
|
|
38
|
-
const dataStyleStore = useDataStyleStore()
|
|
39
|
-
const viewerStore = useViewerStore()
|
|
40
|
-
const visibility = true
|
|
41
|
-
const spy = vi.spyOn(viewerStore, "request")
|
|
42
|
-
const result = dataStyleStore.setMeshEdgesVisibility(id, visibility)
|
|
43
|
-
expect(result).toBeInstanceOf(Promise)
|
|
44
|
-
await result
|
|
35
|
+
const dataStyleStore = useDataStyleStore();
|
|
36
|
+
const viewerStore = useViewerStore();
|
|
37
|
+
const visibility = true;
|
|
38
|
+
const spy = vi.spyOn(viewerStore, "request");
|
|
39
|
+
const result = dataStyleStore.setMeshEdgesVisibility(id, visibility);
|
|
40
|
+
expect(result).toBeInstanceOf(Promise);
|
|
41
|
+
await result;
|
|
45
42
|
expect(spy).toHaveBeenCalledWith(
|
|
46
43
|
mesh_edges_schemas.visibility,
|
|
47
44
|
{ id, visibility },
|
|
48
45
|
{
|
|
49
46
|
response_function: expect.any(Function),
|
|
50
47
|
},
|
|
51
|
-
)
|
|
52
|
-
expect(dataStyleStore.meshEdgesVisibility(id)).toBe(visibility)
|
|
53
|
-
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
54
|
-
})
|
|
48
|
+
);
|
|
49
|
+
expect(dataStyleStore.meshEdgesVisibility(id)).toBe(visibility);
|
|
50
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
51
|
+
});
|
|
55
52
|
|
|
56
53
|
test("Edges color red", async () => {
|
|
57
|
-
const dataStyleStore = useDataStyleStore()
|
|
58
|
-
const viewerStore = useViewerStore()
|
|
59
|
-
const color = { r: 255, g: 0, b: 0 }
|
|
60
|
-
const spy = vi.spyOn(viewerStore, "request")
|
|
61
|
-
const result = dataStyleStore.setMeshEdgesColor(id, color)
|
|
62
|
-
expect(result).toBeInstanceOf(Promise)
|
|
63
|
-
await result
|
|
54
|
+
const dataStyleStore = useDataStyleStore();
|
|
55
|
+
const viewerStore = useViewerStore();
|
|
56
|
+
const color = { r: 255, g: 0, b: 0 };
|
|
57
|
+
const spy = vi.spyOn(viewerStore, "request");
|
|
58
|
+
const result = dataStyleStore.setMeshEdgesColor(id, color);
|
|
59
|
+
expect(result).toBeInstanceOf(Promise);
|
|
60
|
+
await result;
|
|
64
61
|
expect(spy).toHaveBeenCalledWith(
|
|
65
62
|
mesh_edges_schemas.color,
|
|
66
63
|
{ id, color },
|
|
67
64
|
{
|
|
68
65
|
response_function: expect.any(Function),
|
|
69
66
|
},
|
|
70
|
-
)
|
|
71
|
-
expect(dataStyleStore.meshEdgesColor(id)).toStrictEqual(color)
|
|
72
|
-
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
73
|
-
})
|
|
67
|
+
);
|
|
68
|
+
expect(dataStyleStore.meshEdgesColor(id)).toStrictEqual(color);
|
|
69
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
70
|
+
});
|
|
74
71
|
|
|
75
72
|
test("Edges vertex attribute", async () => {
|
|
76
|
-
const dataStyleStore = useDataStyleStore()
|
|
77
|
-
const viewerStore = useViewerStore()
|
|
73
|
+
const dataStyleStore = useDataStyleStore();
|
|
74
|
+
const viewerStore = useViewerStore();
|
|
78
75
|
|
|
79
|
-
const spy = vi.spyOn(viewerStore, "request")
|
|
80
|
-
await dataStyleStore.setMeshEdgesVertexAttributeName(
|
|
81
|
-
id,
|
|
82
|
-
vertex_attribute.name,
|
|
83
|
-
)
|
|
76
|
+
const spy = vi.spyOn(viewerStore, "request");
|
|
77
|
+
await dataStyleStore.setMeshEdgesVertexAttributeName(id, vertex_attribute.name);
|
|
84
78
|
expect(spy).toHaveBeenCalledWith(
|
|
85
79
|
mesh_edges_schemas.attribute.vertex.name,
|
|
86
80
|
{ id, ...vertex_attribute },
|
|
87
81
|
{
|
|
88
82
|
response_function: expect.any(Function),
|
|
89
83
|
},
|
|
90
|
-
)
|
|
91
|
-
expect(dataStyleStore.meshEdgesVertexAttributeName(id)).toBe(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
95
|
-
})
|
|
84
|
+
);
|
|
85
|
+
expect(dataStyleStore.meshEdgesVertexAttributeName(id)).toBe(vertex_attribute.name);
|
|
86
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
87
|
+
});
|
|
96
88
|
|
|
97
89
|
test("Edges edge attribute", async () => {
|
|
98
|
-
const dataStyleStore = useDataStyleStore()
|
|
99
|
-
const viewerStore = useViewerStore()
|
|
90
|
+
const dataStyleStore = useDataStyleStore();
|
|
91
|
+
const viewerStore = useViewerStore();
|
|
100
92
|
|
|
101
|
-
const spy = vi.spyOn(viewerStore, "request")
|
|
102
|
-
await dataStyleStore.setMeshEdgesEdgeAttributeName(
|
|
103
|
-
id,
|
|
104
|
-
edge_attribute.name,
|
|
105
|
-
)
|
|
93
|
+
const spy = vi.spyOn(viewerStore, "request");
|
|
94
|
+
await dataStyleStore.setMeshEdgesEdgeAttributeName(id, edge_attribute.name);
|
|
106
95
|
expect(spy).toHaveBeenCalledWith(
|
|
107
96
|
mesh_edges_schemas.attribute.edge.name,
|
|
108
97
|
{ id, ...edge_attribute },
|
|
109
98
|
{
|
|
110
99
|
response_function: expect.any(Function),
|
|
111
100
|
},
|
|
112
|
-
)
|
|
113
|
-
expect(dataStyleStore.meshEdgesEdgeAttributeName(id)).toBe(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
117
|
-
})
|
|
101
|
+
);
|
|
102
|
+
expect(dataStyleStore.meshEdgesEdgeAttributeName(id)).toBe(edge_attribute.name);
|
|
103
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
104
|
+
});
|
|
118
105
|
|
|
119
106
|
test("Edges active coloring", async () => {
|
|
120
|
-
const dataStyleStore = useDataStyleStore()
|
|
121
|
-
const viewerStore = useViewerStore()
|
|
107
|
+
const dataStyleStore = useDataStyleStore();
|
|
108
|
+
const viewerStore = useViewerStore();
|
|
122
109
|
const coloringTypes = [
|
|
123
110
|
{ name: "color" },
|
|
124
111
|
{
|
|
125
112
|
name: "vertex",
|
|
126
|
-
function: () =>
|
|
127
|
-
dataStyleStore.setMeshEdgesVertexAttributeName(
|
|
128
|
-
id,
|
|
129
|
-
vertex_attribute.name,
|
|
130
|
-
),
|
|
113
|
+
function: () => dataStyleStore.setMeshEdgesVertexAttributeName(id, vertex_attribute.name),
|
|
131
114
|
},
|
|
132
115
|
{
|
|
133
116
|
name: "edge",
|
|
134
|
-
function: () =>
|
|
135
|
-
dataStyleStore.setMeshEdgesEdgeAttributeName(
|
|
136
|
-
id,
|
|
137
|
-
edge_attribute.name,
|
|
138
|
-
),
|
|
117
|
+
function: () => dataStyleStore.setMeshEdgesEdgeAttributeName(id, edge_attribute.name),
|
|
139
118
|
},
|
|
140
|
-
]
|
|
119
|
+
];
|
|
141
120
|
async function testColoring(coloringType) {
|
|
142
121
|
if (coloringType.function) {
|
|
143
|
-
await coloringType.function()
|
|
122
|
+
await coloringType.function();
|
|
144
123
|
}
|
|
145
|
-
const result = dataStyleStore.setMeshEdgesActiveColoring(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
)
|
|
149
|
-
expect(
|
|
150
|
-
await result
|
|
151
|
-
expect(dataStyleStore.meshEdgesActiveColoring(id)).toBe(
|
|
152
|
-
coloringType.name,
|
|
153
|
-
)
|
|
154
|
-
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
124
|
+
const result = dataStyleStore.setMeshEdgesActiveColoring(id, coloringType.name);
|
|
125
|
+
expect(result).toBeInstanceOf(Promise);
|
|
126
|
+
await result;
|
|
127
|
+
expect(dataStyleStore.meshEdgesActiveColoring(id)).toBe(coloringType.name);
|
|
128
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
155
129
|
}
|
|
156
130
|
|
|
157
|
-
await testColoring(coloringTypes[0])
|
|
158
|
-
await testColoring(coloringTypes[1])
|
|
159
|
-
await testColoring(coloringTypes[2])
|
|
160
|
-
})
|
|
131
|
+
await testColoring(coloringTypes[0]);
|
|
132
|
+
await testColoring(coloringTypes[1]);
|
|
133
|
+
await testColoring(coloringTypes[2]);
|
|
134
|
+
});
|
|
161
135
|
test("Edges apply style", async () => {
|
|
162
|
-
const dataStyleStore = useDataStyleStore()
|
|
163
|
-
const viewerStore = useViewerStore()
|
|
164
|
-
const result = dataStyleStore.applyMeshEdgesStyle(id)
|
|
165
|
-
expect(result).toBeInstanceOf(Promise)
|
|
166
|
-
await result
|
|
167
|
-
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
168
|
-
})
|
|
169
|
-
})
|
|
170
|
-
})
|
|
136
|
+
const dataStyleStore = useDataStyleStore();
|
|
137
|
+
const viewerStore = useViewerStore();
|
|
138
|
+
const result = dataStyleStore.applyMeshEdgesStyle(id);
|
|
139
|
+
expect(result).toBeInstanceOf(Promise);
|
|
140
|
+
await result;
|
|
141
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
});
|
|
@@ -1,65 +1,62 @@
|
|
|
1
1
|
// Third party imports
|
|
2
|
-
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"
|
|
3
|
-
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" }
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
|
|
3
|
+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" };
|
|
4
4
|
|
|
5
5
|
// Local imports
|
|
6
|
-
import { Status } from "@ogw_front/utils/status"
|
|
7
|
-
import { cleanupBackend } from "@ogw_front/utils/local/cleanup"
|
|
8
|
-
import { setupIntegrationTests } from "@ogw_tests/integration/setup"
|
|
9
|
-
import { useDataStyleStore } from "@ogw_front/stores/data_style"
|
|
10
|
-
import { useViewerStore } from "@ogw_front/stores/viewer"
|
|
6
|
+
import { Status } from "@ogw_front/utils/status";
|
|
7
|
+
import { cleanupBackend } from "@ogw_front/utils/local/cleanup";
|
|
8
|
+
import { setupIntegrationTests } from "@ogw_tests/integration/setup";
|
|
9
|
+
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
10
|
+
import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
11
11
|
|
|
12
12
|
// Local constants
|
|
13
|
-
const INTERVAL_TIMEOUT = 20_000
|
|
14
|
-
const mesh_schemas = viewer_schemas.opengeodeweb_viewer.mesh
|
|
15
|
-
const file_name = "test.og_rgd3d"
|
|
16
|
-
const geode_object = "RegularGrid3D"
|
|
13
|
+
const INTERVAL_TIMEOUT = 20_000;
|
|
14
|
+
const mesh_schemas = viewer_schemas.opengeodeweb_viewer.mesh;
|
|
15
|
+
const file_name = "test.og_rgd3d";
|
|
16
|
+
const geode_object = "RegularGrid3D";
|
|
17
17
|
|
|
18
18
|
let id = "",
|
|
19
|
-
projectFolderPath = ""
|
|
19
|
+
projectFolderPath = "";
|
|
20
20
|
|
|
21
21
|
beforeEach(async () => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
geode_object,
|
|
25
|
-
))
|
|
26
|
-
}, INTERVAL_TIMEOUT)
|
|
22
|
+
({ id, projectFolderPath } = await setupIntegrationTests(file_name, geode_object));
|
|
23
|
+
}, INTERVAL_TIMEOUT);
|
|
27
24
|
|
|
28
25
|
afterEach(async () => {
|
|
29
|
-
console.log("afterEach mesh index kill", projectFolderPath)
|
|
30
|
-
await cleanupBackend(projectFolderPath)
|
|
31
|
-
})
|
|
26
|
+
console.log("afterEach mesh index kill", projectFolderPath);
|
|
27
|
+
await cleanupBackend(projectFolderPath);
|
|
28
|
+
});
|
|
32
29
|
|
|
33
30
|
describe("Mesh", () => {
|
|
34
31
|
describe("Mesh visibility", () => {
|
|
35
32
|
test("Visibility true", async () => {
|
|
36
|
-
const dataStyleStore = useDataStyleStore()
|
|
37
|
-
const viewerStore = useViewerStore()
|
|
38
|
-
const visibility = true
|
|
39
|
-
const spy = vi.spyOn(viewerStore, "request")
|
|
40
|
-
const result = dataStyleStore.setMeshVisibility(id, visibility)
|
|
41
|
-
expect(result).toBeInstanceOf(Promise)
|
|
42
|
-
await result
|
|
33
|
+
const dataStyleStore = useDataStyleStore();
|
|
34
|
+
const viewerStore = useViewerStore();
|
|
35
|
+
const visibility = true;
|
|
36
|
+
const spy = vi.spyOn(viewerStore, "request");
|
|
37
|
+
const result = dataStyleStore.setMeshVisibility(id, visibility);
|
|
38
|
+
expect(result).toBeInstanceOf(Promise);
|
|
39
|
+
await result;
|
|
43
40
|
expect(spy).toHaveBeenCalledWith(
|
|
44
41
|
mesh_schemas.visibility,
|
|
45
42
|
{ id, visibility },
|
|
46
43
|
{
|
|
47
44
|
response_function: expect.any(Function),
|
|
48
45
|
},
|
|
49
|
-
)
|
|
50
|
-
expect(dataStyleStore.meshVisibility(id)).toBe(visibility)
|
|
51
|
-
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
52
|
-
})
|
|
53
|
-
})
|
|
46
|
+
);
|
|
47
|
+
expect(dataStyleStore.meshVisibility(id)).toBe(visibility);
|
|
48
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
54
51
|
|
|
55
52
|
describe("Apply mesh default style", () => {
|
|
56
53
|
test("Apply mesh default style", async () => {
|
|
57
|
-
const dataStyleStore = useDataStyleStore()
|
|
58
|
-
const viewerStore = useViewerStore()
|
|
59
|
-
const result = dataStyleStore.applyMeshStyle(id)
|
|
60
|
-
expect(result).toBeInstanceOf(Promise)
|
|
61
|
-
await result
|
|
62
|
-
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
63
|
-
})
|
|
64
|
-
})
|
|
65
|
-
})
|
|
54
|
+
const dataStyleStore = useDataStyleStore();
|
|
55
|
+
const viewerStore = useViewerStore();
|
|
56
|
+
const result = dataStyleStore.applyMeshStyle(id);
|
|
57
|
+
expect(result).toBeInstanceOf(Promise);
|
|
58
|
+
await result;
|
|
59
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -1,166 +1,150 @@
|
|
|
1
1
|
// Third party imports
|
|
2
|
-
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"
|
|
3
|
-
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" }
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
|
|
3
|
+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" };
|
|
4
4
|
|
|
5
5
|
// Local imports
|
|
6
|
-
import { Status } from "@ogw_front/utils/status"
|
|
7
|
-
import { cleanupBackend } from "@ogw_front/utils/local/cleanup"
|
|
8
|
-
import { setupIntegrationTests } from "@ogw_tests/integration/setup"
|
|
9
|
-
import { useDataStyleStore } from "@ogw_front/stores/data_style"
|
|
10
|
-
import { useViewerStore } from "@ogw_front/stores/viewer"
|
|
6
|
+
import { Status } from "@ogw_front/utils/status";
|
|
7
|
+
import { cleanupBackend } from "@ogw_front/utils/local/cleanup";
|
|
8
|
+
import { setupIntegrationTests } from "@ogw_tests/integration/setup";
|
|
9
|
+
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
10
|
+
import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
11
11
|
|
|
12
12
|
// Local constants
|
|
13
|
-
const INTERVAL_TIMEOUT = 20_000
|
|
14
|
-
const mesh_points_schemas = viewer_schemas.opengeodeweb_viewer.mesh.points
|
|
15
|
-
const file_name = "test.og_edc2d"
|
|
16
|
-
const geode_object = "EdgedCurve2D"
|
|
17
|
-
const vertex_attribute = { name: "points" }
|
|
13
|
+
const INTERVAL_TIMEOUT = 20_000;
|
|
14
|
+
const mesh_points_schemas = viewer_schemas.opengeodeweb_viewer.mesh.points;
|
|
15
|
+
const file_name = "test.og_edc2d";
|
|
16
|
+
const geode_object = "EdgedCurve2D";
|
|
17
|
+
const vertex_attribute = { name: "points" };
|
|
18
18
|
|
|
19
19
|
let id = "",
|
|
20
|
-
projectFolderPath = ""
|
|
20
|
+
projectFolderPath = "";
|
|
21
21
|
|
|
22
22
|
beforeEach(async () => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
geode_object,
|
|
26
|
-
))
|
|
27
|
-
}, INTERVAL_TIMEOUT)
|
|
23
|
+
({ id, projectFolderPath } = await setupIntegrationTests(file_name, geode_object));
|
|
24
|
+
}, INTERVAL_TIMEOUT);
|
|
28
25
|
|
|
29
26
|
afterEach(async () => {
|
|
30
|
-
console.log("afterEach mesh points kill", projectFolderPath)
|
|
31
|
-
await cleanupBackend(projectFolderPath)
|
|
32
|
-
})
|
|
27
|
+
console.log("afterEach mesh points kill", projectFolderPath);
|
|
28
|
+
await cleanupBackend(projectFolderPath);
|
|
29
|
+
});
|
|
33
30
|
|
|
34
31
|
describe("Mesh points", () => {
|
|
35
32
|
describe("Points visibility", () => {
|
|
36
33
|
test("Visibility true", async () => {
|
|
37
|
-
const dataStyleStore = useDataStyleStore()
|
|
38
|
-
const viewerStore = useViewerStore()
|
|
39
|
-
const visibility = true
|
|
40
|
-
const spy = vi.spyOn(viewerStore, "request")
|
|
41
|
-
const result = dataStyleStore.setMeshPointsVisibility(id, visibility)
|
|
42
|
-
expect(result).toBeInstanceOf(Promise)
|
|
43
|
-
await result
|
|
34
|
+
const dataStyleStore = useDataStyleStore();
|
|
35
|
+
const viewerStore = useViewerStore();
|
|
36
|
+
const visibility = true;
|
|
37
|
+
const spy = vi.spyOn(viewerStore, "request");
|
|
38
|
+
const result = dataStyleStore.setMeshPointsVisibility(id, visibility);
|
|
39
|
+
expect(result).toBeInstanceOf(Promise);
|
|
40
|
+
await result;
|
|
44
41
|
expect(spy).toHaveBeenCalledWith(
|
|
45
42
|
mesh_points_schemas.visibility,
|
|
46
43
|
{ id, visibility },
|
|
47
44
|
{
|
|
48
45
|
response_function: expect.any(Function),
|
|
49
46
|
},
|
|
50
|
-
)
|
|
51
|
-
expect(dataStyleStore.meshPointsVisibility(id)).toBe(visibility)
|
|
52
|
-
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
53
|
-
})
|
|
54
|
-
})
|
|
47
|
+
);
|
|
48
|
+
expect(dataStyleStore.meshPointsVisibility(id)).toBe(visibility);
|
|
49
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
55
52
|
|
|
56
53
|
describe("Points color", () => {
|
|
57
54
|
test("Color red", async () => {
|
|
58
|
-
const dataStyleStore = useDataStyleStore()
|
|
59
|
-
const viewerStore = useViewerStore()
|
|
60
|
-
const color = { r: 255, g: 0, b: 0 }
|
|
61
|
-
const spy = vi.spyOn(viewerStore, "request")
|
|
62
|
-
const result = dataStyleStore.setMeshPointsColor(id, color)
|
|
63
|
-
expect(result).toBeInstanceOf(Promise)
|
|
64
|
-
await result
|
|
55
|
+
const dataStyleStore = useDataStyleStore();
|
|
56
|
+
const viewerStore = useViewerStore();
|
|
57
|
+
const color = { r: 255, g: 0, b: 0 };
|
|
58
|
+
const spy = vi.spyOn(viewerStore, "request");
|
|
59
|
+
const result = dataStyleStore.setMeshPointsColor(id, color);
|
|
60
|
+
expect(result).toBeInstanceOf(Promise);
|
|
61
|
+
await result;
|
|
65
62
|
expect(spy).toHaveBeenCalledWith(
|
|
66
63
|
mesh_points_schemas.color,
|
|
67
64
|
{ id, color },
|
|
68
65
|
{
|
|
69
66
|
response_function: expect.any(Function),
|
|
70
67
|
},
|
|
71
|
-
)
|
|
72
|
-
expect(dataStyleStore.meshPointsColor(id)).toStrictEqual(color)
|
|
73
|
-
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
74
|
-
})
|
|
75
|
-
})
|
|
68
|
+
);
|
|
69
|
+
expect(dataStyleStore.meshPointsColor(id)).toStrictEqual(color);
|
|
70
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
76
73
|
|
|
77
74
|
describe("Points active coloring", () => {
|
|
78
75
|
test("test coloring", async () => {
|
|
79
|
-
const dataStyleStore = useDataStyleStore()
|
|
80
|
-
const viewerStore = useViewerStore()
|
|
76
|
+
const dataStyleStore = useDataStyleStore();
|
|
77
|
+
const viewerStore = useViewerStore();
|
|
81
78
|
const coloringTypes = [
|
|
82
79
|
{ name: "color" },
|
|
83
80
|
{
|
|
84
81
|
name: "vertex",
|
|
85
82
|
function: () =>
|
|
86
|
-
dataStyleStore.setMeshPointsVertexAttributeName(
|
|
87
|
-
id,
|
|
88
|
-
vertex_attribute.name,
|
|
89
|
-
),
|
|
83
|
+
dataStyleStore.setMeshPointsVertexAttributeName(id, vertex_attribute.name),
|
|
90
84
|
},
|
|
91
|
-
]
|
|
85
|
+
];
|
|
92
86
|
async function testColoring(coloringType, expectedColoringType) {
|
|
93
87
|
if (coloringType.function) {
|
|
94
|
-
await coloringType.function()
|
|
88
|
+
await coloringType.function();
|
|
95
89
|
}
|
|
96
|
-
const result = dataStyleStore.setMeshPointsActiveColoring(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
)
|
|
100
|
-
expect(
|
|
101
|
-
await result
|
|
102
|
-
expect(dataStyleStore.meshPointsActiveColoring(id)).toBe(
|
|
103
|
-
expectedColoringType,
|
|
104
|
-
)
|
|
105
|
-
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
90
|
+
const result = dataStyleStore.setMeshPointsActiveColoring(id, coloringType.name);
|
|
91
|
+
expect(result).toBeInstanceOf(Promise);
|
|
92
|
+
await result;
|
|
93
|
+
expect(dataStyleStore.meshPointsActiveColoring(id)).toBe(expectedColoringType);
|
|
94
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
106
95
|
}
|
|
107
96
|
|
|
108
|
-
await testColoring(coloringTypes[0], "color")
|
|
109
|
-
await testColoring(coloringTypes[1], "vertex")
|
|
110
|
-
})
|
|
111
|
-
})
|
|
97
|
+
await testColoring(coloringTypes[0], "color");
|
|
98
|
+
await testColoring(coloringTypes[1], "vertex");
|
|
99
|
+
});
|
|
100
|
+
});
|
|
112
101
|
|
|
113
102
|
describe("Points size", () => {
|
|
114
103
|
test("Size 20", async () => {
|
|
115
|
-
const dataStyleStore = useDataStyleStore()
|
|
116
|
-
const viewerStore = useViewerStore()
|
|
117
|
-
const size = 20
|
|
118
|
-
const spy = vi.spyOn(viewerStore, "request")
|
|
119
|
-
const result = dataStyleStore.setMeshPointsSize(id, size)
|
|
120
|
-
expect(result).toBeInstanceOf(Promise)
|
|
121
|
-
await result
|
|
104
|
+
const dataStyleStore = useDataStyleStore();
|
|
105
|
+
const viewerStore = useViewerStore();
|
|
106
|
+
const size = 20;
|
|
107
|
+
const spy = vi.spyOn(viewerStore, "request");
|
|
108
|
+
const result = dataStyleStore.setMeshPointsSize(id, size);
|
|
109
|
+
expect(result).toBeInstanceOf(Promise);
|
|
110
|
+
await result;
|
|
122
111
|
expect(spy).toHaveBeenCalledWith(
|
|
123
112
|
mesh_points_schemas.size,
|
|
124
113
|
{ id, size },
|
|
125
114
|
{
|
|
126
115
|
response_function: expect.any(Function),
|
|
127
116
|
},
|
|
128
|
-
)
|
|
129
|
-
expect(dataStyleStore.meshPointsSize(id)).toBe(size)
|
|
130
|
-
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
131
|
-
})
|
|
132
|
-
})
|
|
117
|
+
);
|
|
118
|
+
expect(dataStyleStore.meshPointsSize(id)).toBe(size);
|
|
119
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
120
|
+
});
|
|
121
|
+
});
|
|
133
122
|
|
|
134
123
|
describe("Points vertex attribute", () => {
|
|
135
124
|
test("test coloring", async () => {
|
|
136
|
-
const dataStyleStore = useDataStyleStore()
|
|
137
|
-
const viewerStore = useViewerStore()
|
|
125
|
+
const dataStyleStore = useDataStyleStore();
|
|
126
|
+
const viewerStore = useViewerStore();
|
|
138
127
|
|
|
139
|
-
const spy = vi.spyOn(viewerStore, "request")
|
|
140
|
-
await dataStyleStore.setMeshPointsVertexAttributeName(
|
|
141
|
-
id,
|
|
142
|
-
vertex_attribute.name,
|
|
143
|
-
)
|
|
128
|
+
const spy = vi.spyOn(viewerStore, "request");
|
|
129
|
+
await dataStyleStore.setMeshPointsVertexAttributeName(id, vertex_attribute.name);
|
|
144
130
|
expect(spy).toHaveBeenCalledWith(
|
|
145
131
|
mesh_points_schemas.attribute.vertex.name,
|
|
146
132
|
{ id, ...vertex_attribute },
|
|
147
133
|
{
|
|
148
134
|
response_function: expect.any(Function),
|
|
149
135
|
},
|
|
150
|
-
)
|
|
151
|
-
expect(dataStyleStore.meshPointsVertexAttributeName(id)).toBe(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
})
|
|
156
|
-
})
|
|
136
|
+
);
|
|
137
|
+
expect(dataStyleStore.meshPointsVertexAttributeName(id)).toBe(vertex_attribute.name);
|
|
138
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
139
|
+
});
|
|
140
|
+
});
|
|
157
141
|
|
|
158
142
|
test("Points apply default style", async () => {
|
|
159
|
-
const dataStyleStore = useDataStyleStore()
|
|
160
|
-
const viewerStore = useViewerStore()
|
|
161
|
-
const result = dataStyleStore.applyMeshPointsStyle(id)
|
|
162
|
-
expect(result).toBeInstanceOf(Promise)
|
|
163
|
-
await result
|
|
164
|
-
expect(viewerStore.status).toBe(Status.CONNECTED)
|
|
165
|
-
})
|
|
166
|
-
})
|
|
143
|
+
const dataStyleStore = useDataStyleStore();
|
|
144
|
+
const viewerStore = useViewerStore();
|
|
145
|
+
const result = dataStyleStore.applyMeshPointsStyle(id);
|
|
146
|
+
expect(result).toBeInstanceOf(Promise);
|
|
147
|
+
await result;
|
|
148
|
+
expect(viewerStore.status).toBe(Status.CONNECTED);
|
|
149
|
+
});
|
|
150
|
+
});
|