Skip to content

Commit dd5ddc0

Browse files
save working tests edges
1 parent 7f9198c commit dd5ddc0

31 files changed

+2990
-468
lines changed

composables/api_fetch.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ export function api_fetch(
1212
const { valid, error } = validate_schema(schema, body)
1313

1414
if (!valid) {
15-
if (process.env.NODE_ENV === "development") {
15+
if (
16+
process.env.NODE_ENV === "development" ||
17+
process.env.NODE_ENV === "test"
18+
) {
1619
console.log("Bad request", error, schema, params)
17-
console.log("schema", schema)
18-
console.log("params", params)
1920
}
2021
feedback_store.add_error(400, schema.$id, "Bad request", error)
2122
throw new Error(schema.$id.concat(": ", error))

composables/viewer_call.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ export function viewer_call(
88
const { valid, error } = validate_schema(schema, params)
99

1010
if (!valid) {
11-
if (process.env.NODE_ENV === "development") {
11+
if (
12+
process.env.NODE_ENV === "development" ||
13+
process.env.NODE_ENV === "test"
14+
) {
1215
console.log("Bad request", error, schema, params)
13-
console.log("schema", schema)
14-
console.log("params", params)
1516
}
1617
feedback_store.add_error(400, schema.$id, "Bad request", error)
1718
throw new Error(schema.$id.concat(": "))

internal_stores/mesh/edges.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ export function useMeshEdgesStyle() {
2828
}
2929

3030
function meshEdgesActiveColoring(id) {
31-
return edgesStyle(id).coloring.active
31+
return meshEdgesStyle(id).coloring.active
3232
}
3333
function setMeshEdgesActiveColoring(id, type) {
34-
const coloring = edgesStyle(id).coloring
34+
const coloring = meshEdgesStyle(id).coloring
3535
coloring.active = type
3636
console.log(
3737
`${setMeshEdgesActiveColoring.name} ${id} ${meshEdgesActiveColoring(id)}`,

log

Lines changed: 2385 additions & 0 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"test": "npm run test:unit",
66
"tests": "vitest --config ./tests/vitest.config.js",
77
"test:unit": "npm run tests --project unit",
8-
"test:integration": "npm run tests --project integration",
8+
"test:integration": "npm run tests --project integration --fileParallelism=false",
99
"geode_objects": "node scripts/generate_geode_objects.js && prettier ./assets/geode_objects.js --write",
1010
"build": ""
1111
},
@@ -38,7 +38,7 @@
3838
"overrides": {
3939
"vue": "latest"
4040
},
41-
"description": "OpenSource Vue/Vuetify framework for web applications",
41+
"description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
4242
"type": "module",
4343
"version": "0.0.0",
4444
"main": "./nuxt.config.js",

stores/data_base.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ export const useDataBaseStore = defineStore("dataBase", () => {
55
const treeview_store = useTreeviewStore()
66
const hybridViewerStore = useHybridViewerStore()
77

8-
/** State **/
98
const db = reactive({})
109

11-
/** Getters **/
1210
function itemMetaDatas(id) {
1311
return db[id]
1412
}
@@ -41,13 +39,13 @@ export const useDataBaseStore = defineStore("dataBase", () => {
4139
return null
4240
}
4341

44-
/** Actions **/
4542
async function registerObject(id) {
4643
return viewer_call({
4744
schema: viewer_schemas.opengeodeweb_viewer.generic.register,
4845
params: { id },
4946
})
5047
}
48+
5149
async function addItem(
5250
id,
5351
value = {
Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
1-
// Global imports
1+
// Node.js imports
22

33
// Third party imports
4-
import { afterEach, beforeEach, describe, expect, test } from "vitest"
5-
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
4+
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"
5+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" }
66

77
// Local imports
8-
import Status from "@ogw_f/utils/status"
9-
import * as composables from "@ogw_f/composables/viewer_call"
10-
import { useDataStyleStore } from "@ogw_f/stores/data_style"
11-
import { useViewerStore } from "@ogw_f/stores/viewer"
12-
import { setupTests } from "../setup.test.js"
8+
import Status from "~/utils/status"
9+
import * as composables from "~/composables/viewer_call"
10+
import { useDataStyleStore } from "~/stores/data_style"
11+
import { useViewerStore } from "~/stores/viewer"
12+
import { kill_back, kill_viewer } from "~/utils/local"
13+
import { setupIntegrationTests } from "./integration/setup.js"
1314

1415
// Local constants
1516
const mesh_schemas = viewer_schemas.opengeodeweb_viewer.mesh
16-
const id = "fake_id"
17+
let id
1718
const file_name = "edged_curve.vtp"
1819
const geode_object = "EdgedCurve2D"
1920
const object_type = "mesh"
2021

2122
beforeEach(async () => {
22-
setupTests(id, file_name, geode_object, object_type)
23+
id = setupIntegrationTests(id, file_name, geode_object, object_type)
24+
console.log("beforeEach index id", id)
2325
})
2426

2527
afterEach(async () => {
26-
await kill_processes()
28+
const viewerStore = useViewerStore()
29+
const geodeStore = useGeodeStore()
30+
await Promise.all([
31+
kill_back(geodeStore.default_local_port),
32+
kill_viewer(viewerStore.default_local_port),
33+
])
2734
})
2835

2936
describe("Mesh", () => {

tests/integration/data/fake_id/edged_curve.vtp

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/integration/data/fake_id/hat.vtp

Lines changed: 0 additions & 19 deletions
This file was deleted.

tests/integration/data/fake_id/polygon_attribute.vtp

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)