@geode/opengeodeweb-front 10.3.0 → 10.3.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 -0
- package/app/assets/geode_objects.js +1 -3
- package/app/components/Carousel.vue +7 -4
- package/app/components/CrsSelector.vue +5 -6
- package/app/components/DragAndDrop.vue +18 -8
- package/app/components/ExtensionSelector.vue +9 -17
- package/app/components/FeedBack/ErrorBanner.vue +1 -1
- package/app/components/FeedBack/Snackers.vue +4 -1
- package/app/components/FileSelector.vue +21 -10
- package/app/components/FileUploader.vue +15 -32
- package/app/components/HybridRenderingView.vue +5 -3
- package/app/components/Inspector/InspectionButton.vue +2 -2
- package/app/components/Inspector/ResultPanel.vue +4 -4
- package/app/components/Launcher.vue +1 -1
- package/app/components/Loading.vue +6 -6
- package/app/components/MissingFilesSelector.vue +23 -29
- package/app/components/ObjectSelector.vue +11 -10
- package/app/components/OptionCard.vue +1 -1
- package/app/components/PackagesVersions.vue +5 -3
- package/app/components/Recaptcha.vue +6 -4
- package/app/components/RemoteRenderingView.vue +4 -3
- package/app/components/Screenshot.vue +4 -4
- package/app/components/Step.vue +7 -7
- package/app/components/VeaseViewToolbar.vue +3 -3
- package/app/components/Viewer/BreadCrumb.vue +2 -4
- package/app/components/Viewer/ContextMenu.vue +77 -45
- package/app/components/Viewer/ContextMenuItem.vue +42 -33
- package/app/components/Viewer/EdgedCurve/PointsOptions.vue +3 -3
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +5 -5
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +6 -6
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +5 -5
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +5 -5
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +6 -7
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +6 -6
- package/app/components/Viewer/Generic/Model/EdgesOptions.vue +3 -3
- package/app/components/Viewer/Generic/Model/PointsOptions.vue +4 -4
- package/app/components/Viewer/Grid/2D/CellsOptions.vue +3 -3
- package/app/components/Viewer/Grid/2D/EdgesOptions.vue +3 -3
- package/app/components/Viewer/Grid/2D/PointsOptions.vue +3 -3
- package/app/components/Viewer/Grid/3D/CellsOptions.vue +3 -3
- package/app/components/Viewer/Grid/3D/EdgesOptions.vue +3 -3
- package/app/components/Viewer/Grid/3D/FacetsOptions.vue +3 -3
- package/app/components/Viewer/Grid/3D/PointsOptions.vue +3 -3
- package/app/components/Viewer/HybridSolid/EdgesOptions.vue +3 -3
- package/app/components/Viewer/HybridSolid/PointsOptions.vue +3 -3
- package/app/components/Viewer/HybridSolid/PolygonsOptions.vue +3 -3
- package/app/components/Viewer/HybridSolid/PolyhedraOptions.vue +3 -3
- package/app/components/Viewer/Options/CellAttributeSelector.vue +23 -20
- package/app/components/Viewer/Options/ColorMapList.vue +75 -50
- package/app/components/Viewer/Options/ColorMapPicker.vue +38 -32
- package/app/components/Viewer/Options/ColorPicker.vue +3 -3
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +29 -21
- package/app/components/Viewer/Options/EdgeAttributeSelector.vue +7 -7
- package/app/components/Viewer/Options/PolygonAttributeSelector.vue +7 -7
- package/app/components/Viewer/Options/PolyhedronAttributeSelector.vue +7 -7
- package/app/components/Viewer/Options/TextureItem.vue +5 -5
- package/app/components/Viewer/Options/TexturesSelector.vue +5 -5
- package/app/components/Viewer/Options/VertexAttributeSelector.vue +7 -7
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +5 -5
- package/app/components/Viewer/PolygonalSurface/EdgesOptions.vue +3 -3
- package/app/components/Viewer/PolygonalSurface/PointsOptions.vue +3 -3
- package/app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue +6 -6
- package/app/components/Viewer/Solid/EdgesOptions.vue +3 -3
- package/app/components/Viewer/Solid/PointsOptions.vue +3 -3
- package/app/components/Viewer/Solid/PolygonsOptions.vue +3 -3
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +6 -6
- package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +3 -3
- package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +3 -3
- package/app/components/Viewer/Tree/ObjectTree.vue +7 -9
- package/app/components/Viewer/TreeComponent.vue +9 -13
- package/app/components/Viewer/TreeObject.vue +8 -9
- package/app/components/Viewer/TriangulatedSurface/EdgesOptions.vue +3 -3
- package/app/components/Viewer/TriangulatedSurface/PointsOptions.vue +3 -3
- package/app/components/Viewer/TriangulatedSurface/TrianglesOptions.vue +3 -3
- package/app/components/Wrapper.vue +1 -2
- package/app/components/ZScaling.vue +1 -1
- package/app/composables/project_manager.js +6 -6
- package/app/plugins/auto_store_register.js +1 -1
- package/app/stores/app.js +45 -41
- package/app/stores/data.js +52 -51
- package/app/stores/data_style.js +12 -11
- package/app/stores/feedback.js +5 -1
- package/app/stores/geode.js +16 -13
- package/app/stores/hybrid_viewer.js +72 -44
- package/app/stores/infra.js +18 -16
- package/app/stores/lambda.js +1 -9
- package/app/stores/menu.js +13 -13
- package/app/stores/treeview.js +15 -13
- package/app/stores/viewer.js +39 -33
- package/app/utils/app_mode.js +4 -3
- package/app/utils/default_styles.js +55 -47
- package/app/utils/file_import_workflow.js +4 -17
- package/app/utils/local.js +195 -184
- package/app/utils/upload_file.js +1 -2
- package/eslint.config.js +2 -2
- package/internal/database/database.js +17 -32
- package/internal/database/extended_database.js +25 -0
- package/internal/stores/data_style/mesh/cells/cell.js +3 -3
- package/internal/stores/data_style/mesh/cells/color.js +1 -1
- package/internal/stores/data_style/mesh/cells/index.js +7 -7
- package/internal/stores/data_style/mesh/cells/textures.js +1 -1
- package/internal/stores/data_style/mesh/cells/vertex.js +3 -3
- package/internal/stores/data_style/mesh/cells/visibility.js +1 -1
- package/internal/stores/data_style/mesh/edges/color.js +1 -1
- package/internal/stores/data_style/mesh/edges/edge.js +22 -22
- package/internal/stores/data_style/mesh/edges/index.js +7 -7
- package/internal/stores/data_style/mesh/edges/vertex.js +3 -3
- package/internal/stores/data_style/mesh/edges/visibility.js +1 -1
- package/internal/stores/data_style/mesh/edges/width.js +1 -1
- package/internal/stores/data_style/mesh/index.js +4 -5
- package/internal/stores/data_style/mesh/points/color.js +1 -1
- package/internal/stores/data_style/mesh/points/index.js +6 -6
- package/internal/stores/data_style/mesh/points/size.js +1 -1
- package/internal/stores/data_style/mesh/points/vertex.js +3 -3
- package/internal/stores/data_style/mesh/points/visibility.js +1 -1
- package/internal/stores/data_style/mesh/polygons/color.js +1 -1
- package/internal/stores/data_style/mesh/polygons/index.js +7 -7
- package/internal/stores/data_style/mesh/polygons/polygon.js +3 -3
- package/internal/stores/data_style/mesh/polygons/textures.js +1 -1
- package/internal/stores/data_style/mesh/polygons/vertex.js +3 -3
- package/internal/stores/data_style/mesh/polygons/visibility.js +1 -1
- package/internal/stores/data_style/mesh/polyhedra/color.js +1 -1
- package/internal/stores/data_style/mesh/polyhedra/index.js +6 -6
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +3 -3
- package/internal/stores/data_style/mesh/polyhedra/vertex.js +3 -3
- package/internal/stores/data_style/mesh/polyhedra/visibility.js +1 -1
- package/internal/stores/data_style/model/edges.js +1 -1
- package/internal/stores/data_style/model/index.js +32 -22
- package/internal/utils/api_fetch.js +8 -5
- package/internal/utils/viewer_call.js +42 -46
- package/nuxt.config.js +3 -3
- package/package.json +1 -1
- package/scripts/generate_geode_objects.js +8 -7
- package/tests/integration/setup.js +28 -21
- package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +18 -10
- package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +18 -10
- package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +9 -5
- package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +17 -10
- package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +18 -10
- package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +18 -10
- package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +10 -6
- package/tests/integration/stores/data_style/model/corners.nuxt.test.js +10 -6
- package/tests/integration/stores/data_style/model/edges.nuxt.test.js +9 -5
- package/tests/integration/stores/data_style/model/index.nuxt.test.js +9 -5
- package/tests/integration/stores/data_style/model/lines.nuxt.test.js +10 -6
- package/tests/integration/stores/data_style/model/points.nuxt.test.js +9 -5
- package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +10 -6
- package/tests/integration/stores/viewer.nuxt.test.js +55 -39
- package/tests/setup_indexeddb.js +1 -0
- package/tests/unit/components/CrsSelector.nuxt.test.js +18 -19
- package/tests/unit/components/ExtensionSelector.nuxt.test.js +24 -19
- package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +23 -36
- package/tests/unit/components/FeedBack/Snackers.nuxt.test.js +20 -25
- package/tests/unit/components/FileSelector.nuxt.test.js +27 -27
- package/tests/unit/components/FileUploader.nuxt.test.js +18 -17
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +9 -16
- package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +8 -6
- package/tests/unit/components/Launcher.nuxt.test.js +12 -17
- package/tests/unit/components/MissingFilesSelector.nuxt.test.js +16 -19
- package/tests/unit/components/ObjectSelector.nuxt.test.js +30 -34
- package/tests/unit/components/PackagesVersions.nuxt.test.js +8 -11
- package/tests/unit/components/Step.nuxt.test.js +8 -7
- package/tests/unit/components/Stepper.nuxt.test.js +14 -12
- package/tests/unit/composables/ProjectManager.nuxt.test.js +142 -100
- package/tests/unit/composables/api_fetch.nuxt.test.js +12 -39
- package/tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js +36 -61
- package/tests/unit/composables/upload_file.nuxt.test.js +21 -25
- package/tests/unit/plugins/project_load.nuxt.test.js +22 -21
- package/tests/unit/stores/App.nuxt.test.js +45 -43
- package/tests/unit/stores/Feedback.nuxt.test.js +16 -18
- package/tests/unit/stores/Geode.nuxt.test.js +135 -137
- package/tests/unit/stores/Infra.nuxt.test.js +20 -26
- package/tests/unit/stores/Lambda.nuxt.test.js +30 -31
- package/tests/unit/stores/Treeview.nuxt.test.js +53 -55
- package/tests/unit/stores/Viewer.nuxt.test.js +16 -23
- package/tests/unit/utils/validate_schema.nuxt.test.js +18 -18
- package/tests/utils.js +15 -2
- package/tests/vitest.config.js +6 -2
|
@@ -1,66 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { setActivePinia } from "pinia"
|
|
1
|
+
// Third party imports
|
|
2
|
+
import { describe, expect, expectTypeOf, test } from "vitest"
|
|
4
3
|
|
|
4
|
+
// Local imports
|
|
5
|
+
import { setupActivePinia } from "../../utils"
|
|
5
6
|
import { useTreeviewStore } from "@ogw_front/stores/treeview"
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
setActivePinia(pinia)
|
|
8
|
+
// CONSTANTS
|
|
9
|
+
const STEP_1 = 1
|
|
10
|
+
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
setupActivePinia()
|
|
13
13
|
})
|
|
14
14
|
|
|
15
|
-
describe("
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
expectTypeOf(treeviewStore.items).toBeArray()
|
|
20
|
-
})
|
|
15
|
+
describe("treeview store state", () => {
|
|
16
|
+
test("initial state", () => {
|
|
17
|
+
const treeviewStore = useTreeviewStore()
|
|
18
|
+
expectTypeOf(treeviewStore.items).toBeArray()
|
|
21
19
|
})
|
|
20
|
+
})
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
describe("treeview store actions", () => {
|
|
23
|
+
test("addItem sorted check", () => {
|
|
24
|
+
const treeviewStore = useTreeviewStore()
|
|
25
|
+
const testItems = [
|
|
26
|
+
{
|
|
27
|
+
geode_object_type: "BRep",
|
|
28
|
+
name: "test_brep.og_brep",
|
|
29
|
+
id: "1",
|
|
30
|
+
viewer_type: "model",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
geode_object_type: "BRep",
|
|
34
|
+
name: "test_brep_2.og_brep",
|
|
35
|
+
id: "2",
|
|
36
|
+
viewer_type: "model",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
geode_object_type: "EdgedCurve2D",
|
|
40
|
+
name: "test_edgedcurve.og_edc2d",
|
|
41
|
+
id: "2",
|
|
42
|
+
viewer_type: "mesh",
|
|
43
|
+
},
|
|
44
|
+
]
|
|
27
45
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
name: "test_brep_2.og_brep",
|
|
38
|
-
id: "2",
|
|
39
|
-
viewer_type: "model",
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
geode_object_type: "EdgedCurve2D",
|
|
43
|
-
name: "test_edgedcurve.og_edc2d",
|
|
44
|
-
id: "2",
|
|
45
|
-
viewer_type: "mesh",
|
|
46
|
-
},
|
|
47
|
-
]
|
|
46
|
+
for (let i = 0; i < testItems.length; i += STEP_1) {
|
|
47
|
+
treeviewStore.addItem(
|
|
48
|
+
testItems[i].geode_object_type,
|
|
49
|
+
testItems[i].name,
|
|
50
|
+
testItems[i].id,
|
|
51
|
+
testItems[i].viewer_type,
|
|
52
|
+
)
|
|
53
|
+
const itemsCopy = [...treeviewStore.items]
|
|
54
|
+
expect(treeviewStore.items).toStrictEqual(itemsCopy.toSorted())
|
|
48
55
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
expect(treeviewStore.items.sort()).toBe(treeviewStore.items)
|
|
57
|
-
for (let i = 0; i < treeviewStore.items.length; i++) {
|
|
58
|
-
expect(treeviewStore.items[i].children.sort()).toBe(
|
|
59
|
-
treeviewStore.items[i].children,
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
})
|
|
64
|
-
})
|
|
56
|
+
for (let j = 0; j < treeviewStore.items.length; j += STEP_1) {
|
|
57
|
+
const childrenCopy = [...treeviewStore.items[j].children]
|
|
58
|
+
expect(treeviewStore.items[j].children).toStrictEqual(
|
|
59
|
+
childrenCopy.toSorted(),
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
65
63
|
})
|
|
66
64
|
})
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
// Global imports
|
|
2
|
-
|
|
3
1
|
// Third party imports
|
|
4
|
-
import { setActivePinia } from "pinia"
|
|
5
|
-
import { createTestingPinia } from "@pinia/testing"
|
|
6
2
|
import {
|
|
7
3
|
afterAll,
|
|
8
4
|
beforeAll,
|
|
5
|
+
beforeEach,
|
|
9
6
|
describe,
|
|
10
|
-
test,
|
|
11
7
|
expect,
|
|
12
8
|
expectTypeOf,
|
|
13
|
-
|
|
9
|
+
test,
|
|
14
10
|
vi,
|
|
15
11
|
} from "vitest"
|
|
16
12
|
|
|
17
13
|
import { WebSocket } from "ws"
|
|
18
14
|
// Local imports
|
|
19
|
-
import { useViewerStore } from "@ogw_front/stores/viewer"
|
|
20
|
-
import { useInfraStore } from "@ogw_front/stores/infra"
|
|
21
15
|
import { appMode } from "@ogw_front/utils/app_mode"
|
|
16
|
+
import { setupActivePinia } from "../../utils"
|
|
17
|
+
import { useInfraStore } from "@ogw_front/stores/infra"
|
|
18
|
+
import { useViewerStore } from "@ogw_front/stores/viewer"
|
|
22
19
|
|
|
23
20
|
// Mock navigator.locks API
|
|
24
|
-
const mockLockRequest = vi
|
|
25
|
-
|
|
26
|
-
})
|
|
21
|
+
const mockLockRequest = vi
|
|
22
|
+
.fn()
|
|
23
|
+
.mockImplementation(async (name, handler) => await handler({ name }))
|
|
27
24
|
|
|
28
25
|
vi.stubGlobal("navigator", {
|
|
29
26
|
...navigator,
|
|
@@ -33,19 +30,15 @@ vi.stubGlobal("navigator", {
|
|
|
33
30
|
})
|
|
34
31
|
|
|
35
32
|
beforeAll(() => {
|
|
36
|
-
|
|
33
|
+
globalThis.WebSocket = WebSocket
|
|
37
34
|
})
|
|
38
35
|
|
|
39
36
|
afterAll(() => {
|
|
40
|
-
delete
|
|
37
|
+
delete globalThis.WebSocket
|
|
41
38
|
})
|
|
42
39
|
|
|
43
40
|
beforeEach(() => {
|
|
44
|
-
|
|
45
|
-
stubActions: false,
|
|
46
|
-
createSpy: vi.fn,
|
|
47
|
-
})
|
|
48
|
-
setActivePinia(pinia)
|
|
41
|
+
setupActivePinia()
|
|
49
42
|
})
|
|
50
43
|
|
|
51
44
|
describe("Viewer Store", () => {
|
|
@@ -56,8 +49,8 @@ describe("Viewer Store", () => {
|
|
|
56
49
|
expectTypeOf(viewerStore.client).toEqualTypeOf({})
|
|
57
50
|
expectTypeOf(viewerStore.picking_mode).toBeBoolean()
|
|
58
51
|
expectTypeOf(viewerStore.picked_point).toEqualTypeOf({
|
|
59
|
-
x:
|
|
60
|
-
y:
|
|
52
|
+
x: undefined,
|
|
53
|
+
y: undefined,
|
|
61
54
|
})
|
|
62
55
|
expectTypeOf(viewerStore.picked_point).toBeNumber()
|
|
63
56
|
expectTypeOf(viewerStore.status).toBeString()
|
|
@@ -149,12 +142,12 @@ describe("Viewer Store", () => {
|
|
|
149
142
|
test("test is_busy", () => {
|
|
150
143
|
const viewerStore = useViewerStore()
|
|
151
144
|
viewerStore.request_counter = 1
|
|
152
|
-
expect(viewerStore.is_busy).
|
|
145
|
+
expect(viewerStore.is_busy).toBeTruthy()
|
|
153
146
|
})
|
|
154
147
|
test("test not is_busy", () => {
|
|
155
148
|
const viewerStore = useViewerStore()
|
|
156
149
|
viewerStore.request_counter = 0
|
|
157
|
-
expect(viewerStore.is_busy).
|
|
150
|
+
expect(viewerStore.is_busy).toBeFalsy()
|
|
158
151
|
})
|
|
159
152
|
})
|
|
160
153
|
})
|
|
@@ -163,7 +156,7 @@ describe("Viewer Store", () => {
|
|
|
163
156
|
test("test true", async () => {
|
|
164
157
|
const viewerStore = useViewerStore()
|
|
165
158
|
await viewerStore.toggle_picking_mode(true)
|
|
166
|
-
expect(viewerStore.picking_mode).
|
|
159
|
+
expect(viewerStore.picking_mode).toBeTruthy()
|
|
167
160
|
})
|
|
168
161
|
})
|
|
169
162
|
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
+
// Third party imports
|
|
1
2
|
import { describe, expect, test } from "vitest"
|
|
2
3
|
|
|
4
|
+
// Local imports
|
|
3
5
|
import validate_schema from "@ogw_front/utils/validate_schema"
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
// CONSTANTS
|
|
8
|
+
const MIN_0 = 0
|
|
9
|
+
const MAX_10 = 10
|
|
10
|
+
const VAL_5 = 5
|
|
11
|
+
|
|
12
|
+
describe("validate schema", () => {
|
|
6
13
|
const schema = {
|
|
7
14
|
$id: "/test",
|
|
8
15
|
type: "object",
|
|
9
16
|
methods: ["POST"],
|
|
10
17
|
properties: {
|
|
11
|
-
var_1: {
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
var_2: {
|
|
15
|
-
type: "integer",
|
|
16
|
-
minimum: 0,
|
|
17
|
-
maximum: 10,
|
|
18
|
-
},
|
|
18
|
+
var_1: { type: "string" },
|
|
19
|
+
var_2: { type: "integer", minimum: MIN_0, maximum: MAX_10 },
|
|
19
20
|
},
|
|
20
21
|
required: ["var_1", "var_2"],
|
|
21
22
|
additionalProperties: false,
|
|
22
23
|
}
|
|
23
|
-
var params
|
|
24
24
|
|
|
25
|
-
test("
|
|
26
|
-
params = {}
|
|
27
|
-
|
|
28
|
-
expect(valid).
|
|
25
|
+
test("ajv wrong params", () => {
|
|
26
|
+
const params = {}
|
|
27
|
+
const { valid, error } = validate_schema(schema, params)
|
|
28
|
+
expect(valid).toBeFalsy()
|
|
29
29
|
expect(error).toBe("data must have required property 'var_1'")
|
|
30
30
|
})
|
|
31
31
|
|
|
32
|
-
test("
|
|
33
|
-
params = { var_1: "test", var_2:
|
|
34
|
-
|
|
35
|
-
expect(valid).
|
|
32
|
+
test("good params", () => {
|
|
33
|
+
const params = { var_1: "test", var_2: VAL_5 }
|
|
34
|
+
const { valid, error } = validate_schema(schema, params)
|
|
35
|
+
expect(valid).toBeTruthy()
|
|
36
36
|
expect(error).toBe("No errors")
|
|
37
37
|
})
|
|
38
38
|
})
|
package/tests/utils.js
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
// Third party imports
|
|
2
2
|
import * as components from "vuetify/components"
|
|
3
3
|
import * as directives from "vuetify/directives"
|
|
4
|
+
import { createTestingPinia } from "@pinia/testing"
|
|
5
|
+
import { createVuetify } from "vuetify"
|
|
6
|
+
import { setActivePinia } from "pinia"
|
|
7
|
+
|
|
4
8
|
const vuetify = createVuetify({ components, directives })
|
|
5
9
|
|
|
6
|
-
|
|
10
|
+
function setupActivePinia() {
|
|
11
|
+
const pinia = createTestingPinia({
|
|
12
|
+
stubActions: false,
|
|
13
|
+
createSpy: vi.fn,
|
|
14
|
+
})
|
|
15
|
+
setActivePinia(pinia)
|
|
16
|
+
return pinia
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { setupActivePinia, vuetify }
|
package/tests/vitest.config.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { defineConfig } from "vitest/config"
|
|
2
2
|
import { defineVitestProject } from "@nuxt/test-utils/config"
|
|
3
|
-
import path from "path"
|
|
3
|
+
import path from "node:path"
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const RETRIES = 3
|
|
6
|
+
const DEFAULT_RETRY = 0
|
|
6
7
|
|
|
8
|
+
const globalRetry = process.env.CI ? RETRIES : DEFAULT_RETRY
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line import/no-default-export
|
|
7
11
|
export default defineConfig({
|
|
8
12
|
test: {
|
|
9
13
|
globals: true,
|