@geode/opengeodeweb-front 10.14.0-rc.1 → 10.14.0-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.
Files changed (43) hide show
  1. package/.oxlintrc.json +4 -2
  2. package/app/components/Viewer/Options/ColorPicker.vue +28 -4
  3. package/app/utils/default_styles.js +9 -9
  4. package/package.json +1 -1
  5. package/tests/integration/setup.js +2 -0
  6. package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +51 -46
  7. package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +46 -40
  8. package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +12 -12
  9. package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +37 -40
  10. package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +48 -46
  11. package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +45 -42
  12. package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +15 -15
  13. package/tests/integration/stores/data_style/model/corners.nuxt.test.js +15 -15
  14. package/tests/integration/stores/data_style/model/edges.nuxt.test.js +12 -12
  15. package/tests/integration/stores/data_style/model/index.nuxt.test.js +10 -10
  16. package/tests/integration/stores/data_style/model/lines.nuxt.test.js +16 -15
  17. package/tests/integration/stores/data_style/model/points.nuxt.test.js +14 -14
  18. package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +11 -11
  19. package/tests/integration/stores/viewer.nuxt.test.js +9 -9
  20. package/tests/unit/components/CrsSelector.nuxt.test.js +9 -11
  21. package/tests/unit/components/ExtensionSelector.nuxt.test.js +12 -12
  22. package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +4 -3
  23. package/tests/unit/components/FeedBack/Snackers.nuxt.test.js +4 -4
  24. package/tests/unit/components/FileSelector.nuxt.test.js +8 -8
  25. package/tests/unit/components/FileUploader.nuxt.test.js +5 -5
  26. package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +5 -15
  27. package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +3 -3
  28. package/tests/unit/components/MissingFilesSelector.nuxt.test.js +8 -10
  29. package/tests/unit/components/ObjectSelector.nuxt.test.js +20 -16
  30. package/tests/unit/components/PackagesVersions.nuxt.test.js +2 -2
  31. package/tests/unit/components/Step.nuxt.test.js +3 -8
  32. package/tests/unit/components/Stepper.nuxt.test.js +3 -8
  33. package/tests/unit/composables/project_manager.nuxt.test.js +22 -19
  34. package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +20 -20
  35. package/tests/unit/composables/upload_file.nuxt.test.js +6 -6
  36. package/tests/unit/plugins/project_load.nuxt.test.js +5 -5
  37. package/tests/unit/stores/app.nuxt.test.js +26 -24
  38. package/tests/unit/stores/cloud.nuxt.test.js +6 -7
  39. package/tests/unit/stores/feedback.nuxt.test.js +26 -23
  40. package/tests/unit/stores/geode.nuxt.test.js +5 -5
  41. package/tests/unit/stores/infra.nuxt.test.js +31 -23
  42. package/tests/unit/stores/treeview.nuxt.test.js +5 -4
  43. package/tests/unit/stores/viewer.nuxt.test.js +29 -24
package/.oxlintrc.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "eslint/id-length": [
26
26
  "error",
27
27
  {
28
- "exceptions": ["x", "y", "z", "i", "j", "k", "r", "g", "b", "id", "ID", "fs", "os", "_"],
28
+ "exceptions": ["x", "y", "z", "i", "j", "k", "id", "ID", "fs", "os", "_"],
29
29
  "min": 3
30
30
  }
31
31
  ],
@@ -123,7 +123,9 @@
123
123
  "vitest/prefer-to-be-truthy": "off",
124
124
  "vitest/prefer-to-be-falsy": "off",
125
125
  "vitest/require-test-timeout": "warn",
126
- "vitest/prefer-importing-vitest-globals": "off"
126
+ "vitest/prefer-importing-vitest-globals": "off",
127
+ "jest/consistent-test-it": ["error", { "fn": "test", "withinDescribe": "test" }],
128
+ "vitest/prefer-spy-on": "off"
127
129
  }
128
130
  },
