@geode/opengeodeweb-front 10.4.1 → 10.4.2-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/app/components/DeleteDialog.vue +1 -1
- package/app/components/DragAndDrop.vue +8 -5
- package/app/components/FileUploader.vue +3 -3
- package/app/components/GlassCard.vue +4 -4
- package/app/components/HybridRenderingView.vue +1 -5
- package/app/components/Inspector/InspectionButton.vue +6 -7
- package/app/components/Launcher.vue +1 -1
- package/app/components/ObjectSelector.vue +1 -1
- package/app/components/PackagesVersions.vue +1 -1
- package/app/components/RemoteRenderingView.vue +1 -1
- package/app/components/Screenshot.vue +2 -2
- package/app/components/SearchBar.vue +10 -16
- package/app/components/Step.vue +3 -1
- package/app/components/ViewToolbar.vue +0 -1
- package/app/components/Viewer/ContextMenu.vue +11 -11
- package/app/components/Viewer/ContextMenuItem.vue +1 -1
- package/app/components/Viewer/Options/AttributeColorBar.vue +1 -5
- package/app/components/Viewer/Options/ColorMapList.vue +2 -6
- package/app/components/Viewer/Options/ColorMapPicker.vue +3 -3
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +1 -1
- package/app/components/Viewer/Options/TextureItem.vue +2 -2
- package/app/components/Viewer/Options/TexturesSelector.vue +4 -4
- package/app/components/Viewer/Tree/ObjectTree.vue +4 -8
- package/app/components/ZScaling.vue +4 -4
- package/app/composables/project_manager.js +0 -2
- package/app/composables/run_function_when_microservices_connected.js +0 -2
- package/app/stores/data.js +18 -12
- package/app/stores/data_style.js +11 -11
- package/app/stores/geode.js +2 -2
- package/app/stores/hybrid_viewer.js +15 -24
- package/app/stores/infra.js +6 -2
- package/app/stores/lambda.js +1 -1
- package/app/stores/menu.js +1 -2
- package/app/stores/viewer.js +6 -6
- package/app/utils/colormap.js +3 -1
- package/app/utils/local.js +29 -34
- package/app/utils/status.js +1 -1
- package/app/utils/upload_file.js +2 -2
- package/app/utils/validate_schema.js +2 -2
- package/internal/database/database.js +17 -4
- package/internal/stores/data_style/mesh/cells/cell.js +1 -1
- package/internal/stores/data_style/mesh/cells/common.js +1 -1
- package/internal/stores/data_style/mesh/cells/vertex.js +1 -1
- package/internal/stores/data_style/mesh/edges/common.js +1 -1
- package/internal/stores/data_style/mesh/edges/edge.js +2 -2
- package/internal/stores/data_style/mesh/edges/vertex.js +1 -1
- package/internal/stores/data_style/mesh/index.js +2 -2
- package/internal/stores/data_style/mesh/points/common.js +1 -1
- package/internal/stores/data_style/mesh/points/vertex.js +1 -1
- package/internal/stores/data_style/mesh/polygons/common.js +1 -1
- package/internal/stores/data_style/mesh/polygons/polygon.js +1 -1
- package/internal/stores/data_style/mesh/polygons/vertex.js +1 -1
- package/internal/stores/data_style/mesh/polyhedra/common.js +1 -1
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +1 -1
- package/internal/stores/data_style/mesh/polyhedra/vertex.js +1 -1
- package/internal/stores/data_style/model/blocks/color.js +1 -4
- package/internal/stores/data_style/model/blocks/common.js +1 -1
- package/internal/stores/data_style/model/blocks/index.js +5 -3
- package/internal/stores/data_style/model/blocks/visibility.js +1 -3
- package/internal/stores/data_style/model/corners/color.js +1 -4
- package/internal/stores/data_style/model/corners/common.js +1 -1
- package/internal/stores/data_style/model/corners/index.js +5 -3
- package/internal/stores/data_style/model/corners/visibility.js +1 -4
- package/internal/stores/data_style/model/edges/common.js +1 -1
- package/internal/stores/data_style/model/index.js +2 -2
- package/internal/stores/data_style/model/lines/color.js +1 -4
- package/internal/stores/data_style/model/lines/common.js +1 -1
- package/internal/stores/data_style/model/lines/index.js +5 -3
- package/internal/stores/data_style/model/lines/visibility.js +1 -4
- package/internal/stores/data_style/model/points/common.js +1 -1
- package/internal/stores/data_style/model/surfaces/color.js +1 -3
- package/internal/stores/data_style/model/surfaces/common.js +1 -1
- package/internal/stores/data_style/model/surfaces/index.js +5 -3
- package/internal/stores/data_style/model/surfaces/visibility.js +1 -2
- package/internal/utils/api_fetch.js +5 -7
- package/internal/utils/viewer_call.js +5 -7
- package/nuxt.config.js +8 -1
- package/package.json +3 -3
- package/scripts/generate_geode_objects.js +1 -1
- package/tests/integration/microservices/back/requirements.txt +1 -1
- package/tests/integration/microservices/viewer/requirements.txt +1 -1
- package/tests/integration/setup.js +5 -5
- package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +2 -2
- package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +2 -2
- package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +2 -2
- package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +2 -2
- package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +2 -2
- package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +2 -2
- package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +2 -2
- package/tests/integration/stores/data_style/model/corners.nuxt.test.js +2 -2
- package/tests/integration/stores/data_style/model/edges.nuxt.test.js +2 -2
- package/tests/integration/stores/data_style/model/index.nuxt.test.js +2 -2
- package/tests/integration/stores/data_style/model/lines.nuxt.test.js +2 -2
- package/tests/integration/stores/data_style/model/points.nuxt.test.js +2 -2
- package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +25 -25
- package/tests/integration/stores/viewer.nuxt.test.js +3 -3
- package/tests/setup_indexeddb.js +1 -1
- package/tests/unit/components/CrsSelector.nuxt.test.js +4 -4
- package/tests/unit/components/ExtensionSelector.nuxt.test.js +4 -7
- package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +1 -1
- package/tests/unit/components/FeedBack/Snackers.nuxt.test.js +1 -1
- package/tests/unit/components/FileSelector.nuxt.test.js +1 -1
- package/tests/unit/components/FileUploader.nuxt.test.js +1 -1
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +1 -1
- package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +1 -1
- package/tests/unit/components/Launcher.nuxt.test.js +1 -1
- package/tests/unit/components/MissingFilesSelector.nuxt.test.js +1 -1
- package/tests/unit/components/ObjectSelector.nuxt.test.js +1 -1
- package/tests/unit/components/PackagesVersions.nuxt.test.js +1 -1
- package/tests/unit/components/Step.nuxt.test.js +1 -1
- package/tests/unit/components/Stepper.nuxt.test.js +1 -1
- package/tests/unit/composables/api_fetch.nuxt.test.js +3 -3
- package/tests/unit/composables/{ProjectManager.nuxt.test.js → project_manager.nuxt.test.js} +12 -13
- package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +6 -6
- package/tests/unit/composables/upload_file.nuxt.test.js +2 -2
- package/tests/unit/plugins/project_load.nuxt.test.js +4 -4
- package/tests/unit/stores/{App.nuxt.test.js → app.nuxt.test.js} +1 -3
- package/tests/unit/stores/{Feedback.nuxt.test.js → feedback.nuxt.test.js} +8 -5
- package/tests/unit/stores/{Geode.nuxt.test.js → geode.nuxt.test.js} +3 -3
- package/tests/unit/stores/{Infra.nuxt.test.js → infra.nuxt.test.js} +2 -2
- package/tests/unit/stores/{Lambda.nuxt.test.js → lambda.nuxt.test.js} +2 -2
- package/tests/unit/stores/{Treeview.nuxt.test.js → treeview.nuxt.test.js} +2 -2
- package/tests/unit/stores/{Viewer.nuxt.test.js → viewer.nuxt.test.js} +1 -1
- package/tests/unit/utils/recaptcha.nuxt.test.js +11 -7
- package/tests/unit/utils/validate_schema.nuxt.test.js +1 -1
- package/tests/utils.js +1 -0
- package/tests/vitest.config.js +12 -4
- package/vuetify_config.js +1 -1
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
kill_back,
|
|
9
9
|
kill_viewer,
|
|
10
10
|
} from "@ogw_front/utils/local"
|
|
11
|
-
import Status from "@ogw_front/utils/status"
|
|
12
|
-
import { setupIntegrationTests } from "
|
|
11
|
+
import { Status } from "@ogw_front/utils/status"
|
|
12
|
+
import { setupIntegrationTests } from "@ogw_tests/integration/setup"
|
|
13
13
|
import { useDataStore } from "@ogw_front/stores/data"
|
|
14
14
|
import { useDataStyleStore } from "@ogw_front/stores/data_style"
|
|
15
15
|
import { useViewerStore } from "@ogw_front/stores/viewer"
|
|
@@ -20,30 +20,30 @@ const model_surfaces_schemas = viewer_schemas.opengeodeweb_viewer.model.surfaces
|
|
|
20
20
|
const file_name = "test.og_brep"
|
|
21
21
|
const geode_object = "BRep"
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
describe("model surfaces", () => {
|
|
24
|
+
let back_port = 0,
|
|
25
|
+
id = "",
|
|
26
|
+
project_folder_path = "",
|
|
27
|
+
viewer_port = 0
|
|
27
28
|
|
|
28
|
-
beforeEach(async () => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, INTERVAL_TIMEOUT)
|
|
29
|
+
beforeEach(async () => {
|
|
30
|
+
;({ id, back_port, viewer_port, project_folder_path } =
|
|
31
|
+
await setupIntegrationTests(file_name, geode_object))
|
|
32
|
+
}, INTERVAL_TIMEOUT)
|
|
32
33
|
|
|
33
|
-
afterEach(async () => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})
|
|
34
|
+
afterEach(async () => {
|
|
35
|
+
console.log(
|
|
36
|
+
"afterEach model surfaces kill",
|
|
37
|
+
back_port,
|
|
38
|
+
viewer_port,
|
|
39
|
+
project_folder_path,
|
|
40
|
+
)
|
|
41
|
+
await Promise.all([kill_back(back_port), kill_viewer(viewer_port)])
|
|
42
|
+
delete_folder_recursive(project_folder_path)
|
|
43
|
+
})
|
|
43
44
|
|
|
44
|
-
describe("
|
|
45
|
-
|
|
46
|
-
test("Visibility true", async () => {
|
|
45
|
+
describe("surfaces visibility", () => {
|
|
46
|
+
test("visibility true", async () => {
|
|
47
47
|
const dataStyleStore = useDataStyleStore()
|
|
48
48
|
const viewerStore = useViewerStore()
|
|
49
49
|
const dataStore = useDataStore()
|
|
@@ -78,8 +78,8 @@ describe("Model surfaces", () => {
|
|
|
78
78
|
})
|
|
79
79
|
})
|
|
80
80
|
|
|
81
|
-
describe("
|
|
82
|
-
test("
|
|
81
|
+
describe("surfaces color", () => {
|
|
82
|
+
test("color red", async () => {
|
|
83
83
|
const dataStyleStore = useDataStyleStore()
|
|
84
84
|
const viewerStore = useViewerStore()
|
|
85
85
|
const dataStore = useDataStore()
|
|
@@ -8,9 +8,9 @@ import opengeodeweb_viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb
|
|
|
8
8
|
import {
|
|
9
9
|
runMicroservices,
|
|
10
10
|
teardownIntegrationTests,
|
|
11
|
-
} from "
|
|
12
|
-
import Status from "@ogw_front/utils/status"
|
|
13
|
-
import { setupActivePinia } from "
|
|
11
|
+
} from "@ogw_tests/integration/setup"
|
|
12
|
+
import { Status } from "@ogw_front/utils/status"
|
|
13
|
+
import { setupActivePinia } from "@ogw_tests/utils"
|
|
14
14
|
import { useViewerStore } from "@ogw_front/stores/viewer"
|
|
15
15
|
|
|
16
16
|
const CONNECT_TIMEOUT = 25_000
|
package/tests/setup_indexeddb.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// Third party imports
|
|
2
|
-
import { mountSuspended } from "@nuxt/test-utils/runtime"
|
|
3
2
|
import { beforeEach, describe, expect, test, vi } from "vitest"
|
|
3
|
+
import { mountSuspended } from "@nuxt/test-utils/runtime"
|
|
4
4
|
|
|
5
5
|
// Local imports
|
|
6
|
+
import { setupActivePinia, vuetify } from "@ogw_tests/utils"
|
|
6
7
|
import CrsSelector from "@ogw_front/components/CrsSelector"
|
|
7
8
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
8
|
-
import { setupActivePinia, vuetify } from "../../utils"
|
|
9
9
|
|
|
10
10
|
const EXPECTED_LENGTH = 1
|
|
11
11
|
const FIRST_INDEX = 0
|
|
12
12
|
|
|
13
|
-
let pinia
|
|
14
|
-
let geodeStore
|
|
13
|
+
let pinia = undefined
|
|
14
|
+
let geodeStore = undefined
|
|
15
15
|
|
|
16
16
|
beforeEach(() => {
|
|
17
17
|
pinia = setupActivePinia()
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Third party imports
|
|
2
2
|
import * as components from "vuetify/components"
|
|
3
|
-
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
4
|
-
import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime"
|
|
5
3
|
import { beforeEach, describe, expect, test, vi } from "vitest"
|
|
4
|
+
import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime"
|
|
6
5
|
import { nextTick } from "vue"
|
|
6
|
+
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
7
7
|
|
|
8
8
|
// Local imports
|
|
9
|
-
import { setupActivePinia, vuetify } from "
|
|
9
|
+
import { setupActivePinia, vuetify } from "@ogw_tests/utils"
|
|
10
10
|
import ExtensionSelector from "@ogw_front/components/ExtensionSelector"
|
|
11
11
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
12
12
|
|
|
@@ -22,15 +22,12 @@ const geodeStore = useGeodeStore()
|
|
|
22
22
|
beforeEach(() => {
|
|
23
23
|
geodeStore.base_url = ""
|
|
24
24
|
|
|
25
|
-
geodeStore.request = vi.fn((
|
|
25
|
+
geodeStore.request = vi.fn(() => {
|
|
26
26
|
const response = {
|
|
27
27
|
geode_objects_and_output_extensions: {
|
|
28
28
|
BRep: { msh: { is_saveable: true } },
|
|
29
29
|
},
|
|
30
30
|
}
|
|
31
|
-
if (callbacks?.response_function) {
|
|
32
|
-
callbacks.response_function(response)
|
|
33
|
-
}
|
|
34
31
|
return Promise.resolve(response)
|
|
35
32
|
})
|
|
36
33
|
})
|
|
@@ -3,7 +3,7 @@ import { describe, expect, test, vi } from "vitest"
|
|
|
3
3
|
import { mount } from "@vue/test-utils"
|
|
4
4
|
|
|
5
5
|
// Local imports
|
|
6
|
-
import { setupActivePinia, vuetify } from "
|
|
6
|
+
import { setupActivePinia, vuetify } from "@ogw_tests/utils"
|
|
7
7
|
import FeedBackErrorBanner from "@ogw_front/components/FeedBack/ErrorBanner"
|
|
8
8
|
import { useFeedbackStore } from "@ogw_front/stores/feedback"
|
|
9
9
|
|
|
@@ -4,7 +4,7 @@ import { describe, expect, test, vi } from "vitest"
|
|
|
4
4
|
import { mount } from "@vue/test-utils"
|
|
5
5
|
|
|
6
6
|
// Local imports
|
|
7
|
-
import { setupActivePinia, vuetify } from "
|
|
7
|
+
import { setupActivePinia, vuetify } from "@ogw_tests/utils"
|
|
8
8
|
import FeedBackSnackers from "@ogw_front/components/FeedBack/Snackers"
|
|
9
9
|
import { useFeedbackStore } from "@ogw_front/stores/feedback"
|
|
10
10
|
|
|
@@ -6,7 +6,7 @@ import { flushPromises } from "@vue/test-utils"
|
|
|
6
6
|
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
7
7
|
|
|
8
8
|
// Local imports
|
|
9
|
-
import { setupActivePinia, vuetify } from "
|
|
9
|
+
import { setupActivePinia, vuetify } from "@ogw_tests/utils"
|
|
10
10
|
import FileSelector from "@ogw_front/components/FileSelector"
|
|
11
11
|
import FileUploader from "@ogw_front/components/FileUploader"
|
|
12
12
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
@@ -6,7 +6,7 @@ import { flushPromises } from "@vue/test-utils"
|
|
|
6
6
|
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
7
7
|
|
|
8
8
|
// Local imports
|
|
9
|
-
import { setupActivePinia, vuetify } from "
|
|
9
|
+
import { setupActivePinia, vuetify } from "@ogw_tests/utils"
|
|
10
10
|
import FileUploader from "@ogw_front/components/FileUploader"
|
|
11
11
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
12
12
|
|
|
@@ -5,7 +5,7 @@ import { flushPromises } from "@vue/test-utils"
|
|
|
5
5
|
import { mountSuspended } from "@nuxt/test-utils/runtime"
|
|
6
6
|
|
|
7
7
|
// Local imports
|
|
8
|
-
import { setupActivePinia, vuetify } from "
|
|
8
|
+
import { setupActivePinia, vuetify } from "@ogw_tests/utils"
|
|
9
9
|
import InspectorInspectionButton from "@ogw_front/components/Inspector/InspectionButton"
|
|
10
10
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
11
11
|
|
|
@@ -4,7 +4,7 @@ import { mountSuspended } from "@nuxt/test-utils/runtime"
|
|
|
4
4
|
|
|
5
5
|
// Local imports
|
|
6
6
|
import InspectorResultPanel from "@ogw_front/components/Inspector/ResultPanel"
|
|
7
|
-
import { vuetify } from "
|
|
7
|
+
import { vuetify } from "@ogw_tests/utils"
|
|
8
8
|
|
|
9
9
|
describe("Inspector/ResultPanel", async () => {
|
|
10
10
|
test(`Test with issues`, async () => {
|
|
@@ -5,8 +5,8 @@ import ResizeObserver from "resize-observer-polyfill"
|
|
|
5
5
|
import { flushPromises } from "@vue/test-utils"
|
|
6
6
|
import { mountSuspended } from "@nuxt/test-utils/runtime"
|
|
7
7
|
|
|
8
|
+
import { setupActivePinia, vuetify } from "@ogw_tests/utils"
|
|
8
9
|
import { useInfraStore } from "@ogw_front/stores/infra"
|
|
9
|
-
import { setupActivePinia, vuetify } from "../../utils"
|
|
10
10
|
|
|
11
11
|
// Mock navigator.locks API
|
|
12
12
|
const mockLockRequest = vi
|
|
@@ -6,7 +6,7 @@ import { flushPromises } from "@vue/test-utils"
|
|
|
6
6
|
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
7
7
|
|
|
8
8
|
// Local imports
|
|
9
|
-
import { setupActivePinia, vuetify } from "
|
|
9
|
+
import { setupActivePinia, vuetify } from "@ogw_tests/utils"
|
|
10
10
|
import FileUploader from "@ogw_front/components/FileUploader"
|
|
11
11
|
import MissingFilesSelector from "@ogw_front/components/MissingFilesSelector"
|
|
12
12
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
@@ -3,7 +3,7 @@ import { describe, expect, test } from "vitest"
|
|
|
3
3
|
import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime"
|
|
4
4
|
import { flushPromises } from "@vue/test-utils"
|
|
5
5
|
|
|
6
|
-
import { setupActivePinia, vuetify } from "
|
|
6
|
+
import { setupActivePinia, vuetify } from "@ogw_tests/utils"
|
|
7
7
|
import ObjectSelector from "@ogw_front/components/ObjectSelector"
|
|
8
8
|
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
9
9
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, expect, test } from "vitest"
|
|
2
2
|
import { mountSuspended, registerEndpoint } from "@nuxt/test-utils/runtime"
|
|
3
3
|
|
|
4
|
-
import { setupActivePinia, vuetify } from "
|
|
4
|
+
import { setupActivePinia, vuetify } from "@ogw_tests/utils"
|
|
5
5
|
import PackagesVersions from "@ogw_front/components/PackagesVersions"
|
|
6
6
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
7
7
|
|
|
@@ -6,7 +6,7 @@ import { mount } from "@vue/test-utils"
|
|
|
6
6
|
import ObjectSelector from "@ogw_front/components/ObjectSelector"
|
|
7
7
|
import Step from "@ogw_front/components/Step"
|
|
8
8
|
|
|
9
|
-
import { vuetify } from "
|
|
9
|
+
import { vuetify } from "@ogw_tests/utils"
|
|
10
10
|
|
|
11
11
|
globalThis.ResizeObserver = ResizeObserver
|
|
12
12
|
|
|
@@ -7,7 +7,7 @@ import { mountSuspended } from "@nuxt/test-utils/runtime"
|
|
|
7
7
|
// Local imports
|
|
8
8
|
import ObjectSelector from "@ogw_front/components/ObjectSelector"
|
|
9
9
|
import Stepper from "@ogw_front/components/Stepper"
|
|
10
|
-
import { vuetify } from "
|
|
10
|
+
import { vuetify } from "@ogw_tests/utils"
|
|
11
11
|
|
|
12
12
|
const FIRST_INDEX = 0
|
|
13
13
|
|
|
@@ -3,7 +3,7 @@ import { beforeEach, describe, expect, test } from "vitest"
|
|
|
3
3
|
import { registerEndpoint } from "@nuxt/test-utils/runtime"
|
|
4
4
|
|
|
5
5
|
// Local imports
|
|
6
|
-
import { setupActivePinia } from "
|
|
6
|
+
import { setupActivePinia } from "@ogw_tests/utils"
|
|
7
7
|
import { useFeedbackStore } from "@ogw_front/stores/feedback"
|
|
8
8
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
9
9
|
|
|
@@ -35,7 +35,7 @@ describe("geodeStore.request()", () => {
|
|
|
35
35
|
})
|
|
36
36
|
|
|
37
37
|
test("invalid schema", async () => {
|
|
38
|
-
const
|
|
38
|
+
const invalid_schema = {
|
|
39
39
|
$id: "/test",
|
|
40
40
|
type: "object",
|
|
41
41
|
methods: ["POST"],
|
|
@@ -48,7 +48,7 @@ describe("geodeStore.request()", () => {
|
|
|
48
48
|
additionalProperties: false,
|
|
49
49
|
}
|
|
50
50
|
const params = { test: "hello" }
|
|
51
|
-
expect(() => geodeStore.request(
|
|
51
|
+
expect(() => geodeStore.request(invalid_schema, params)).toThrow(
|
|
52
52
|
"data/test must be number",
|
|
53
53
|
)
|
|
54
54
|
})
|
|
@@ -3,7 +3,7 @@ import { beforeEach, describe, expect, test, vi } from "vitest"
|
|
|
3
3
|
|
|
4
4
|
// Local imports
|
|
5
5
|
import { appMode } from "@ogw_front/utils/app_mode"
|
|
6
|
-
import { setupActivePinia } from "
|
|
6
|
+
import { setupActivePinia } from "@ogw_tests/utils"
|
|
7
7
|
import { useProjectManager } from "@ogw_front/composables/project_manager"
|
|
8
8
|
|
|
9
9
|
// Constants
|
|
@@ -135,11 +135,11 @@ const hybridViewerStoreMock = {
|
|
|
135
135
|
|
|
136
136
|
// MOCKS
|
|
137
137
|
vi.stubGlobal("$fetch", vi.fn().mockResolvedValue({ snapshot: snapshotMock }))
|
|
138
|
-
vi.mock("
|
|
138
|
+
vi.mock(import("@ogw_internal/utils/viewer_call"), () => ({
|
|
139
139
|
viewer_call: viewer_call_mock_fn,
|
|
140
140
|
}))
|
|
141
141
|
|
|
142
|
-
vi.mock("@ogw_front/composables/api_fetch", () => ({
|
|
142
|
+
vi.mock(import("@ogw_front/composables/api_fetch"), () => ({
|
|
143
143
|
api_fetch: vi.fn(async (_req, options = {}) => {
|
|
144
144
|
const response = {
|
|
145
145
|
_data: new Blob(["zipcontent"], { type: "application/zip" }),
|
|
@@ -153,29 +153,29 @@ vi.mock("@ogw_front/composables/api_fetch", () => ({
|
|
|
153
153
|
return response
|
|
154
154
|
}),
|
|
155
155
|
}))
|
|
156
|
-
vi.mock("js-file-download", () => ({ default: vi.fn() }))
|
|
157
|
-
vi.mock("@ogw_front/stores/infra", () => ({
|
|
156
|
+
vi.mock(import("js-file-download"), () => ({ default: vi.fn() }))
|
|
157
|
+
vi.mock(import("@ogw_front/stores/infra"), () => ({
|
|
158
158
|
useInfraStore: () => infraStoreMock,
|
|
159
159
|
}))
|
|
160
|
-
vi.mock("@ogw_front/stores/viewer", () => ({
|
|
160
|
+
vi.mock(import("@ogw_front/stores/viewer"), () => ({
|
|
161
161
|
useViewerStore: () => viewerStoreMock,
|
|
162
162
|
}))
|
|
163
|
-
vi.mock("@ogw_front/stores/treeview", () => ({
|
|
163
|
+
vi.mock(import("@ogw_front/stores/treeview"), () => ({
|
|
164
164
|
useTreeviewStore: () => treeviewStoreMock,
|
|
165
165
|
}))
|
|
166
|
-
vi.mock("@ogw_front/stores/data", () => ({
|
|
166
|
+
vi.mock(import("@ogw_front/stores/data"), () => ({
|
|
167
167
|
useDataStore: () => dataStoreMock,
|
|
168
168
|
}))
|
|
169
|
-
vi.mock("@ogw_front/stores/data_style", () => ({
|
|
169
|
+
vi.mock(import("@ogw_front/stores/data_style"), () => ({
|
|
170
170
|
useDataStyleStore: () => dataStyleStoreMock,
|
|
171
171
|
}))
|
|
172
|
-
vi.mock("@ogw_front/stores/hybrid_viewer", () => ({
|
|
172
|
+
vi.mock(import("@ogw_front/stores/hybrid_viewer"), () => ({
|
|
173
173
|
useHybridViewerStore: () => hybridViewerStoreMock,
|
|
174
174
|
}))
|
|
175
|
-
vi.mock("@ogw_front/stores/geode", () => ({
|
|
175
|
+
vi.mock(import("@ogw_front/stores/geode"), () => ({
|
|
176
176
|
useGeodeStore: () => geodeStoreMock,
|
|
177
177
|
}))
|
|
178
|
-
vi.mock("@ogw_front/stores/app", () => ({
|
|
178
|
+
vi.mock(import("@ogw_front/stores/app"), () => ({
|
|
179
179
|
useAppStore: () => ({
|
|
180
180
|
exportStores: vi.fn(() => ({ projectName: "mockedProject" })),
|
|
181
181
|
}),
|
|
@@ -242,7 +242,6 @@ function verifyRemaining() {
|
|
|
242
242
|
|
|
243
243
|
beforeEach(() => {
|
|
244
244
|
setupActivePinia()
|
|
245
|
-
// reset spies
|
|
246
245
|
const storesList = [
|
|
247
246
|
viewerStoreMock,
|
|
248
247
|
treeviewStoreMock,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
// Third party imports
|
|
2
|
-
import { flushPromises } from "@vue/test-utils"
|
|
3
2
|
import { beforeEach, describe, expect, test, vi } from "vitest"
|
|
3
|
+
import { flushPromises } from "@vue/test-utils"
|
|
4
4
|
|
|
5
5
|
// Local imports
|
|
6
|
+
import { Status } from "@ogw_front/utils/status"
|
|
6
7
|
import { run_function_when_microservices_connected } from "@ogw_front/composables/run_function_when_microservices_connected"
|
|
7
|
-
import { setupActivePinia } from "
|
|
8
|
-
import Status from "@ogw_front/utils/status"
|
|
8
|
+
import { setupActivePinia } from "@ogw_tests/utils"
|
|
9
9
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
10
10
|
import { useInfraStore } from "@ogw_front/stores/infra"
|
|
11
11
|
import { useViewerStore } from "@ogw_front/stores/viewer"
|
|
12
12
|
|
|
13
13
|
const dumb_obj = { dumb_method: () => true }
|
|
14
|
-
let infraStore
|
|
15
|
-
let geodeStore
|
|
16
|
-
let viewerStore
|
|
14
|
+
let infraStore = undefined
|
|
15
|
+
let geodeStore = undefined
|
|
16
|
+
let viewerStore = undefined
|
|
17
17
|
|
|
18
18
|
beforeEach(() => {
|
|
19
19
|
setupActivePinia()
|
|
@@ -4,8 +4,8 @@ import { registerEndpoint } from "@nuxt/test-utils/runtime"
|
|
|
4
4
|
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
5
5
|
|
|
6
6
|
// Local imports
|
|
7
|
-
import { setupActivePinia } from "
|
|
8
|
-
import upload_file from "@ogw_front/utils/upload_file"
|
|
7
|
+
import { setupActivePinia } from "@ogw_tests/utils"
|
|
8
|
+
import { upload_file } from "@ogw_front/utils/upload_file"
|
|
9
9
|
import { useFeedbackStore } from "@ogw_front/stores/feedback"
|
|
10
10
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
11
11
|
|
|
@@ -6,19 +6,19 @@ import { useDataStyleStore } from "@ogw_front/stores/data_style"
|
|
|
6
6
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"
|
|
7
7
|
import { useTreeviewStore } from "@ogw_front/stores/treeview"
|
|
8
8
|
|
|
9
|
-
import { database } from "
|
|
10
|
-
import { setupActivePinia } from "
|
|
9
|
+
import { database } from "@ogw_internal/database/database.js"
|
|
10
|
+
import { setupActivePinia } from "@ogw_tests/utils"
|
|
11
11
|
|
|
12
12
|
const PANEL_WIDTH = 320
|
|
13
13
|
const Z_SCALE = 1.5
|
|
14
14
|
const STORES_SLICE_START = 1
|
|
15
15
|
|
|
16
|
-
vi.mock("
|
|
16
|
+
vi.mock(import("@ogw_internal/utils/viewer_call"), () => ({
|
|
17
17
|
viewer_call: vi.fn(async () => {
|
|
18
18
|
await Promise.resolve()
|
|
19
19
|
}),
|
|
20
20
|
}))
|
|
21
|
-
vi.mock("
|
|
21
|
+
vi.mock(import("@ogw_front/stores/hybrid_viewer"), () => ({
|
|
22
22
|
useHybridViewerStore: () => ({
|
|
23
23
|
$id: "hybridViewer",
|
|
24
24
|
initHybridViewer: vi.fn(),
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { beforeEach, describe, expect, expectTypeOf, test, vi } from "vitest"
|
|
2
|
-
import { createTestingPinia } from "@pinia/testing"
|
|
3
|
-
import { setActivePinia } from "pinia"
|
|
4
2
|
|
|
5
3
|
import { useAppStore } from "@ogw_front/stores/app"
|
|
6
4
|
|
|
7
|
-
import { setupActivePinia } from "
|
|
5
|
+
import { setupActivePinia } from "@ogw_tests/utils"
|
|
8
6
|
|
|
9
7
|
// Constants
|
|
10
8
|
const SINGLE_STORE_LENGTH = 1
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
import { beforeEach, describe, expect, expectTypeOf, test } from "vitest"
|
|
3
3
|
|
|
4
4
|
// Local imports
|
|
5
|
-
import { setupActivePinia } from "
|
|
5
|
+
import { setupActivePinia } from "@ogw_tests/utils"
|
|
6
6
|
import { useFeedbackStore } from "@ogw_front/stores/feedback"
|
|
7
7
|
|
|
8
|
+
const ERROR_500 = 500
|
|
9
|
+
const MILISECONDS_TIMEOUT = 1000
|
|
10
|
+
|
|
8
11
|
beforeEach(() => {
|
|
9
12
|
setupActivePinia()
|
|
10
13
|
})
|
|
@@ -23,7 +26,7 @@ describe("Feedback Store", () => {
|
|
|
23
26
|
test("test add_error", () => {
|
|
24
27
|
const feedbackStore = useFeedbackStore()
|
|
25
28
|
feedbackStore.add_error(
|
|
26
|
-
|
|
29
|
+
ERROR_500,
|
|
27
30
|
"/test",
|
|
28
31
|
"test message",
|
|
29
32
|
"test description",
|
|
@@ -36,7 +39,7 @@ describe("Feedback Store", () => {
|
|
|
36
39
|
const feedbackStore = useFeedbackStore()
|
|
37
40
|
feedbackStore.feedbacks_timeout_miliseconds = 500
|
|
38
41
|
feedbackStore.add_error(
|
|
39
|
-
|
|
42
|
+
ERROR_500,
|
|
40
43
|
"/test",
|
|
41
44
|
"test message",
|
|
42
45
|
"test description",
|
|
@@ -44,7 +47,7 @@ describe("Feedback Store", () => {
|
|
|
44
47
|
expect(feedbackStore.feedbacks).toHaveLength(1)
|
|
45
48
|
setTimeout(() => {
|
|
46
49
|
expect(feedbackStore.feedbacks).toHaveLength(0)
|
|
47
|
-
},
|
|
50
|
+
}, MILISECONDS_TIMEOUT)
|
|
48
51
|
})
|
|
49
52
|
})
|
|
50
53
|
|
|
@@ -58,7 +61,7 @@ describe("Feedback Store", () => {
|
|
|
58
61
|
|
|
59
62
|
setTimeout(() => {
|
|
60
63
|
expect(feedbackStore.feedbacks).toHaveLength(0)
|
|
61
|
-
},
|
|
64
|
+
}, MILISECONDS_TIMEOUT)
|
|
62
65
|
})
|
|
63
66
|
})
|
|
64
67
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Third party imports
|
|
2
|
+
import { beforeEach, describe, expect, expectTypeOf, test, vi } from "vitest"
|
|
2
3
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
|
|
3
4
|
import { registerEndpoint } from "@nuxt/test-utils/runtime"
|
|
4
|
-
import { describe, expect, expectTypeOf, test, vi } from "vitest"
|
|
5
5
|
|
|
6
6
|
// Local imports
|
|
7
|
+
import { Status } from "@ogw_front/utils/status"
|
|
7
8
|
import { appMode } from "@ogw_front/utils/app_mode"
|
|
8
|
-
import { setupActivePinia } from "
|
|
9
|
-
import Status from "@ogw_front/utils/status"
|
|
9
|
+
import { setupActivePinia } from "@ogw_tests/utils"
|
|
10
10
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
11
11
|
import { useInfraStore } from "@ogw_front/stores/infra"
|
|
12
12
|
|
|
@@ -3,9 +3,9 @@ import { beforeEach, describe, expect, expectTypeOf, test, vi } from "vitest"
|
|
|
3
3
|
import { registerEndpoint } from "@nuxt/test-utils/runtime"
|
|
4
4
|
|
|
5
5
|
// Local imports
|
|
6
|
-
import Status from "@ogw_front/utils/status"
|
|
6
|
+
import { Status } from "@ogw_front/utils/status"
|
|
7
7
|
import { appMode } from "@ogw_front/utils/app_mode"
|
|
8
|
-
import { setupActivePinia } from "
|
|
8
|
+
import { setupActivePinia } from "@ogw_tests/utils"
|
|
9
9
|
import { useGeodeStore } from "@ogw_front/stores/geode"
|
|
10
10
|
import { useInfraStore } from "@ogw_front/stores/infra"
|
|
11
11
|
import { useLambdaStore } from "@ogw_front/stores/lambda"
|
|
@@ -3,8 +3,8 @@ import { beforeEach, describe, expect, expectTypeOf, test, vi } from "vitest"
|
|
|
3
3
|
import { registerEndpoint } from "@nuxt/test-utils/runtime"
|
|
4
4
|
|
|
5
5
|
// Local imports
|
|
6
|
-
import Status from "@ogw_front/utils/status"
|
|
7
|
-
import { setupActivePinia } from "
|
|
6
|
+
import { Status } from "@ogw_front/utils/status"
|
|
7
|
+
import { setupActivePinia } from "@ogw_tests/utils"
|
|
8
8
|
import { useFeedbackStore } from "@ogw_front/stores/feedback"
|
|
9
9
|
import { useLambdaStore } from "@ogw_front/stores/lambda"
|
|
10
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Third party imports
|
|
2
|
-
import { describe, expect, expectTypeOf, test } from "vitest"
|
|
2
|
+
import { beforeEach, describe, expect, expectTypeOf, test } from "vitest"
|
|
3
3
|
|
|
4
4
|
// Local imports
|
|
5
|
-
import { setupActivePinia } from "
|
|
5
|
+
import { setupActivePinia } from "@ogw_tests/utils"
|
|
6
6
|
import { useTreeviewStore } from "@ogw_front/stores/treeview"
|
|
7
7
|
|
|
8
8
|
// CONSTANTS
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import { WebSocket } from "ws"
|
|
14
14
|
// Local imports
|
|
15
15
|
import { appMode } from "@ogw_front/utils/app_mode"
|
|
16
|
-
import { setupActivePinia } from "
|
|
16
|
+
import { setupActivePinia } from "@ogw_tests/utils"
|
|
17
17
|
import { useInfraStore } from "@ogw_front/stores/infra"
|
|
18
18
|
import { useViewerStore } from "@ogw_front/stores/viewer"
|
|
19
19
|
|
|
@@ -5,35 +5,39 @@ import { describe, expect, test } from "vitest"
|
|
|
5
5
|
import { check_recaptcha_params } from "@ogw_front/utils/recaptcha"
|
|
6
6
|
|
|
7
7
|
describe("recaptcha", () => {
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
8
|
+
const default_name = ""
|
|
9
|
+
const default_email = ""
|
|
10
|
+
const default_launch = false
|
|
11
11
|
const internal_error = 500
|
|
12
12
|
const success = 200
|
|
13
13
|
|
|
14
14
|
describe("wrong params", () => {
|
|
15
15
|
test("name", () => {
|
|
16
16
|
const name = "test"
|
|
17
|
-
const result = check_recaptcha_params(name,
|
|
17
|
+
const result = check_recaptcha_params(name, default_email, default_launch)
|
|
18
18
|
expect(result.statusCode).toBe(internal_error)
|
|
19
19
|
})
|
|
20
20
|
|
|
21
21
|
test("email", () => {
|
|
22
22
|
const email = "test"
|
|
23
|
-
const result = check_recaptcha_params(
|
|
23
|
+
const result = check_recaptcha_params(default_name, email, default_launch)
|
|
24
24
|
expect(result.statusCode).toBe(internal_error)
|
|
25
25
|
})
|
|
26
26
|
|
|
27
27
|
test("launch", () => {
|
|
28
28
|
const launch = true
|
|
29
|
-
const result = check_recaptcha_params(
|
|
29
|
+
const result = check_recaptcha_params(default_name, default_email, launch)
|
|
30
30
|
expect(result.statusCode).toBe(internal_error)
|
|
31
31
|
})
|
|
32
32
|
})
|
|
33
33
|
|
|
34
34
|
describe("right params", () => {
|
|
35
35
|
test("name", () => {
|
|
36
|
-
const result = check_recaptcha_params(
|
|
36
|
+
const result = check_recaptcha_params(
|
|
37
|
+
default_name,
|
|
38
|
+
default_email,
|
|
39
|
+
default_launch,
|
|
40
|
+
)
|
|
37
41
|
expect(result.statusCode).toBe(success)
|
|
38
42
|
})
|
|
39
43
|
})
|
package/tests/utils.js
CHANGED
|
@@ -4,6 +4,7 @@ import * as directives from "vuetify/directives"
|
|
|
4
4
|
import { createTestingPinia } from "@pinia/testing"
|
|
5
5
|
import { createVuetify } from "vuetify"
|
|
6
6
|
import { setActivePinia } from "pinia"
|
|
7
|
+
import { vi } from "vitest"
|
|
7
8
|
|
|
8
9
|
const vuetify = createVuetify({ components, directives })
|
|
9
10
|
|