Skip to content

Commit 0562156

Browse files
test
1 parent dea78dd commit 0562156

13 files changed

+63
-127
lines changed
File renamed without changes.
File renamed without changes.

tests/edges.nuxt.test.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Node.js imports
2+
3+
// Third party imports
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" }
6+
7+
// Local imports
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 { setupIntegrationTests } from "./integration/setup.js"
13+
14+
// Local constants
15+
const model_edges_schemas = viewer_schemas.opengeodeweb_viewer.model.edges
16+
let id, back_port, viewer_port
17+
const file_name = "test.og_edc2d"
18+
const geode_object = "EdgedCurve2D"
19+
const object_type = "model"
20+
21+
beforeEach(async () => {
22+
;({ id, back_port, viewer_port } = await setupIntegrationTests(
23+
file_name,
24+
geode_object,
25+
object_type,
26+
))
27+
}, 20000)
28+
29+
afterEach(async () => {
30+
await Promise.all([kill_back(back_port), kill_viewer(viewer_port)])
31+
})
32+
33+
describe("Model edges", () => {
34+
describe("Edges visibility", () => {
35+
test("Visibility true", async () => {
36+
const dataStyleStore = useDataStyleStore()
37+
const viewerStore = useViewerStore()
38+
await dataStyleStore.setModelEdgesVisibility(id, true)
39+
expect(dataStyleStore.modelEdgesVisibility(id)).toBe(true)
40+
expect(viewerStore.status).toBe(Status.CONNECTED)
41+
})
42+
})
43+
})

tests/index.nuxt.test.js

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,35 @@
1-
// Node.js imports
1+
// Global imports
22

33
// Third party imports
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" }
4+
import { afterEach, beforeEach, describe, expect, test } from "vitest"
5+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
66

77
// Local imports
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"
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"
1413

1514
// Local constants
16-
const mesh_schemas = viewer_schemas.opengeodeweb_viewer.mesh
17-
let id
15+
const model_schemas = viewer_schemas.opengeodeweb_viewer.model
16+
const id = "fake_id"
1817
const file_name = "edged_curve.vtp"
1918
const geode_object = "EdgedCurve2D"
2019
const object_type = "mesh"
2120

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

2725
afterEach(async () => {
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-
])
26+
await kill_processes()
3427
})
3528

36-
describe("Mesh", () => {
37-
describe("Mesh visibility", () => {
38-
test("Visibility true", async () => {
39-
const dataStyleStore = useDataStyleStore()
40-
const viewerStore = useViewerStore()
41-
const spy = vi.spyOn(composables, "viewer_call")
42-
await dataStyleStore.setMeshEdgesVisibility(id, true)
43-
expect(spy).toHaveBeenCalledWith(
44-
{
45-
schema: mesh_schemas.visibility,
46-
params: { id, color },
47-
},
48-
{
49-
response_function: expect.any(Function),
50-
},
51-
)
52-
expect(dataStyleStore.meshEdgesVisibility(id)).toBe(true)
53-
expect(viewerStore.status).toBe(Status.CONNECTED)
29+
describe("Model", () => {
30+
describe("Visibility", () => {
31+
test("true", async () => {
32+
expect(true).toBe(true)
5433
})
5534
})
5635
})

tests/integration/stores/data_style/mesh/edges.nuxt.test.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,9 @@ beforeEach(async () => {
2424
geode_object,
2525
object_type,
2626
))
27-
console.log(
28-
"beforeEach edges id",
29-
id,
30-
"back_port",
31-
back_port,
32-
"viewer_port",
33-
viewer_port,
34-
)
35-
}, 25000)
27+
}, 20000)
3628

3729
afterEach(async () => {
38-
const viewerStore = useViewerStore()
39-
const geodeStore = useGeodeStore()
40-
41-
console.log("afterEach back_port", back_port)
42-
console.log("afterEach viewer_port", viewer_port)
4330
await Promise.all([kill_back(back_port), kill_viewer(viewer_port)])
4431
})
4532

tests/integration/stores/data_style/mesh/points.nuxt.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ beforeEach(async () => {
2525
geode_object,
2626
object_type,
2727
))
28-
console.log("beforeEach points id", id)
29-
}, 25000)
28+
}, 20000)
3029

3130
afterEach(async () => {
3231
await Promise.all([kill_back(back_port), kill_viewer(viewer_port)])

tests/integration/stores/data_style/mesh/polygons.nuxt.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ beforeEach(async () => {
2525
geode_object,
2626
object_type,
2727
))
28-
console.log("beforeEach polygons id", id)
29-
}, 25000)
28+
}, 20000)
3029

3130
afterEach(async () => {
3231
await Promise.all([kill_back(back_port), kill_viewer(viewer_port)])

tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ beforeEach(async () => {
2525
geode_object,
2626
object_type,
2727
))
28-
console.log("beforeEach polyhedra id", id)
29-
}, 25000)
28+
}, 20000)
3029

3130
afterEach(async () => {
3231
await Promise.all([kill_back(back_port), kill_viewer(viewer_port)])
File renamed without changes.

tests/model/edges.nuxt.test.js

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

0 commit comments

Comments
 (0)