129
131
  {
@@ -1,13 +1,37 @@
1
1
  <script setup>
2
+ // oxlint-disable id-length
2
3
  const colorPickerRef = useTemplateRef("colorPickerRef");
3
4
  const model = defineModel();
4
5
  const { pressed } = useMousePressed({ target: colorPickerRef });
5
6
 
6
- const color = ref(model);
7
+ const vuetifyColor = ref({
8
+ r: model.value.red,
9
+ g: model.value.green,
10
+ b: model.value.blue,
11
+ a: model.value.alpha,
12
+ });
13
+
14
+ watch(
15
+ model,
16
+ (newValue) => {
17
+ vuetifyColor.value = {
18
+ r: newValue.red,
19
+ g: newValue.green,
20
+ b: newValue.blue,
21
+ a: newValue.alpha,
22
+ };
23
+ },
24
+ { deep: true },
25
+ );
7
26
 
8
27
  watch(pressed, (value) => {
9
28
  if (!value) {
10
- model.value = color.value;
29
+ model.value = {
30
+ red: vuetifyColor.value.r,
31
+ green: vuetifyColor.value.g,
32
+ blue: vuetifyColor.value.b,
33
+ alpha: vuetifyColor.value.a,
34
+ };
11
35
  }
12
36
  });
13
37
  </script>
@@ -15,11 +39,11 @@ watch(pressed, (value) => {
15
39
  <template>
16
40
  <v-color-picker
17
41
  ref="colorPickerRef"
18
- v-model="color"
42
+ v-model="vuetifyColor"
19
43
  flat
20
44
  canvas-height="100"
21
45
  hide-inputs
22
46
  width="100%"
23
- mode="rgb"
47
+ mode="rgba"
24
48
  />
25
49
  </template>
@@ -5,21 +5,21 @@ const cells_defaultVisibility = true;
5
5
  const polygons_defaultVisibility = true;
6
6
  const polyhedra_defaultVisibility = true;
7
7
  const points_defaultSize = 10;
8
- const points_defaultColor = { r: 20, g: 20, b: 20 };
8
+ const points_defaultColor = { red: 20, green: 20, blue: 20, alpha: 1 };
9
9
  const edges_defaultWidth = 2;
10
- const edges_defaultColor = { r: 20, g: 20, b: 20 };
11
- const cells_defaultColor = { r: 255, g: 255, b: 255 };
12
- const polygons_defaultColor = { r: 255, g: 255, b: 255 };
13
- const polyhedra_defaultColor = { r: 255, g: 255, b: 255 };
10
+ const edges_defaultColor = { red: 20, green: 20, blue: 20, alpha: 1 };
11
+ const cells_defaultColor = { red: 255, green: 255, blue: 255, alpha: 1 };
12
+ const polygons_defaultColor = { red: 255, green: 255, blue: 255, alpha: 1 };
13
+ const polyhedra_defaultColor = { red: 255, green: 255, blue: 255, alpha: 1 };
14
14
 
15
15
  const corners_defaultVisibility = true;
16
- const corners_defaultColor = { r: 20, g: 20, b: 20 };
16
+ const corners_defaultColor = { red: 20, green: 20, blue: 20, alpha: 1 };
17
17
  const lines_defaultVisibility = true;
18
- const lines_defaultColor = { r: 20, g: 20, b: 20 };
18
+ const lines_defaultColor = { red: 20, green: 20, blue: 20, alpha: 1 };
19
19
  const surfaces_defaultVisibility = true;
20
- const surfaces_defaultColor = { r: 255, g: 255, b: 255 };
20
+ const surfaces_defaultColor = { red: 255, green: 255, blue: 255, alpha: 1 };
21
21
  const blocks_defaultVisibility = true;
22
- const blocks_defaultColor = { r: 255, g: 255, b: 255 };
22
+ const blocks_defaultColor = { red: 255, green: 255, blue: 255, alpha: 1 };
23
23
 
24
24
  const DEFAULT_MODEL_COMPONENT_TYPE_COLORS = {
25
25
  Corner: corners_defaultColor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geode/opengeodeweb-front",
3
- "version": "10.14.0-rc.1",
3
+ "version": "10.14.0-rc.2",
4
4
  "description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
5
5
  "homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
6
6
  "bugs": {
@@ -1,3 +1,5 @@
1
+ // oxlint-disable vitest/require-top-level-describe
2
+
1
3
  // Node.js imports
2
4
  import { WebSocket } from "ws";
3
5
  import path from "node:path";
@@ -20,20 +20,20 @@ const cell_attribute = { name: "RGB_data" };
20
20
  let id = "",
21
21
  projectFolderPath = "";
22
22
 
23
- beforeAll(async () => {
24
- id = "";
25
- projectFolderPath = "";
26
- ({ id, projectFolderPath } = await setupIntegrationTests(file_name, geode_object));
27
- }, INTERVAL_TIMEOUT);
23
+ describe("mesh cells", () => {
24
+ beforeAll(async () => {
25
+ id = "";
26
+ projectFolderPath = "";
27
+ ({ id, projectFolderPath } = await setupIntegrationTests(file_name, geode_object));
28
+ }, INTERVAL_TIMEOUT);
28
29
 
29
- afterAll(async () => {
30
- console.log("afterAll mesh cells kill", projectFolderPath);
31
- await cleanupBackend(projectFolderPath);
32
- });
30
+ afterAll(async () => {
31
+ console.log("afterAll mesh cells kill", projectFolderPath);
32
+ await cleanupBackend(projectFolderPath);
33
+ });
33
34
 
34
- describe("Mesh cells", () => {
35
- describe("Cells visibility", () => {
36
- test("Visibility true", async () => {
35
+ describe("cells visibility", () => {
36
+ test("visibility true", async () => {
37
37
  const dataStyleStore = useDataStyleStore();
38
38
  const viewerStore = useViewerStore();
39
39
  const visibility = true;
@@ -53,11 +53,11 @@ describe("Mesh cells", () => {
53
53
  });
54
54
  });
55
55
 
56
- describe("Cells color", () => {
57
- test("Color red", async () => {
56
+ describe("cells color", () => {
57
+ test("color red", async () => {
58
58
  const dataStyleStore = useDataStyleStore();
59
59
  const viewerStore = useViewerStore();
60
- const color = { r: 255, g: 0, b: 0 };
60
+ const color = { red: 255, green: 0, blue: 0, alpha: 1 };
61
61
  const spy = vi.spyOn(viewerStore, "request");
62
62
  const result = dataStyleStore.setMeshCellsColor(id, color);
63
63
  expect(result).toBeInstanceOf(Promise);
@@ -74,8 +74,8 @@ describe("Mesh cells", () => {
74
74
  });
75
75
  });
76
76
 
77
- describe("Cells vertex attribute", () => {
78
- test("Coloring vertex attribute", async () => {
77
+ describe("cells vertex attribute", () => {
78
+ test("coloring vertex attribute", async () => {
79
79
  const dataStyleStore = useDataStyleStore();
80
80
  const viewerStore = useViewerStore();
81
81
  const spy = vi.spyOn(viewerStore, "request");
@@ -94,8 +94,8 @@ describe("Mesh cells", () => {
94
94
  });
95
95
  });
96
96
 
97
- describe("Cells cell attribute", () => {
98
- test("Coloring cell attribute", async () => {
97
+ describe("cells cell attribute", () => {
98
+ test("coloring cell attribute", async () => {
99
99
  const dataStyleStore = useDataStyleStore();
100
100
  const viewerStore = useViewerStore();
101
101
  const spy = vi.spyOn(viewerStore, "request");
@@ -114,39 +114,44 @@ describe("Mesh cells", () => {
114
114
  });
115
115
  });
116
116
 
117
- describe("Cells active coloring", () => {
118
- test("test coloring", async () => {
117
+ describe("cells active coloring", () => {
118
+ test("coloring color", async () => {
119
119
  const dataStyleStore = useDataStyleStore();
120
120
  const viewerStore = useViewerStore();
121
- const coloringTypes = [
122
- { name: "color" },
123
- {
124
- name: "vertex",
125
- function: () => dataStyleStore.setMeshCellsVertexAttributeName(id, vertex_attribute.name),
126
- },
127
- {
128
- name: "cell",
129
- function: () => dataStyleStore.setMeshCellsCellAttributeName(id, cell_attribute.name),
130
- },
131
- ];
132
- async function testColoring(coloringType, expectedColoringType) {
133
- if (coloringType.function) {
134
- await coloringType.function();
135
- }
136
- const result = dataStyleStore.setMeshCellsActiveColoring(id, coloringType.name);
137
- expect(result).toBeInstanceOf(Promise);
138
- await result;
139
- expect(dataStyleStore.meshCellsActiveColoring(id)).toBe(expectedColoringType);
140
- expect(viewerStore.status).toBe(Status.CONNECTED);
141
- }
121
+ const coloringName = "color";
122
+ const result = dataStyleStore.setMeshCellsActiveColoring(id, coloringName);
123
+ expect(result).toBeInstanceOf(Promise);
124
+ await result;
125
+ expect(dataStyleStore.meshCellsActiveColoring(id)).toBe(coloringName);
126
+ expect(viewerStore.status).toBe(Status.CONNECTED);
127
+ });
142
128
 
143
- await testColoring(coloringTypes[0], "color");
144
- await testColoring(coloringTypes[1], "vertex");
145
- await testColoring(coloringTypes[2], "cell");
129
+ test("coloring vertex", async () => {
130
+ const dataStyleStore = useDataStyleStore();
131
+ const viewerStore = useViewerStore();
132
+ await dataStyleStore.setMeshCellsVertexAttributeName(id, vertex_attribute.name);
133
+ const coloringName = "vertex";
134
+ const result = dataStyleStore.setMeshCellsActiveColoring(id, coloringName);
135
+ expect(result).toBeInstanceOf(Promise);
136
+ await result;
137
+ expect(dataStyleStore.meshCellsActiveColoring(id)).toBe(coloringName);
138
+ expect(viewerStore.status).toBe(Status.CONNECTED);
139
+ });
140
+
141
+ test("coloring cell", async () => {
142
+ const dataStyleStore = useDataStyleStore();
143
+ const viewerStore = useViewerStore();
144
+ await dataStyleStore.setMeshCellsCellAttributeName(id, cell_attribute.name);
145
+ const coloringName = "cell";
146
+ const result = dataStyleStore.setMeshCellsActiveColoring(id, coloringName);
147
+ expect(result).toBeInstanceOf(Promise);
148
+ await result;
149
+ expect(dataStyleStore.meshCellsActiveColoring(id)).toBe(coloringName);
150
+ expect(viewerStore.status).toBe(Status.CONNECTED);
146
151
  });
147
152
  });
148
153
 
149
- test("Cells apply default style", async () => {
154
+ test("cells apply default style", async () => {
150
155
  const dataStyleStore = useDataStyleStore();
151
156
  const viewerStore = useViewerStore();
152
157
  const result = dataStyleStore.applyMeshCellsStyle(id);
@@ -20,18 +20,18 @@ const edge_attribute = { name: "edge_attribute" };
20
20
  let id = "",
21
21
  projectFolderPath = "";
22
22
 
23
- beforeAll(async () => {
24
- ({ id, projectFolderPath } = await setupIntegrationTests(file_name, geode_object));
25
- }, INTERVAL_TIMEOUT);
23
+ describe("mesh edges", () => {
24
+ beforeAll(async () => {
25
+ ({ id, projectFolderPath } = await setupIntegrationTests(file_name, geode_object));
26
+ }, INTERVAL_TIMEOUT);
26
27
 
27
- afterAll(async () => {
28
- console.log("afterAll mesh edges kill", projectFolderPath);
29
- await cleanupBackend(projectFolderPath);
30
- });
28
+ afterAll(async () => {
29
+ console.log("afterAll mesh edges kill", projectFolderPath);
30
+ await cleanupBackend(projectFolderPath);
31
+ });
31
32
 
32
- describe("Mesh edges", () => {
33
- describe("Edges", () => {
34
- test("Edges visibility", async () => {
33
+ describe("edges", () => {
34
+ test("edges visibility", async () => {
35
35
  const dataStyleStore = useDataStyleStore();
36
36
  const viewerStore = useViewerStore();
37
37
  const visibility = true;
@@ -50,10 +50,10 @@ describe("Mesh edges", () => {
50
50
  expect(viewerStore.status).toBe(Status.CONNECTED);
51
51
  });
52
52
 
53
- test("Edges color red", async () => {
53
+ test("edges color red", async () => {
54
54
  const dataStyleStore = useDataStyleStore();
55
55
  const viewerStore = useViewerStore();
56
- const color = { r: 255, g: 0, b: 0 };
56
+ const color = { red: 255, green: 0, blue: 0, alpha: 1 };
57
57
  const spy = vi.spyOn(viewerStore, "request");
58
58
  const result = dataStyleStore.setMeshEdgesColor(id, color);
59
59
  expect(result).toBeInstanceOf(Promise);
@@ -69,7 +69,7 @@ describe("Mesh edges", () => {
69
69
  expect(viewerStore.status).toBe(Status.CONNECTED);
70
70
  });
71
71
 
72
- test("Edges vertex attribute", async () => {
72
+ test("edges vertex attribute", async () => {
73
73
  const dataStyleStore = useDataStyleStore();
74
74
  const viewerStore = useViewerStore();
75
75
 
@@ -86,7 +86,7 @@ describe("Mesh edges", () => {
86
86
  expect(viewerStore.status).toBe(Status.CONNECTED);
87
87
  });
88
88
 
89
- test("Edges edge attribute", async () => {
89
+ test("edges edge attribute", async () => {
90
90
  const dataStyleStore = useDataStyleStore();
91
91
  const viewerStore = useViewerStore();
92
92
 
@@ -103,36 +103,42 @@ describe("Mesh edges", () => {
103
103
  expect(viewerStore.status).toBe(Status.CONNECTED);
104
104
  });
105
105
 
106
- test("Edges active coloring", async () => {
106
+ test("coloring color", async () => {
107
107
  const dataStyleStore = useDataStyleStore();
108
108
  const viewerStore = useViewerStore();
109
- const coloringTypes = [
110
- { name: "color" },
111
- {
112
- name: "vertex",
113
- function: () => dataStyleStore.setMeshEdgesVertexAttributeName(id, vertex_attribute.name),
114
- },
115
- {
116
- name: "edge",
117
- function: () => dataStyleStore.setMeshEdgesEdgeAttributeName(id, edge_attribute.name),
118
- },
119
- ];
120
- async function testColoring(coloringType) {
121
- if (coloringType.function) {
122
- await coloringType.function();
123
- }
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);
129
- }
109
+ const coloringName = "color";
110
+ const result = dataStyleStore.setMeshEdgesActiveColoring(id, coloringName);
111
+ expect(result).toBeInstanceOf(Promise);
112
+ await result;
113
+ expect(dataStyleStore.meshEdgesActiveColoring(id)).toBe(coloringName);
114
+ expect(viewerStore.status).toBe(Status.CONNECTED);
115
+ });
130
116
 
131
- await testColoring(coloringTypes[0]);
132
- await testColoring(coloringTypes[1]);
133
- await testColoring(coloringTypes[2]);
117
+ test("coloring vertex", async () => {
118
+ const dataStyleStore = useDataStyleStore();
119
+ const viewerStore = useViewerStore();
120
+ await dataStyleStore.setMeshEdgesVertexAttributeName(id, vertex_attribute.name);
121
+ const coloringName = "vertex";
122
+ const result = dataStyleStore.setMeshEdgesActiveColoring(id, coloringName);
123
+ expect(result).toBeInstanceOf(Promise);
124
+ await result;
125
+ expect(dataStyleStore.meshEdgesActiveColoring(id)).toBe(coloringName);
126
+ expect(viewerStore.status).toBe(Status.CONNECTED);
127
+ });
128
+
129
+ test("coloring edge", async () => {
130
+ const dataStyleStore = useDataStyleStore();
131
+ const viewerStore = useViewerStore();
132
+ await dataStyleStore.setMeshEdgesEdgeAttributeName(id, edge_attribute.name);
133
+ const coloringName = "edge";
134
+ const result = dataStyleStore.setMeshEdgesActiveColoring(id, coloringName);
135
+ expect(result).toBeInstanceOf(Promise);
136
+ await result;
137
+ expect(dataStyleStore.meshEdgesActiveColoring(id)).toBe(coloringName);
138
+ expect(viewerStore.status).toBe(Status.CONNECTED);
134
139
  });
135
- test("Edges apply style", async () => {
140
+
141
+ test("edges apply style", async () => {
136
142
  const dataStyleStore = useDataStyleStore();
137
143
  const viewerStore = useViewerStore();
138
144
  const result = dataStyleStore.applyMeshEdgesStyle(id);
@@ -18,18 +18,18 @@ const geode_object = "RegularGrid3D";
18
18
  let id = "",
19
19
  projectFolderPath = "";
20
20
 
21
- beforeAll(async () => {
22
- ({ id, projectFolderPath } = await setupIntegrationTests(file_name, geode_object));
23
- }, INTERVAL_TIMEOUT);
21
+ describe("mesh", () => {
22
+ beforeAll(async () => {
23
+ ({ id, projectFolderPath } = await setupIntegrationTests(file_name, geode_object));
24
+ }, INTERVAL_TIMEOUT);
24
25
 
25
- afterAll(async () => {
26
- console.log("afterAll mesh index kill", projectFolderPath);
27
- await cleanupBackend(projectFolderPath);
28
- });
26
+ afterAll(async () => {
27
+ console.log("afterAll mesh index kill", projectFolderPath);
28
+ await cleanupBackend(projectFolderPath);
29
+ });
29
30
 
30
- describe("Mesh", () => {
31
- describe("Mesh visibility", () => {
32
- test("Visibility true", async () => {
31
+ describe("mesh visibility", () => {
32
+ test("visibility true", async () => {
33
33
  const dataStyleStore = useDataStyleStore();
34
34
  const viewerStore = useViewerStore();
35
35
  const visibility = true;
@@ -49,8 +49,8 @@ describe("Mesh", () => {
49
49
  });
50
50
  });
51
51
 
52
- describe("Apply mesh default style", () => {
53
- test("Apply mesh default style", async () => {
52
+ describe("apply mesh default style", () => {
53
+ test("apply mesh default style", async () => {
54
54
  const dataStyleStore = useDataStyleStore();
55
55
  const viewerStore = useViewerStore();
56
56
  const result = dataStyleStore.applyMeshStyle(id);
@@ -19,18 +19,18 @@ const vertex_attribute = { name: "points" };
19
19
  let id = "",
20
20
  projectFolderPath = "";
21
21
 
22
- beforeAll(async () => {
23
- ({ id, projectFolderPath } = await setupIntegrationTests(file_name, geode_object));
24
- }, INTERVAL_TIMEOUT);
22
+ describe("mesh points", () => {
23
+ beforeAll(async () => {
24
+ ({ id, projectFolderPath } = await setupIntegrationTests(file_name, geode_object));
25
+ }, INTERVAL_TIMEOUT);
25
26
 
26
- afterAll(async () => {
27
- console.log("afterAll mesh points kill", projectFolderPath);
28
- await cleanupBackend(projectFolderPath);
29
- });
27
+ afterAll(async () => {
28
+ console.log("afterAll mesh points kill", projectFolderPath);
29
+ await cleanupBackend(projectFolderPath);
30
+ });
30
31
 
31
- describe("Mesh points", () => {
32
- describe("Points visibility", () => {
33
- test("Visibility true", async () => {
32
+ describe("points visibility", () => {
33
+ test("visibility true", async () => {
34
34
  const dataStyleStore = useDataStyleStore();
35
35
  const viewerStore = useViewerStore();
36
36
  const visibility = true;
@@ -50,11 +50,11 @@ describe("Mesh points", () => {
50
50
  });
51
51
  });
52
52
 
53
- describe("Points color", () => {
54
- test("Color red", async () => {
53
+ describe("points color", () => {
54
+ test("color red", async () => {
55
55
  const dataStyleStore = useDataStyleStore();
56
56
  const viewerStore = useViewerStore();
57
- const color = { r: 255, g: 0, b: 0 };
57
+ const color = { red: 255, green: 0, blue: 0, alpha: 1 };
58
58
  const spy = vi.spyOn(viewerStore, "request");
59
59
  const result = dataStyleStore.setMeshPointsColor(id, color);
60
60
  expect(result).toBeInstanceOf(Promise);
@@ -71,36 +71,33 @@ describe("Mesh points", () => {
71
71
  });
72
72
  });
73
73
 
74
- describe("Points active coloring", () => {
75
- test("test coloring", async () => {
74
+ describe("points active coloring", () => {
75
+ test("coloring color", async () => {
76
76
  const dataStyleStore = useDataStyleStore();
77
77
  const viewerStore = useViewerStore();
78
- const coloringTypes = [
79
- { name: "color" },
80
- {
81
- name: "vertex",
82
- function: () =>
83
- dataStyleStore.setMeshPointsVertexAttributeName(id, vertex_attribute.name),
84
- },
85
- ];
86
- async function testColoring(coloringType, expectedColoringType) {
87
- if (coloringType.function) {
88
- await coloringType.function();
89
- }
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);
95
- }
78
+ const coloringName = "color";
79
+ const result = dataStyleStore.setMeshPointsActiveColoring(id, coloringName);
80
+ expect(result).toBeInstanceOf(Promise);
81
+ await result;
82
+ expect(dataStyleStore.meshPointsActiveColoring(id)).toBe(coloringName);
83
+ expect(viewerStore.status).toBe(Status.CONNECTED);
84
+ });
96
85
 
97
- await testColoring(coloringTypes[0], "color");
98
- await testColoring(coloringTypes[1], "vertex");
86
+ test("coloring vertex", async () => {
87
+ const dataStyleStore = useDataStyleStore();
88
+ const viewerStore = useViewerStore();
89
+ await dataStyleStore.setMeshPointsVertexAttributeName(id, vertex_attribute.name);
90
+ const coloringName = "vertex";
91
+ const result = dataStyleStore.setMeshPointsActiveColoring(id, coloringName);
92
+ expect(result).toBeInstanceOf(Promise);
93
+ await result;
94
+ expect(dataStyleStore.meshPointsActiveColoring(id)).toBe(coloringName);
95
+ expect(viewerStore.status).toBe(Status.CONNECTED);
99
96
  });
100
97
  });
101
98
 
102
- describe("Points size", () => {
103
- test("Size 20", async () => {
99
+ describe("points size", () => {
100
+ test("size 20", async () => {
104
101
  const dataStyleStore = useDataStyleStore();
105
102
  const viewerStore = useViewerStore();
106
103
  const size = 20;
@@ -120,8 +117,8 @@ describe("Mesh points", () => {
120
117
  });
121
118
  });
122
119
 
123
- describe("Points vertex attribute", () => {
124
- test("test coloring", async () => {
120
+ describe("points vertex attribute", () => {
121
+ test("vertex attribute", async () => {
125
122
  const dataStyleStore = useDataStyleStore();
126
123
  const viewerStore = useViewerStore();
127
124
 
@@ -139,7 +136,7 @@ describe("Mesh points", () => {
139
136
  });
140
137
  });
141
138
 
142
- test("Points apply default style", async () => {
139
+ test("points apply default style", async () => {
143
140
  const dataStyleStore = useDataStyleStore();
144
141
  const viewerStore = useViewerStore();
145
142
  const result = dataStyleStore.applyMeshPointsStyle(id);