@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,18 +1,18 @@
|
|
|
1
1
|
// Third party imports
|
|
2
|
-
import * as components from "vuetify/components"
|
|
3
|
-
import { describe, expect, test, vi } from "vitest"
|
|
4
|
-
import { flushPromises } from "@vue/test-utils"
|
|
5
|
-
import { mountSuspended } from "@nuxt/test-utils/runtime"
|
|
2
|
+
import * as components from "vuetify/components";
|
|
3
|
+
import { describe, expect, test, vi } from "vitest";
|
|
4
|
+
import { flushPromises } from "@vue/test-utils";
|
|
5
|
+
import { mountSuspended } from "@nuxt/test-utils/runtime";
|
|
6
6
|
|
|
7
7
|
// Local imports
|
|
8
|
-
import { setupActivePinia, vuetify } from "@ogw_tests/utils"
|
|
9
|
-
import InspectorInspectionButton from "@ogw_front/components/Inspector/InspectionButton"
|
|
10
|
-
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
8
|
+
import { setupActivePinia, vuetify } from "@ogw_tests/utils";
|
|
9
|
+
import InspectorInspectionButton from "@ogw_front/components/Inspector/InspectionButton";
|
|
10
|
+
import { useGeodeStore } from "@ogw_front/stores/geode";
|
|
11
11
|
|
|
12
|
-
describe("Inspector/InspectionButton",
|
|
13
|
-
const pinia = setupActivePinia()
|
|
14
|
-
const geodeStore = useGeodeStore()
|
|
15
|
-
geodeStore.base_url = ""
|
|
12
|
+
describe("Inspector/InspectionButton", () => {
|
|
13
|
+
const pinia = setupActivePinia();
|
|
14
|
+
const geodeStore = useGeodeStore();
|
|
15
|
+
geodeStore.base_url = "";
|
|
16
16
|
|
|
17
17
|
test(`Test with issues`, async () => {
|
|
18
18
|
const inspection_result = {
|
|
@@ -30,39 +30,39 @@ describe("Inspector/InspectionButton", async () => {
|
|
|
30
30
|
issues: ["issue 1"],
|
|
31
31
|
},
|
|
32
32
|
],
|
|
33
|
-
}
|
|
33
|
+
};
|
|
34
34
|
|
|
35
35
|
geodeStore.request = vi.fn((_schema, params, callbacks) => {
|
|
36
36
|
if (callbacks?.response_function) {
|
|
37
37
|
callbacks.response_function({
|
|
38
38
|
inspection_result,
|
|
39
|
-
})
|
|
39
|
+
});
|
|
40
40
|
}
|
|
41
41
|
return Promise.resolve({
|
|
42
42
|
inspection_result,
|
|
43
|
-
})
|
|
44
|
-
})
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
45
|
|
|
46
|
-
const geode_object_type = "BRep"
|
|
47
|
-
const filename = "test.txt"
|
|
46
|
+
const geode_object_type = "BRep";
|
|
47
|
+
const filename = "test.txt";
|
|
48
48
|
|
|
49
49
|
const wrapper = await mountSuspended(InspectorInspectionButton, {
|
|
50
50
|
global: {
|
|
51
51
|
plugins: [vuetify, pinia],
|
|
52
52
|
},
|
|
53
53
|
props: { geode_object_type, filename },
|
|
54
|
-
})
|
|
54
|
+
});
|
|
55
55
|
|
|
56
|
-
expect(wrapper.exists()).toBeTruthy()
|
|
57
|
-
const v_btn = await wrapper.findComponent(components.VBtn)
|
|
58
|
-
await v_btn.trigger("click")
|
|
59
|
-
await flushPromises()
|
|
56
|
+
expect(wrapper.exists()).toBeTruthy();
|
|
57
|
+
const v_btn = await wrapper.findComponent(components.VBtn);
|
|
58
|
+
await v_btn.trigger("click");
|
|
59
|
+
await flushPromises();
|
|
60
60
|
|
|
61
|
-
expect(wrapper.emitted()).toHaveProperty("update_values")
|
|
62
|
-
expect(wrapper.emitted().update_values).toHaveLength(1)
|
|
61
|
+
expect(wrapper.emitted()).toHaveProperty("update_values");
|
|
62
|
+
expect(wrapper.emitted().update_values).toHaveLength(1);
|
|
63
63
|
expect(wrapper.emitted().update_values[0][0]).toStrictEqual({
|
|
64
64
|
inspection_result: [inspection_result],
|
|
65
|
-
})
|
|
66
|
-
expect(wrapper.emitted()).toHaveProperty("increment_step")
|
|
67
|
-
})
|
|
68
|
-
})
|
|
65
|
+
});
|
|
66
|
+
expect(wrapper.emitted()).toHaveProperty("increment_step");
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Third party imports
|
|
2
|
-
import { describe, expect, test } from "vitest"
|
|
3
|
-
import { mountSuspended } from "@nuxt/test-utils/runtime"
|
|
2
|
+
import { describe, expect, test } from "vitest";
|
|
3
|
+
import { mountSuspended } from "@nuxt/test-utils/runtime";
|
|
4
4
|
|
|
5
5
|
// Local imports
|
|
6
|
-
import InspectorResultPanel from "@ogw_front/components/Inspector/ResultPanel"
|
|
7
|
-
import { vuetify } from "@ogw_tests/utils"
|
|
6
|
+
import InspectorResultPanel from "@ogw_front/components/Inspector/ResultPanel";
|
|
7
|
+
import { vuetify } from "@ogw_tests/utils";
|
|
8
8
|
|
|
9
|
-
describe("Inspector/ResultPanel",
|
|
9
|
+
describe("Inspector/ResultPanel", () => {
|
|
10
10
|
test(`Test with issues`, async () => {
|
|
11
11
|
const inspection_result = [
|
|
12
12
|
{
|
|
@@ -14,27 +14,24 @@ describe("Inspector/ResultPanel", async () => {
|
|
|
14
14
|
nb_issues: 26,
|
|
15
15
|
children: [],
|
|
16
16
|
},
|
|
17
|
-
]
|
|
17
|
+
];
|
|
18
18
|
|
|
19
19
|
const wrapper = await mountSuspended(InspectorResultPanel, {
|
|
20
20
|
global: {
|
|
21
21
|
plugins: [vuetify],
|
|
22
22
|
},
|
|
23
23
|
props: { inspection_result },
|
|
24
|
-
})
|
|
24
|
+
});
|
|
25
25
|
|
|
26
|
-
expect(wrapper.exists()).toBeTruthy()
|
|
27
|
-
expect(wrapper.componentVM.inspection_result).toStrictEqual(
|
|
28
|
-
inspection_result,
|
|
29
|
-
)
|
|
26
|
+
expect(wrapper.exists()).toBeTruthy();
|
|
27
|
+
expect(wrapper.componentVM.inspection_result).toStrictEqual(inspection_result);
|
|
30
28
|
|
|
31
|
-
const child_result_panel_wrapper =
|
|
32
|
-
|
|
33
|
-
expect(child_result_panel_wrapper.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
})
|
|
29
|
+
const child_result_panel_wrapper = await wrapper.findComponent(InspectorResultPanel);
|
|
30
|
+
expect(child_result_panel_wrapper.exists()).toBeTruthy();
|
|
31
|
+
expect(child_result_panel_wrapper.componentVM.inspection_result).toStrictEqual(
|
|
32
|
+
inspection_result[0].children,
|
|
33
|
+
);
|
|
34
|
+
});
|
|
38
35
|
|
|
39
36
|
test(`Test without issues`, async () => {
|
|
40
37
|
const inspection_result = [
|
|
@@ -42,20 +39,18 @@ describe("Inspector/ResultPanel", async () => {
|
|
|
42
39
|
title: "Brep inspection",
|
|
43
40
|
nb_issues: 0,
|
|
44
41
|
},
|
|
45
|
-
]
|
|
42
|
+
];
|
|
46
43
|
const wrapper = await mountSuspended(InspectorResultPanel, {
|
|
47
44
|
global: {
|
|
48
45
|
plugins: [vuetify],
|
|
49
46
|
},
|
|
50
47
|
props: { inspection_result },
|
|
51
|
-
})
|
|
48
|
+
});
|
|
52
49
|
|
|
53
|
-
expect(wrapper.exists()).toBeTruthy()
|
|
50
|
+
expect(wrapper.exists()).toBeTruthy();
|
|
54
51
|
|
|
55
|
-
console.log({ wrapper })
|
|
52
|
+
console.log({ wrapper });
|
|
56
53
|
|
|
57
|
-
expect(wrapper.componentVM.inspection_result).toStrictEqual(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
})
|
|
61
|
-
})
|
|
54
|
+
expect(wrapper.componentVM.inspection_result).toStrictEqual(inspection_result);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -1,39 +1,37 @@
|
|
|
1
|
-
import { describe, expect, test, vi } from "vitest"
|
|
1
|
+
import { describe, expect, test, vi } from "vitest";
|
|
2
2
|
|
|
3
|
-
import Launcher from "@ogw_front/components/Launcher"
|
|
4
|
-
import ResizeObserver from "resize-observer-polyfill"
|
|
5
|
-
import { flushPromises } from "@vue/test-utils"
|
|
6
|
-
import { mountSuspended } from "@nuxt/test-utils/runtime"
|
|
3
|
+
import Launcher from "@ogw_front/components/Launcher";
|
|
4
|
+
import ResizeObserver from "resize-observer-polyfill";
|
|
5
|
+
import { flushPromises } from "@vue/test-utils";
|
|
6
|
+
import { mountSuspended } from "@nuxt/test-utils/runtime";
|
|
7
7
|
|
|
8
|
-
import { setupActivePinia, vuetify } from "@ogw_tests/utils"
|
|
9
|
-
import { useInfraStore } from "@ogw_front/stores/infra"
|
|
8
|
+
import { setupActivePinia, vuetify } from "@ogw_tests/utils";
|
|
9
|
+
import { useInfraStore } from "@ogw_front/stores/infra";
|
|
10
10
|
|
|
11
11
|
// Mock navigator.locks API
|
|
12
|
-
const mockLockRequest = vi
|
|
13
|
-
.fn()
|
|
14
|
-
.mockImplementation(async (name, task) => await task({ name }))
|
|
12
|
+
const mockLockRequest = vi.fn().mockImplementation(async (name, task) => await task({ name }));
|
|
15
13
|
|
|
16
14
|
vi.stubGlobal("navigator", {
|
|
17
15
|
...navigator,
|
|
18
16
|
locks: {
|
|
19
17
|
request: mockLockRequest,
|
|
20
18
|
},
|
|
21
|
-
})
|
|
19
|
+
});
|
|
22
20
|
|
|
23
|
-
globalThis.ResizeObserver = ResizeObserver
|
|
21
|
+
globalThis.ResizeObserver = ResizeObserver;
|
|
24
22
|
|
|
25
|
-
describe(Launcher,
|
|
23
|
+
describe(Launcher, () => {
|
|
26
24
|
test(`Mount`, async () => {
|
|
27
|
-
const pinia = setupActivePinia()
|
|
28
|
-
const infraStore = useInfraStore()
|
|
25
|
+
const pinia = setupActivePinia();
|
|
26
|
+
const infraStore = useInfraStore();
|
|
29
27
|
const wrapper = await mountSuspended(Launcher, {
|
|
30
28
|
global: {
|
|
31
29
|
plugins: [vuetify, pinia],
|
|
32
30
|
},
|
|
33
|
-
})
|
|
34
|
-
expect(wrapper.exists()).toBeTruthy()
|
|
35
|
-
await infraStore.$patch({ is_captcha_validated: true })
|
|
36
|
-
await flushPromises()
|
|
37
|
-
expect(infraStore.create_backend).toHaveBeenCalled()
|
|
38
|
-
})
|
|
39
|
-
})
|
|
31
|
+
});
|
|
32
|
+
expect(wrapper.exists()).toBeTruthy();
|
|
33
|
+
await infraStore.$patch({ is_captcha_validated: true });
|
|
34
|
+
await flushPromises();
|
|
35
|
+
expect(infraStore.create_backend).toHaveBeenCalled();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
// Third party imports
|
|
2
|
-
import * as components from "vuetify/components"
|
|
3
|
-
import { describe, expect, test, vi } from "vitest"
|
|
4
|
-
import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime"
|
|
5
|
-
import { flushPromises } from "@vue/test-utils"
|
|
6
|
-
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
2
|
+
import * as components from "vuetify/components";
|
|
3
|
+
import { describe, expect, test, vi } from "vitest";
|
|
4
|
+
import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime";
|
|
5
|
+
import { flushPromises } from "@vue/test-utils";
|
|
6
|
+
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
7
7
|
|
|
8
8
|
// Local imports
|
|
9
|
-
import { setupActivePinia, vuetify } from "@ogw_tests/utils"
|
|
10
|
-
import FileUploader from "@ogw_front/components/FileUploader"
|
|
11
|
-
import MissingFilesSelector from "@ogw_front/components/MissingFilesSelector"
|
|
12
|
-
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
9
|
+
import { setupActivePinia, vuetify } from "@ogw_tests/utils";
|
|
10
|
+
import FileUploader from "@ogw_front/components/FileUploader";
|
|
11
|
+
import MissingFilesSelector from "@ogw_front/components/MissingFilesSelector";
|
|
12
|
+
import { useGeodeStore } from "@ogw_front/stores/geode";
|
|
13
13
|
|
|
14
|
-
const EXPECTED_LENGTH = 1
|
|
15
|
-
const FIRST_INDEX = 0
|
|
16
|
-
const SECOND_INDEX = 1
|
|
14
|
+
const EXPECTED_LENGTH = 1;
|
|
15
|
+
const FIRST_INDEX = 0;
|
|
16
|
+
const SECOND_INDEX = 1;
|
|
17
17
|
|
|
18
|
-
const upload_file_schema = schemas.opengeodeweb_back.upload_file
|
|
18
|
+
const upload_file_schema = schemas.opengeodeweb_back.upload_file;
|
|
19
19
|
|
|
20
20
|
describe(MissingFilesSelector, () => {
|
|
21
|
-
const pinia = setupActivePinia()
|
|
22
|
-
const geodeStore = useGeodeStore()
|
|
23
|
-
geodeStore.base_url = ""
|
|
21
|
+
const pinia = setupActivePinia();
|
|
22
|
+
const geodeStore = useGeodeStore();
|
|
23
|
+
geodeStore.base_url = "";
|
|
24
24
|
|
|
25
25
|
test(`Select file`, async () => {
|
|
26
26
|
geodeStore.request = vi.fn((schema, params, callbacks) => {
|
|
@@ -29,14 +29,14 @@ describe(MissingFilesSelector, () => {
|
|
|
29
29
|
has_missing_files: true,
|
|
30
30
|
mandatory_files: ["fake_file.txt"],
|
|
31
31
|
additional_files: ["fake_file_2.txt"],
|
|
32
|
-
})
|
|
32
|
+
});
|
|
33
33
|
}
|
|
34
34
|
return Promise.resolve({
|
|
35
35
|
has_missing_files: true,
|
|
36
36
|
mandatory_files: ["fake_file.txt"],
|
|
37
37
|
additional_files: ["fake_file_2.txt"],
|
|
38
|
-
})
|
|
39
|
-
})
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
40
|
|
|
41
41
|
const wrapper = await mountSuspended(MissingFilesSelector, {
|
|
42
42
|
global: {
|
|
@@ -47,32 +47,32 @@ describe(MissingFilesSelector, () => {
|
|
|
47
47
|
geode_object_type: "BRep",
|
|
48
48
|
filenames: ["fake_file.txt"],
|
|
49
49
|
},
|
|
50
|
-
})
|
|
50
|
+
});
|
|
51
51
|
|
|
52
|
-
const file_uploader = wrapper.findComponent(FileUploader)
|
|
53
|
-
expect(file_uploader.exists()).toBeTruthy()
|
|
52
|
+
const file_uploader = wrapper.findComponent(FileUploader);
|
|
53
|
+
expect(file_uploader.exists()).toBeTruthy();
|
|
54
54
|
|
|
55
|
-
const v_file_input = file_uploader.find('input[type="file"]')
|
|
56
|
-
const files = [new File(["fake_file"], "fake_file.txt")]
|
|
55
|
+
const v_file_input = file_uploader.find('input[type="file"]');
|
|
56
|
+
const files = [new File(["fake_file"], "fake_file.txt")];
|
|
57
57
|
Object.defineProperty(v_file_input.element, "files", {
|
|
58
58
|
value: files,
|
|
59
59
|
writable: true,
|
|
60
|
-
})
|
|
61
|
-
await v_file_input.trigger("change")
|
|
62
|
-
const v_btn = file_uploader.findComponent(components.VBtn)
|
|
60
|
+
});
|
|
61
|
+
await v_file_input.trigger("change");
|
|
62
|
+
const v_btn = file_uploader.findComponent(components.VBtn);
|
|
63
63
|
|
|
64
64
|
registerEndpoint(upload_file_schema.$id, {
|
|
65
65
|
method: upload_file_schema.methods[SECOND_INDEX],
|
|
66
66
|
handler: () => ({}),
|
|
67
|
-
})
|
|
68
|
-
await v_btn.trigger("click")
|
|
69
|
-
await flushPromises()
|
|
70
|
-
await flushPromises()
|
|
71
|
-
expect(wrapper.emitted()).toHaveProperty("update_values")
|
|
72
|
-
expect(wrapper.emitted().update_values).toHaveLength(EXPECTED_LENGTH)
|
|
67
|
+
});
|
|
68
|
+
await v_btn.trigger("click");
|
|
69
|
+
await flushPromises();
|
|
70
|
+
await flushPromises();
|
|
71
|
+
expect(wrapper.emitted()).toHaveProperty("update_values");
|
|
72
|
+
expect(wrapper.emitted().update_values).toHaveLength(EXPECTED_LENGTH);
|
|
73
73
|
expect(wrapper.emitted().update_values[FIRST_INDEX][FIRST_INDEX]).toEqual({
|
|
74
74
|
additional_files: files,
|
|
75
|
-
})
|
|
76
|
-
expect(wrapper.emitted().increment_step).toHaveLength(EXPECTED_LENGTH)
|
|
77
|
-
})
|
|
78
|
-
})
|
|
75
|
+
});
|
|
76
|
+
expect(wrapper.emitted().increment_step).toHaveLength(EXPECTED_LENGTH);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
import * as components from "vuetify/components"
|
|
2
|
-
import { describe, expect, test } from "vitest"
|
|
3
|
-
import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime"
|
|
4
|
-
import { flushPromises } from "@vue/test-utils"
|
|
1
|
+
import * as components from "vuetify/components";
|
|
2
|
+
import { describe, expect, test } from "vitest";
|
|
3
|
+
import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime";
|
|
4
|
+
import { flushPromises } from "@vue/test-utils";
|
|
5
5
|
|
|
6
|
-
import { setupActivePinia, vuetify } from "@ogw_tests/utils"
|
|
7
|
-
import ObjectSelector from "@ogw_front/components/ObjectSelector"
|
|
8
|
-
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
9
|
-
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
6
|
+
import { setupActivePinia, vuetify } from "@ogw_tests/utils";
|
|
7
|
+
import ObjectSelector from "@ogw_front/components/ObjectSelector";
|
|
8
|
+
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
9
|
+
import { useGeodeStore } from "@ogw_front/stores/geode";
|
|
10
10
|
|
|
11
|
-
const EXPECTED_LENGTH = 1
|
|
12
|
-
const FIRST_INDEX = 0
|
|
13
|
-
const LOADABLE_SCORE = 1
|
|
14
|
-
const PRIORITY_1 = 1
|
|
15
|
-
const PRIORITY_2 = 2
|
|
11
|
+
const EXPECTED_LENGTH = 1;
|
|
12
|
+
const FIRST_INDEX = 0;
|
|
13
|
+
const LOADABLE_SCORE = 1;
|
|
14
|
+
const PRIORITY_1 = 1;
|
|
15
|
+
const PRIORITY_2 = 2;
|
|
16
16
|
|
|
17
|
-
const { allowed_objects } = schemas.opengeodeweb_back
|
|
17
|
+
const { allowed_objects } = schemas.opengeodeweb_back;
|
|
18
18
|
|
|
19
19
|
describe(ObjectSelector, () => {
|
|
20
|
-
const pinia = setupActivePinia()
|
|
21
|
-
const geodeStore = useGeodeStore()
|
|
22
|
-
geodeStore.base_url = ""
|
|
20
|
+
const pinia = setupActivePinia();
|
|
21
|
+
const geodeStore = useGeodeStore();
|
|
22
|
+
geodeStore.base_url = "";
|
|
23
23
|
|
|
24
24
|
test(`test loadable with one class`, async () => {
|
|
25
25
|
const response = {
|
|
26
26
|
allowed_objects: {},
|
|
27
|
-
}
|
|
28
|
-
const geode_object_1 = "BRep"
|
|
29
|
-
response["allowed_objects"][geode_object_1] = { is_loadable: true }
|
|
27
|
+
};
|
|
28
|
+
const geode_object_1 = "BRep";
|
|
29
|
+
response["allowed_objects"][geode_object_1] = { is_loadable: true };
|
|
30
30
|
registerEndpoint(allowed_objects.$id, {
|
|
31
31
|
method: allowed_objects.methods[FIRST_INDEX],
|
|
32
32
|
handler: () => response,
|
|
33
|
-
})
|
|
33
|
+
});
|
|
34
34
|
const wrapper = await mountSuspended(ObjectSelector, {
|
|
35
35
|
global: {
|
|
36
36
|
plugins: [vuetify, pinia],
|
|
37
37
|
},
|
|
38
38
|
props: { filenames: ["test.toto"] },
|
|
39
|
-
})
|
|
40
|
-
const v_card = wrapper.findComponent(components.VCard)
|
|
41
|
-
const v_img = v_card.findComponent(components.VImg)
|
|
42
|
-
expect(v_img.vm.src).toContain(`${geode_object_1}.svg`)
|
|
43
|
-
expect(wrapper.emitted()).toHaveProperty("update_values")
|
|
44
|
-
expect(wrapper.emitted().update_values).toHaveLength(EXPECTED_LENGTH)
|
|
39
|
+
});
|
|
40
|
+
const v_card = wrapper.findComponent(components.VCard);
|
|
41
|
+
const v_img = v_card.findComponent(components.VImg);
|
|
42
|
+
expect(v_img.vm.src).toContain(`${geode_object_1}.svg`);
|
|
43
|
+
expect(wrapper.emitted()).toHaveProperty("update_values");
|
|
44
|
+
expect(wrapper.emitted().update_values).toHaveLength(EXPECTED_LENGTH);
|
|
45
45
|
expect(wrapper.emitted().update_values[FIRST_INDEX][FIRST_INDEX]).toEqual({
|
|
46
46
|
geode_object_type: geode_object_1,
|
|
47
|
-
})
|
|
48
|
-
wrapper.unmount()
|
|
49
|
-
})
|
|
47
|
+
});
|
|
48
|
+
wrapper.unmount();
|
|
49
|
+
});
|
|
50
50
|
|
|
51
51
|
test(`test loabable with multiple classes`, async () => {
|
|
52
52
|
const response = {
|
|
53
53
|
allowed_objects: {},
|
|
54
|
-
}
|
|
55
|
-
const geode_object_1 = "BRep"
|
|
56
|
-
const geode_object_2 = "EdgedCurve3D"
|
|
57
|
-
response["allowed_objects"][geode_object_1] = { is_loadable: true }
|
|
58
|
-
response["allowed_objects"][geode_object_2] = { is_loadable: true }
|
|
54
|
+
};
|
|
55
|
+
const geode_object_1 = "BRep";
|
|
56
|
+
const geode_object_2 = "EdgedCurve3D";
|
|
57
|
+
response["allowed_objects"][geode_object_1] = { is_loadable: true };
|
|
58
|
+
response["allowed_objects"][geode_object_2] = { is_loadable: true };
|
|
59
59
|
registerEndpoint(allowed_objects.$id, {
|
|
60
60
|
method: allowed_objects.methods[FIRST_INDEX],
|
|
61
61
|
handler: () => response,
|
|
62
|
-
})
|
|
62
|
+
});
|
|
63
63
|
const wrapper = await mountSuspended(ObjectSelector, {
|
|
64
64
|
global: {
|
|
65
65
|
plugins: [vuetify, pinia],
|
|
66
66
|
},
|
|
67
67
|
props: { filenames: ["test.toto"] },
|
|
68
|
-
})
|
|
69
|
-
const v_card = wrapper.findComponent(components.VCard)
|
|
70
|
-
const v_img = v_card.findComponent(components.VImg)
|
|
71
|
-
expect(v_img.vm.src).toContain(`${geode_object_1}.svg`)
|
|
72
|
-
await flushPromises()
|
|
73
|
-
await v_card.trigger("click")
|
|
74
|
-
await flushPromises()
|
|
75
|
-
expect(wrapper.emitted()).toHaveProperty("update_values")
|
|
76
|
-
expect(wrapper.emitted().update_values).toHaveLength(EXPECTED_LENGTH)
|
|
68
|
+
});
|
|
69
|
+
const v_card = wrapper.findComponent(components.VCard);
|
|
70
|
+
const v_img = v_card.findComponent(components.VImg);
|
|
71
|
+
expect(v_img.vm.src).toContain(`${geode_object_1}.svg`);
|
|
72
|
+
await flushPromises();
|
|
73
|
+
await v_card.trigger("click");
|
|
74
|
+
await flushPromises();
|
|
75
|
+
expect(wrapper.emitted()).toHaveProperty("update_values");
|
|
76
|
+
expect(wrapper.emitted().update_values).toHaveLength(EXPECTED_LENGTH);
|
|
77
77
|
expect(wrapper.emitted().update_values[FIRST_INDEX][FIRST_INDEX]).toEqual({
|
|
78
78
|
geode_object_type: geode_object_1,
|
|
79
|
-
})
|
|
80
|
-
wrapper.unmount()
|
|
81
|
-
})
|
|
79
|
+
});
|
|
80
|
+
wrapper.unmount();
|
|
81
|
+
});
|
|
82
82
|
|
|
83
83
|
test(`test object_priority when is_loadable scores equal`, async () => {
|
|
84
|
-
const response = { allowed_objects: {} }
|
|
85
|
-
const geode_object_1 = "BRep"
|
|
86
|
-
const geode_object_2 = "EdgedCurve3D"
|
|
84
|
+
const response = { allowed_objects: {} };
|
|
85
|
+
const geode_object_1 = "BRep";
|
|
86
|
+
const geode_object_2 = "EdgedCurve3D";
|
|
87
87
|
response["allowed_objects"][geode_object_1] = {
|
|
88
88
|
is_loadable: LOADABLE_SCORE,
|
|
89
89
|
object_priority: PRIORITY_2,
|
|
90
|
-
}
|
|
90
|
+
};
|
|
91
91
|
response["allowed_objects"][geode_object_2] = {
|
|
92
92
|
is_loadable: LOADABLE_SCORE,
|
|
93
93
|
object_priority: PRIORITY_1,
|
|
94
|
-
}
|
|
94
|
+
};
|
|
95
95
|
registerEndpoint(allowed_objects.$id, {
|
|
96
96
|
method: allowed_objects.methods[FIRST_INDEX],
|
|
97
97
|
handler: () => response,
|
|
98
|
-
})
|
|
98
|
+
});
|
|
99
99
|
const wrapper = await mountSuspended(ObjectSelector, {
|
|
100
100
|
global: {
|
|
101
101
|
plugins: [vuetify, pinia],
|
|
102
102
|
},
|
|
103
103
|
props: { filenames: ["test.toto"] },
|
|
104
|
-
})
|
|
104
|
+
});
|
|
105
105
|
|
|
106
|
-
await flushPromises()
|
|
107
|
-
expect(wrapper.emitted()).toHaveProperty("update_values")
|
|
108
|
-
expect(wrapper.emitted().update_values).toHaveLength(EXPECTED_LENGTH)
|
|
106
|
+
await flushPromises();
|
|
107
|
+
expect(wrapper.emitted()).toHaveProperty("update_values");
|
|
108
|
+
expect(wrapper.emitted().update_values).toHaveLength(EXPECTED_LENGTH);
|
|
109
109
|
expect(wrapper.emitted().update_values[FIRST_INDEX][FIRST_INDEX]).toEqual({
|
|
110
110
|
geode_object_type: geode_object_1,
|
|
111
|
-
})
|
|
112
|
-
wrapper.unmount()
|
|
113
|
-
})
|
|
114
|
-
})
|
|
111
|
+
});
|
|
112
|
+
wrapper.unmount();
|
|
113
|
+
});
|
|
114
|
+
});
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { describe, expect, test } from "vitest"
|
|
2
|
-
import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime"
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime";
|
|
3
3
|
|
|
4
|
-
import { setupActivePinia, vuetify } from "@ogw_tests/utils"
|
|
5
|
-
import PackagesVersions from "@ogw_front/components/PackagesVersions"
|
|
6
|
-
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
4
|
+
import { setupActivePinia, vuetify } from "@ogw_tests/utils";
|
|
5
|
+
import PackagesVersions from "@ogw_front/components/PackagesVersions";
|
|
6
|
+
import { useGeodeStore } from "@ogw_front/stores/geode";
|
|
7
7
|
|
|
8
|
-
const FIRST_INDEX = 0
|
|
8
|
+
const FIRST_INDEX = 0;
|
|
9
9
|
|
|
10
|
-
describe(PackagesVersions,
|
|
10
|
+
describe(PackagesVersions, () => {
|
|
11
11
|
test(`Mount`, async () => {
|
|
12
|
-
const pinia = setupActivePinia()
|
|
13
|
-
const geodeStore = useGeodeStore()
|
|
14
|
-
geodeStore.base_url = ""
|
|
12
|
+
const pinia = setupActivePinia();
|
|
13
|
+
const geodeStore = useGeodeStore();
|
|
14
|
+
geodeStore.base_url = "";
|
|
15
15
|
|
|
16
16
|
const schema = {
|
|
17
17
|
$id: "/versions",
|
|
@@ -19,7 +19,7 @@ describe(PackagesVersions, async () => {
|
|
|
19
19
|
type: "object",
|
|
20
20
|
properties: {},
|
|
21
21
|
additionalProperties: false,
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
registerEndpoint(schema.$id, {
|
|
24
24
|
method: schema.methods[FIRST_INDEX],
|
|
25
25
|
handler: () => ({
|
|
@@ -30,13 +30,13 @@ describe(PackagesVersions, async () => {
|
|
|
30
30
|
},
|
|
31
31
|
],
|
|
32
32
|
}),
|
|
33
|
-
})
|
|
33
|
+
});
|
|
34
34
|
const wrapper = await mountSuspended(PackagesVersions, {
|
|
35
35
|
global: {
|
|
36
36
|
plugins: [vuetify, pinia],
|
|
37
37
|
},
|
|
38
38
|
props: { schema },
|
|
39
|
-
})
|
|
40
|
-
expect(wrapper.exists()).toBeTruthy()
|
|
41
|
-
})
|
|
42
|
-
})
|
|
39
|
+
});
|
|
40
|
+
expect(wrapper.exists()).toBeTruthy();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { computed, reactive, ref, shallowRef } from "vue"
|
|
2
|
-
import { describe, expect, test } from "vitest"
|
|
3
|
-
import ResizeObserver from "resize-observer-polyfill"
|
|
4
|
-
import { mount } from "@vue/test-utils"
|
|
1
|
+
import { computed, reactive, ref, shallowRef } from "vue";
|
|
2
|
+
import { describe, expect, test } from "vitest";
|
|
3
|
+
import ResizeObserver from "resize-observer-polyfill";
|
|
4
|
+
import { mount } from "@vue/test-utils";
|
|
5
5
|
|
|
6
|
-
import ObjectSelector from "@ogw_front/components/ObjectSelector"
|
|
7
|
-
import Step from "@ogw_front/components/Step"
|
|
6
|
+
import ObjectSelector from "@ogw_front/components/ObjectSelector";
|
|
7
|
+
import Step from "@ogw_front/components/Step";
|
|
8
8
|
|
|
9
|
-
import { vuetify } from "@ogw_tests/utils"
|
|
9
|
+
import { vuetify } from "@ogw_tests/utils";
|
|
10
10
|
|
|
11
|
-
globalThis.ResizeObserver = ResizeObserver
|
|
11
|
+
globalThis.ResizeObserver = ResizeObserver;
|
|
12
12
|
|
|
13
13
|
describe(Step, () => {
|
|
14
|
-
test(`BRep`,
|
|
15
|
-
const geode_object_type = ref("BRep")
|
|
16
|
-
const files = ref([])
|
|
14
|
+
test(`BRep`, () => {
|
|
15
|
+
const geode_object_type = ref("BRep");
|
|
16
|
+
const files = ref([]);
|
|
17
17
|
const stepper_tree = reactive({
|
|
18
18
|
current_step_index: ref(0),
|
|
19
19
|
geode_object_type,
|
|
@@ -29,21 +29,20 @@ describe(Step, () => {
|
|
|
29
29
|
},
|
|
30
30
|
chips: computed(() => {
|
|
31
31
|
if (geode_object_type.value === "") {
|
|
32
|
-
return []
|
|
33
|
-
} else {
|
|
34
|
-
return [geode_object_type.value]
|
|
32
|
+
return [];
|
|
35
33
|
}
|
|
34
|
+
return [geode_object_type.value];
|
|
36
35
|
}),
|
|
37
36
|
},
|
|
38
37
|
],
|
|
39
|
-
})
|
|
38
|
+
});
|
|
40
39
|
const wrapper = mount(Step, {
|
|
41
40
|
global: {
|
|
42
41
|
plugins: [vuetify],
|
|
43
42
|
provide: { stepper_tree },
|
|
44
43
|
},
|
|
45
44
|
props: { step_index: 0 },
|
|
46
|
-
})
|
|
47
|
-
expect(wrapper.exists()).toBeTruthy()
|
|
48
|
-
})
|
|
49
|
-
})
|
|
45
|
+
});
|
|
46
|
+
expect(wrapper.exists()).toBeTruthy();
|
|
47
|
+
});
|
|
48
|
+
});
|