@geode/opengeodeweb-front 12.2.0-rc.1 → 12.2.0-rc.3

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 (62) hide show
  1. package/.build/server/utils/microservices_process.js +1 -1
  2. package/.build/tests/browser/helpers/crs.js +136 -0
  3. package/.build/tests/browser/helpers/crs_flows.js +60 -0
  4. package/.build/tests/browser/helpers/crs_shortlist.js +13 -0
  5. package/.build/tests/browser/helpers/crs_test_data.js +40 -0
  6. package/.build/tests/browser/helpers/image.js +25 -0
  7. package/.build/tests/browser/suites/crs.js +142 -0
  8. package/.build/tests/browser/suites/crs_harmonize.js +63 -0
  9. package/.build/tests/browser/suites/crs_shortlist.js +31 -0
  10. package/.build/tests/browser/suites/image/raster_image.js +33 -0
  11. package/.build/tests/browser/suites/index.js +8 -0
  12. package/app/app.config.ts +4 -0
  13. package/app/components/CrsAlign.vue +207 -0
  14. package/app/components/CrsDialog.vue +400 -0
  15. package/app/components/CrsDialogHost.vue +66 -0
  16. package/app/components/CrsSelector.vue +100 -3
  17. package/app/components/PickButton.vue +43 -0
  18. package/app/components/ProjectCrsDialog.vue +109 -0
  19. package/app/components/ToolPanel.vue +5 -2
  20. package/app/components/Viewer/CrsOverlays.vue +29 -0
  21. package/app/components/Viewer/Image/ImageOptions.vue +67 -0
  22. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +3 -2
  23. package/app/components/Viewer/Ui.vue +3 -2
  24. package/app/composables/crs.ts +197 -0
  25. package/app/composables/crs_align.ts +206 -0
  26. package/app/composables/crs_assign.ts +102 -0
  27. package/app/composables/crs_link.ts +22 -0
  28. package/app/composables/crs_shortlist.ts +63 -0
  29. package/app/composables/hover_highlight.ts +6 -5
  30. package/app/composables/project_crs.ts +197 -0
  31. package/app/composables/use_overlapping_picker.ts +6 -1
  32. package/app/composables/user_setting.ts +140 -0
  33. package/app/stores/basemap.ts +19 -2
  34. package/app/stores/crs.ts +11 -106
  35. package/app/stores/crs_helpers/geographic_list.ts +44 -0
  36. package/app/stores/crs_helpers/project_crs.ts +60 -0
  37. package/app/stores/crs_helpers/requests.ts +60 -0
  38. package/app/stores/data_style.ts +12 -1
  39. package/app/stores/menu_helpers/image.ts +11 -0
  40. package/app/stores/menu_helpers/menus_data.ts +2 -0
  41. package/app/types/identifiers.ts +8 -0
  42. package/app/utils/crs.ts +17 -1
  43. package/app/utils/default_styles/images.ts +16 -0
  44. package/app/utils/default_styles/index.ts +3 -2
  45. package/app/utils/import_item.ts +87 -0
  46. package/app/utils/import_workflow.ts +36 -94
  47. package/app/utils/reload_object.ts +26 -0
  48. package/app/utils/threshold_sources.ts +5 -1
  49. package/internal/stores/data_style/image/index.ts +107 -0
  50. package/package.json +1 -1
  51. package/server/utils/microservices_process.ts +4 -1
  52. package/tests/browser/data/test_lambert93_no_crs.og_pts3d +0 -0
  53. package/tests/browser/data/test_utm31n.og_pts3d +0 -0
  54. package/tests/browser/helpers/crs.ts +250 -0
  55. package/tests/browser/helpers/crs_flows.ts +115 -0
  56. package/tests/browser/helpers/crs_shortlist.ts +27 -0
  57. package/tests/browser/helpers/crs_test_data.ts +34 -0
  58. package/tests/browser/helpers/image.ts +33 -0
  59. package/tests/browser/suites/crs.ts +228 -0
  60. package/tests/browser/suites/crs_harmonize.ts +96 -0
  61. package/tests/browser/suites/crs_shortlist.ts +37 -0
  62. package/tests/browser/suites/image/raster_image.ts +40 -0
@@ -0,0 +1,115 @@
1
+ // Third party imports
2
+ import { type Page, expect } from "@playwright/test";
3
+
4
+ // Local imports
5
+ import { BREP_NAME, CURVE_NAME, POINTSET_NAME } from "./crs_test_data";
6
+ import {
7
+ applyAlignment,
8
+ clickAssign,
9
+ confirmConvert,
10
+ expectFeedback,
11
+ expectTreeCrs,
12
+ fillAlignPoints,
13
+ openCrsFromTree,
14
+ selectAlignmentCrs,
15
+ selectAssignMode,
16
+ selectConvertMode,
17
+ selectCrs,
18
+ selectScope,
19
+ } from "./crs";
20
+ import {
21
+ brepGeodeObjectType,
22
+ edgedCurveGeodeObjectType,
23
+ pointSetGeodeObjectType,
24
+ } from "./constants";
25
+ import { closeFeedbackSnackbar, moveMouseOutOfTheWay } from "./app_interaction";
26
+ import { getMainObjectTree } from "./object_trees/main_object_tree";
27
+ import { waitForActionSettled } from "./wait_for_action_settled";
28
+
29
+ async function closeCrsDialog(window: Page): Promise<void> {
30
+ await window.keyboard.press("Escape");
31
+ await moveMouseOutOfTheWay(window);
32
+ }
33
+
34
+ // The point set, the model and the curve of the crs suite
35
+ async function expectEveryRowCrs(window: Page, expected: string): Promise<void> {
36
+ await expectTreeCrs(window, pointSetGeodeObjectType, POINTSET_NAME, expected);
37
+ await expectTreeCrs(window, brepGeodeObjectType, BREP_NAME, expected);
38
+ await expectTreeCrs(window, edgedCurveGeodeObjectType, CURVE_NAME, expected);
39
+ }
40
+
41
+ async function fillAlignment(
42
+ window: Page,
43
+ source: { x: number; y: number }[],
44
+ target: { x: number; y: number }[],
45
+ crsName: string,
46
+ ): Promise<void> {
47
+ await fillAlignPoints(window, "crsAlignSource", source);
48
+ await fillAlignPoints(window, "crsAlignTarget", target);
49
+ await selectAlignmentCrs(window, crsName);
50
+ await moveMouseOutOfTheWay(window);
51
+ }
52
+
53
+ async function convertAloneTo(
54
+ window: Page,
55
+ geodeObjectType: string,
56
+ dataName: string,
57
+ crsName: string,
58
+ ): Promise<void> {
59
+ await openCrsFromTree(window, geodeObjectType, dataName);
60
+ await selectConvertMode(window);
61
+ await selectScope(window, "one");
62
+ await selectCrs(window, crsName);
63
+ await confirmConvert(window);
64
+ await moveMouseOutOfTheWay(window);
65
+ }
66
+
67
+ async function startMisfitAssign(
68
+ window: Page,
69
+ geodeObjectType: string,
70
+ dataName: string,
71
+ crsName: string,
72
+ ): Promise<void> {
73
+ await openCrsFromTree(window, geodeObjectType, dataName);
74
+ await selectAssignMode(window);
75
+ await selectCrs(window, crsName);
76
+ await clickAssign(window);
77
+ }
78
+
79
+ async function assignAnywayToAll(window: Page, crsName: string): Promise<void> {
80
+ await selectAssignMode(window);
81
+ await selectScope(window, "all");
82
+ await selectCrs(window, crsName);
83
+ await clickAssign(window);
84
+ await window.getByTestId("crsAssignAnyway").click();
85
+ await waitForActionSettled(window);
86
+ await closeFeedbackSnackbar(window);
87
+ await moveMouseOutOfTheWay(window);
88
+ }
89
+
90
+ // With a basemap (only in the apps that opt in), an alignment moving the data out of the domain of the project CRS
91
+ // Makes the basemap build fail: its message shows and the basemap is hidden. Without one, nothing else happens
92
+ async function applyAlignmentOffTheMap(window: Page): Promise<void> {
93
+ const basemapRow = getMainObjectTree(window)
94
+ .getByTestId("treeRowWrapper")
95
+ .filter({ hasText: "Basemap" });
96
+ if ((await basemapRow.count()) === 0) {
97
+ await applyAlignment(window);
98
+ return;
99
+ }
100
+ await expectFeedback(window, "Area outside the map projection limits", async () => {
101
+ await applyAlignment(window);
102
+ });
103
+ // Only the last build hides the basemap: no other message comes after
104
+ await expect(basemapRow.getByTestId("hiddenObjectEyeButton")).toBeVisible();
105
+ }
106
+
107
+ export {
108
+ applyAlignmentOffTheMap,
109
+ assignAnywayToAll,
110
+ closeCrsDialog,
111
+ convertAloneTo,
112
+ expectEveryRowCrs,
113
+ fillAlignment,
114
+ startMisfitAssign,
115
+ };
@@ -0,0 +1,27 @@
1
+ // Third party imports
2
+ import { type Page, expect } from "@playwright/test";
3
+
4
+ // Local imports
5
+ import { waitForActionSettled } from "./wait_for_action_settled";
6
+
7
+ // The star of a CRS row adds it to the favorites, kept as a chip above the search
8
+ async function toggleFavoriteCrs(window: Page, crsName: string): Promise<void> {
9
+ await window.getByTestId("crsSearchInput").locator("input").fill(crsName);
10
+ await window
11
+ .locator("tbody tr")
12
+ .filter({ hasText: crsName })
13
+ .first()
14
+ .getByTestId("crsFavoriteToggle")
15
+ .click();
16
+ await waitForActionSettled(window);
17
+ }
18
+
19
+ async function expectCrsChip(
20
+ window: Page,
21
+ kind: "crsFavoriteChip" | "crsRecentChip",
22
+ code: string,
23
+ ): Promise<void> {
24
+ await expect(window.getByTestId(kind).filter({ hasText: code })).toBeVisible();
25
+ }
26
+
27
+ export { expectCrsChip, toggleFavoriteCrs };
@@ -0,0 +1,34 @@
1
+ const BREP_FILE = "test.og_brep";
2
+ const POINTSET_FILE = "test.og_pts3d";
3
+ // Wells-like data sharing the local frame of the model: aligned with it
4
+ const CURVE_FILE = "test.og_edc3d";
5
+ const POINTSET_NAME = "test";
6
+ const BREP_NAME = "test";
7
+ const CURVE_NAME = "test";
8
+ const LAMBERT_93 = "RGF93 v1 / Lambert-93";
9
+ const UTM_31N = "WGS 84 / UTM zone 31N";
10
+ const CC42 = "RGF93 v1 / CC42";
11
+ const ALIGN_SOURCE = [
12
+ { x: 0, y: 0 },
13
+ { x: 1, y: 0 },
14
+ { x: 0, y: 1 },
15
+ ];
16
+ const ALIGN_TARGET = [
17
+ { x: 700_000, y: 6_600_000 },
18
+ { x: 700_010, y: 6_600_000 },
19
+ { x: 700_000, y: 6_600_010 },
20
+ ];
21
+
22
+ export {
23
+ ALIGN_SOURCE,
24
+ ALIGN_TARGET,
25
+ BREP_FILE,
26
+ BREP_NAME,
27
+ CC42,
28
+ CURVE_FILE,
29
+ CURVE_NAME,
30
+ LAMBERT_93,
31
+ POINTSET_FILE,
32
+ POINTSET_NAME,
33
+ UTM_31N,
34
+ };
@@ -0,0 +1,33 @@
1
+ // Third party imports
2
+ import type { Page } from "@playwright/test";
3
+
4
+ // Local imports
5
+ import { ensureMenuOpen, moveMouseOutOfTheWay } from "./viewer_interaction";
6
+ import { openDataContextMenu } from "./object_trees/main_object_tree";
7
+ import { waitForActionSettled } from "./wait_for_action_settled";
8
+
9
+ const IMAGE_MENU_TEST_ID = "imageMenu";
10
+
11
+ // Images are not pickable: their menu opens from the object tree
12
+ async function openImageMenu(
13
+ window: Page,
14
+ geodeObjectType: string,
15
+ dataName: string,
16
+ ): Promise<void> {
17
+ await openDataContextMenu(window, geodeObjectType, dataName);
18
+ await ensureMenuOpen(window, IMAGE_MENU_TEST_ID);
19
+ }
20
+
21
+ async function setImageOpacity(window: Page, opacity: number): Promise<void> {
22
+ await ensureMenuOpen(window, IMAGE_MENU_TEST_ID);
23
+ const track = window.getByTestId("imageOpacitySlider").locator(".v-slider").first();
24
+ const box = await track.boundingBox();
25
+ if (!box) {
26
+ throw new Error("Could not get bounding box of the image opacity slider");
27
+ }
28
+ await track.click({ position: { x: box.width * opacity, y: box.height / 2 } });
29
+ await moveMouseOutOfTheWay(window);
30
+ await waitForActionSettled(window);
31
+ }
32
+
33
+ export { IMAGE_MENU_TEST_ID, openImageMenu, setImageOpacity };
@@ -0,0 +1,228 @@
1
+ // Third party imports
2
+ import { expect } from "@playwright/test";
3
+
4
+ // Local imports
5
+ import {
6
+ ALIGN_SOURCE,
7
+ ALIGN_TARGET,
8
+ BREP_FILE,
9
+ BREP_NAME,
10
+ CC42,
11
+ CURVE_FILE,
12
+ CURVE_NAME,
13
+ LAMBERT_93,
14
+ POINTSET_FILE,
15
+ POINTSET_NAME,
16
+ UTM_31N,
17
+ } from "#browser_helpers/crs_test_data";
18
+ import {
19
+ applyAlignment,
20
+ confirmAssign,
21
+ confirmConvert,
22
+ confirmProjectCrs,
23
+ expectCrsMismatch,
24
+ expectCurrentCrs,
25
+ expectFeedback,
26
+ expectTreeCrs,
27
+ openCrsFromInfoCard,
28
+ openCrsFromTree,
29
+ openCrsFromWarning,
30
+ openProjectCrs,
31
+ selectConvertMode,
32
+ selectCrs,
33
+ startAlignment,
34
+ } from "#browser_helpers/crs";
35
+ import {
36
+ applyAlignmentOffTheMap,
37
+ assignAnywayToAll,
38
+ closeCrsDialog,
39
+ convertAloneTo,
40
+ expectEveryRowCrs,
41
+ fillAlignment,
42
+ startMisfitAssign,
43
+ } from "#browser_helpers/crs_flows";
44
+ import {
45
+ brepGeodeObjectType,
46
+ edgedCurveGeodeObjectType,
47
+ pointSetGeodeObjectType,
48
+ } from "#browser_helpers/constants";
49
+ import { closeFeedbackSnackbar, moveMouseOutOfTheWay } from "#browser_helpers/app_interaction";
50
+ import { waitForActionSettled } from "#browser_helpers/wait_for_action_settled";
51
+
52
+ import type { SuiteRuntime } from "#browser_helpers/suite_runtime";
53
+
54
+ // Shared with the apps built on this layer: each one runs it with its own test fixture and data loader
55
+ function registerTests({ test, loadTestDatas }: SuiteRuntime): void {
56
+ test.describe.configure({ mode: "serial" });
57
+
58
+ test("load objects", async ({ window }) => {
59
+ await loadTestDatas(window, [BREP_FILE]);
60
+ await loadTestDatas(window, [POINTSET_FILE]);
61
+ });
62
+
63
+ test("open the crs dialog of the point set", async ({ window }) => {
64
+ await openCrsFromTree(window, pointSetGeodeObjectType, POINTSET_NAME);
65
+ await expectCurrentCrs(window, "None (local coordinates)");
66
+ });
67
+
68
+ test("select a crs to assign", async ({ window }) => {
69
+ await selectCrs(window, LAMBERT_93);
70
+ });
71
+
72
+ test("assign the selected crs", async ({ window }) => {
73
+ // "This data only" by default: the point set alone, the project follows it
74
+ await confirmAssign(window);
75
+ await expectTreeCrs(window, pointSetGeodeObjectType, POINTSET_NAME, "EPSG:2154");
76
+ await moveMouseOutOfTheWay(window);
77
+ });
78
+
79
+ test("current crs is the assigned one", async ({ window }) => {
80
+ await openCrsFromTree(window, pointSetGeodeObjectType, POINTSET_NAME);
81
+ await expectCurrentCrs(window, "EPSG:2154");
82
+ });
83
+
84
+ test("open the convert mode", async ({ window }) => {
85
+ await selectConvertMode(window);
86
+ });
87
+
88
+ test("select a crs to convert to", async ({ window }) => {
89
+ await selectCrs(window, UTM_31N);
90
+ });
91
+
92
+ // "All data" by default: the project moves to UTM; the local model does not fit it and stays
93
+ test("convert to the selected crs", async ({ window }) => {
94
+ await confirmConvert(window);
95
+ await expectTreeCrs(window, pointSetGeodeObjectType, POINTSET_NAME, "EPSG:32631");
96
+ await moveMouseOutOfTheWay(window);
97
+ });
98
+
99
+ test("load a curve sharing the model frame", async ({ window }) => {
100
+ // Still in the model frame: the curve keeps no crs until it is georeferenced
101
+ await expectFeedback(window, "these coordinates do not match EPSG:32631", async () => {
102
+ await loadTestDatas(window, [CURVE_FILE]);
103
+ });
104
+ await moveMouseOutOfTheWay(window);
105
+ });
106
+
107
+ test("open the alignment panel", async ({ window }) => {
108
+ await openCrsFromTree(window, brepGeodeObjectType, BREP_NAME);
109
+ await startAlignment(window);
110
+ await expect(window.getByTestId("crsAlignPanel")).toBeVisible();
111
+ });
112
+
113
+ test("fill the affine alignment points and target crs", async ({ window }) => {
114
+ // "All data" by default: the curve shares the model frame
115
+ await fillAlignment(window, ALIGN_SOURCE, ALIGN_TARGET, LAMBERT_93);
116
+ });
117
+
118
+ // The aligned model lies far from the point set, misplaced by the Lambert-93 assigned anyway:
119
+ // Their extent leaves the UTM domain, so a basemap build fails and the basemap is hidden
120
+ test("apply the alignment", async ({ window }) => {
121
+ // The feedback can take up to its own timeout to show
122
+ test.slow();
123
+ await applyAlignmentOffTheMap(window);
124
+ await closeFeedbackSnackbar(window);
125
+ await moveMouseOutOfTheWay(window);
126
+ });
127
+
128
+ // Typed in Lambert-93, then converted to the project crs (UTM)
129
+ test("current crs is the project one", async ({ window }) => {
130
+ await expectTreeCrs(window, brepGeodeObjectType, BREP_NAME, "EPSG:32631");
131
+ // Aligned in the same request as the model
132
+ await expectTreeCrs(window, edgedCurveGeodeObjectType, CURVE_NAME, "EPSG:32631");
133
+ await moveMouseOutOfTheWay(window);
134
+ });
135
+
136
+ test("re-align this data only", async ({ window }) => {
137
+ await openCrsFromTree(window, brepGeodeObjectType, BREP_NAME);
138
+ await startAlignment(window);
139
+ // The model has a crs: "This data only" by default, the other data stay
140
+ await expect(window.getByTestId("crsAlignScope-one").locator("input")).toBeChecked();
141
+ await fillAlignment(window, ALIGN_SOURCE, ALIGN_TARGET, LAMBERT_93);
142
+ await applyAlignment(window);
143
+ await expectTreeCrs(window, brepGeodeObjectType, BREP_NAME, "EPSG:32631");
144
+ await moveMouseOutOfTheWay(window);
145
+ });
146
+
147
+ test("no data is flagged once every data follows the project", async ({ window }) => {
148
+ await expectCrsMismatch(window, brepGeodeObjectType, BREP_NAME, false);
149
+ await expectCrsMismatch(window, pointSetGeodeObjectType, POINTSET_NAME, false);
150
+ await moveMouseOutOfTheWay(window);
151
+ });
152
+
153
+ test("open the crs dialog from the object tree", async ({ window }) => {
154
+ await openCrsFromTree(window, pointSetGeodeObjectType, POINTSET_NAME);
155
+ await expectCurrentCrs(window, "EPSG:32631");
156
+ });
157
+
158
+ test("close the crs dialog opened from the object tree", async ({ window }) => {
159
+ await closeCrsDialog(window);
160
+ });
161
+
162
+ test("open the crs dialog from the info card", async ({ window }) => {
163
+ await openCrsFromInfoCard(window, pointSetGeodeObjectType, POINTSET_NAME);
164
+ await expectCurrentCrs(window, "EPSG:32631");
165
+ });
166
+
167
+ test("close the crs dialog opened from the info card", async ({ window }) => {
168
+ await closeCrsDialog(window);
169
+ });
170
+
171
+ test("convert the model alone", async ({ window }) => {
172
+ await convertAloneTo(window, brepGeodeObjectType, BREP_NAME, LAMBERT_93);
173
+ await expectTreeCrs(window, brepGeodeObjectType, BREP_NAME, "EPSG:2154");
174
+ await expectTreeCrs(window, edgedCurveGeodeObjectType, CURVE_NAME, "EPSG:32631");
175
+ await moveMouseOutOfTheWay(window);
176
+ });
177
+
178
+ test("the model out of the project crs is flagged in the tree", async ({ window }) => {
179
+ await expectCrsMismatch(window, brepGeodeObjectType, BREP_NAME, true);
180
+ await moveMouseOutOfTheWay(window);
181
+ });
182
+
183
+ test("the warning opens the crs dialog of the model", async ({ window }) => {
184
+ await openCrsFromWarning(window, brepGeodeObjectType, BREP_NAME);
185
+ await expectCurrentCrs(window, "EPSG:2154");
186
+ await closeCrsDialog(window);
187
+ });
188
+
189
+ test("open the project crs from the scene", async ({ window }) => {
190
+ await openProjectCrs(window);
191
+ // The tooltip of the project crs button would stay under the mouse
192
+ await moveMouseOutOfTheWay(window);
193
+ });
194
+
195
+ // The model is in Lambert-93, the others in UTM 31N: a Lambert-93 project moves the others
196
+ test("change the project crs", async ({ window }) => {
197
+ await selectCrs(window, LAMBERT_93);
198
+ await confirmProjectCrs(window);
199
+ await moveMouseOutOfTheWay(window);
200
+ await expectCrsMismatch(window, pointSetGeodeObjectType, POINTSET_NAME, false);
201
+ });
202
+
203
+ test("every data is in the project crs", async ({ window }) => {
204
+ await expectEveryRowCrs(window, "EPSG:2154");
205
+ await moveMouseOutOfTheWay(window);
206
+ });
207
+
208
+ // Every data is in Lambert-93. Their coordinates are local numbers: they do not fit CC42
209
+ test("relabeling a georeferenced data with a misfit crs asks first", async ({ window }) => {
210
+ await startMisfitAssign(window, brepGeodeObjectType, BREP_NAME, CC42);
211
+ await expect(window.getByTestId("crsAssignMismatch")).toContainText("Did you mean Convert?");
212
+ });
213
+
214
+ test("convert instead switches to convert", async ({ window }) => {
215
+ await window.getByTestId("crsConvertInstead").click();
216
+ await waitForActionSettled(window);
217
+ await expect(window.getByTestId("crsConvertButton")).toBeVisible();
218
+ });
219
+
220
+ test("assign anyway to all data", async ({ window }) => {
221
+ await assignAnywayToAll(window, CC42);
222
+ // Every data was in Lambert-93: all relabeled together
223
+ await expectEveryRowCrs(window, "EPSG:3942");
224
+ await moveMouseOutOfTheWay(window);
225
+ });
226
+ }
227
+
228
+ export { registerTests };
@@ -0,0 +1,96 @@
1
+ // Local imports
2
+ import { BREP_FILE, BREP_NAME, LAMBERT_93 } from "#browser_helpers/crs_test_data";
3
+ import { brepGeodeObjectType, pointSetGeodeObjectType } from "#browser_helpers/constants";
4
+ import {
5
+ clickAssign,
6
+ confirmAssign,
7
+ expectCrsMismatch,
8
+ expectCurrentCrs,
9
+ expectFeedback,
10
+ expectTreeCrs,
11
+ openCrsFromTree,
12
+ openCrsFromWarning,
13
+ selectCrs,
14
+ } from "#browser_helpers/crs";
15
+ import { moveMouseOutOfTheWay } from "#browser_helpers/app_interaction";
16
+
17
+ import type { SuiteRuntime } from "#browser_helpers/suite_runtime";
18
+
19
+ // Constants
20
+ // Around Paris in Lambert-93 metres, without crs
21
+ const LAMBERT_FILE = "test_lambert93_no_crs.og_pts3d";
22
+ const LAMBERT_NAME = "test_lambert93_no_crs";
23
+ // The same points, saved in UTM 31N
24
+ const UTM_FILE = "test_utm31n.og_pts3d";
25
+ const UTM_NAME = "test_utm31n";
26
+ // Local coordinates: they fit no CRS
27
+ const LOCAL_FILE = "test.og_pts3d";
28
+ const LOCAL_NAME = "test";
29
+
30
+ // Shared with the apps built on this layer: each one runs it with its own test fixture and data loader
31
+ function registerTests({ test, loadTestDatas }: SuiteRuntime): void {
32
+ test.describe.configure({ mode: "serial" });
33
+
34
+ test("load a model", async ({ window }) => {
35
+ await loadTestDatas(window, [BREP_FILE]);
36
+ });
37
+
38
+ // The first crs sets the project crs
39
+ test("assign a crs to the model", async ({ window }) => {
40
+ await openCrsFromTree(window, brepGeodeObjectType, BREP_NAME);
41
+ await selectCrs(window, LAMBERT_93);
42
+ await confirmAssign(window);
43
+ await expectTreeCrs(window, brepGeodeObjectType, BREP_NAME, "EPSG:2154");
44
+ await moveMouseOutOfTheWay(window);
45
+ });
46
+
47
+ // Their coordinates fit the project crs: they were made in it
48
+ test("imported data without crs take the project crs", async ({ window }) => {
49
+ await expectFeedback(window, `EPSG:2154 assigned: ${LAMBERT_NAME}`, async () => {
50
+ await loadTestDatas(window, [LAMBERT_FILE]);
51
+ });
52
+ await expectTreeCrs(window, pointSetGeodeObjectType, LAMBERT_NAME, "EPSG:2154");
53
+ await moveMouseOutOfTheWay(window);
54
+ });
55
+
56
+ test("imported data in another crs are converted to the project crs", async ({ window }) => {
57
+ await expectFeedback(window, `Converted to EPSG:2154: ${UTM_NAME}`, async () => {
58
+ await loadTestDatas(window, [UTM_FILE]);
59
+ });
60
+ await expectTreeCrs(window, pointSetGeodeObjectType, UTM_NAME, "EPSG:2154");
61
+ await moveMouseOutOfTheWay(window);
62
+ });
63
+
64
+ // Local coordinates keep no crs: the warning offers to georeference them
65
+ test("imported data that fit no crs are flagged in the tree", async ({ window }) => {
66
+ await expectFeedback(
67
+ window,
68
+ `${LOCAL_NAME}: these coordinates do not match EPSG:2154`,
69
+ async () => {
70
+ await loadTestDatas(window, [LOCAL_FILE]);
71
+ },
72
+ );
73
+ await expectCrsMismatch(window, pointSetGeodeObjectType, LOCAL_NAME, true);
74
+ await moveMouseOutOfTheWay(window);
75
+ });
76
+
77
+ test("open the crs dialog from the warning", async ({ window }) => {
78
+ await openCrsFromWarning(window, pointSetGeodeObjectType, LOCAL_NAME);
79
+ await expectCurrentCrs(window, "None (local coordinates)");
80
+ });
81
+
82
+ test("select the project crs", async ({ window }) => {
83
+ await selectCrs(window, LAMBERT_93);
84
+ });
85
+
86
+ // An explicit choice: assigned anyway, with the warning offering to georeference
87
+ test("assign the project crs to the data", async ({ window }) => {
88
+ await expectFeedback(window, "Georeference the data?", async () => {
89
+ await clickAssign(window);
90
+ });
91
+ await expectCrsMismatch(window, pointSetGeodeObjectType, LOCAL_NAME, false);
92
+ await moveMouseOutOfTheWay(window);
93
+ });
94
+ }
95
+
96
+ export { registerTests };
@@ -0,0 +1,37 @@
1
+ // Local imports
2
+ import { LAMBERT_93, POINTSET_FILE, POINTSET_NAME, UTM_31N } from "#browser_helpers/crs_test_data";
3
+ import { confirmAssign, openCrsFromTree, selectCrs } from "#browser_helpers/crs";
4
+ import { expectCrsChip, toggleFavoriteCrs } from "#browser_helpers/crs_shortlist";
5
+ import { closeCrsDialog } from "#browser_helpers/crs_flows";
6
+ import { pointSetGeodeObjectType } from "#browser_helpers/constants";
7
+
8
+ import type { SuiteRuntime } from "#browser_helpers/suite_runtime";
9
+
10
+ // Shared with the apps built on this layer: each one runs it with its own test fixture and data loader
11
+ function registerTests({ test, loadTestDatas }: SuiteRuntime): void {
12
+ test.describe.configure({ mode: "serial" });
13
+
14
+ test("load a point set", async ({ window }) => {
15
+ await loadTestDatas(window, [POINTSET_FILE]);
16
+ });
17
+
18
+ test("a starred crs becomes a favorite chip", async ({ window }) => {
19
+ await openCrsFromTree(window, pointSetGeodeObjectType, POINTSET_NAME);
20
+ await toggleFavoriteCrs(window, UTM_31N);
21
+ await expectCrsChip(window, "crsFavoriteChip", "EPSG:32631");
22
+ });
23
+
24
+ test("assign a crs", async ({ window }) => {
25
+ await selectCrs(window, LAMBERT_93);
26
+ await confirmAssign(window);
27
+ });
28
+
29
+ test("the favorite and the assigned crs come back as chips", async ({ window }) => {
30
+ await openCrsFromTree(window, pointSetGeodeObjectType, POINTSET_NAME);
31
+ await expectCrsChip(window, "crsFavoriteChip", "EPSG:32631");
32
+ await expectCrsChip(window, "crsRecentChip", "EPSG:2154");
33
+ await closeCrsDialog(window);
34
+ });
35
+ }
36
+
37
+ export { registerTests };
@@ -0,0 +1,40 @@
1
+ // Local imports
2
+ import { IMAGE_MENU_TEST_ID, openImageMenu, setImageOpacity } from "#browser_helpers/image";
3
+ import type { SuiteRuntime } from "#browser_helpers/suite_runtime";
4
+ import { closeAllMenus } from "#browser_helpers/app_interaction";
5
+ import { expandMainObjectTree } from "#browser_helpers/object_trees/main_object_tree";
6
+ import { setVisibilityGeneric } from "#browser_helpers/viewer_interaction";
7
+
8
+ // Constants
9
+ const inputFilename = "test_texture.png";
10
+ const dataName = "test_texture";
11
+ const geodeObjectType = "RasterImage2D";
12
+ const halfOpacity = 0.5;
13
+
14
+ // Shared with the apps built on this layer: each one runs it with its own test fixture and data loader
15
+ function registerTests({ test, loadTestDatas }: SuiteRuntime): void {
16
+ test.describe.configure({ mode: "serial" });
17
+
18
+ test("load shows the image colors", async ({ window }) => {
19
+ await loadTestDatas(window, [inputFilename]);
20
+ await expandMainObjectTree(window);
21
+ });
22
+
23
+ test("image menu", async ({ window }) => {
24
+ await openImageMenu(window, geodeObjectType, dataName);
25
+ });
26
+
27
+ test("image opacity", async ({ window }) => {
28
+ await setImageOpacity(window, halfOpacity);
29
+ });
30
+
31
+ test("image hidden", async ({ window }) => {
32
+ await setVisibilityGeneric(window, IMAGE_MENU_TEST_ID, "imageVisibilitySwitch", false);
33
+ });
34
+
35
+ test("close image menu", async ({ window }) => {
36
+ await closeAllMenus(window);
37
+ });
38
+ }
39
+
40
+ export { registerTests };