Skip to content

Commit 5ba4285

Browse files
all integration tests passing
1 parent 6402a07 commit 5ba4285

21 files changed

+128
-109
lines changed

internal_stores/mesh/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export default function useMeshStyle() {
5959
throw new Error("Unknown mesh key: " + key)
6060
}
6161
}
62-
console.log(0, { promise_array })
6362
return Promise.all(promise_array)
6463
}
6564

internal_stores/model/corners.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ export function useModelCornersStyle() {
2626
modelCornerStyle(id, corner_id).visibility = visibility
2727
}
2828
function setModelCornersVisibility(id, corner_ids, visibility) {
29-
console.log("setModelCornersVisibility", id, corner_ids, visibility)
3029
const corner_flat_indexes = dataBaseStore.getFlatIndexes(id, corner_ids)
31-
console.log("corner_flat_indexes", corner_flat_indexes)
3230
return viewer_call(
3331
{
3432
schema: model_corners_schemas.visibility,
@@ -59,7 +57,6 @@ export function useModelCornersStyle() {
5957
}
6058

6159
function setModelCornersColor(id, corner_ids, color) {
62-
console.log("setModelCornersColor", id, corner_ids, color)
6360
const corner_flat_indexes = dataBaseStore.getFlatIndexes(id, corner_ids)
6461
return viewer_call(
6562
{
@@ -83,9 +80,7 @@ export function useModelCornersStyle() {
8380
}
8481

8582
function applyModelCornersStyle(id) {
86-
console.log("applyModelCornersStyle", id)
8783
const corners_style = modelCornersStyle(id)
88-
console.log("corners_style", corners_style)
8984
const corner_ids = dataBaseStore.getCornersUuids(id)
9085
return Promise.all([
9186
setModelCornersVisibility(id, corner_ids, corners_style.visibility),

internal_stores/model/edges.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export function useModelEdgesStyle() {
1515
}
1616

1717
function setModelEdgesVisibility(id, visibility) {
18-
console.log("setModelEdgesVisibility", id, visibility)
1918
return viewer_call(
2019
{
2120
schema: model_edges_schemas.visibility,
@@ -35,9 +34,7 @@ export function useModelEdgesStyle() {
3534
}
3635

3736
function applyModelEdgesStyle(id) {
38-
console.log("applyModelEdgesStyle", id)
3937
const edges_style = modelEdgesStyle(id)
40-
console.log("edges_style", edges_style)
4138
return Promise.all([setModelEdgesVisibility(id, edges_style.visibility)])
4239
}
4340

internal_stores/model/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export default function useModelStyle() {
2727
return dataStyleStore.getStyle(id).visibility
2828
}
2929
function setModelVisibility(id, visibility) {
30-
console.log("setModelVisibility", id, visibility)
3130
return viewer_call(
3231
{
3332
schema: model_schemas.visibility,
@@ -36,7 +35,7 @@ export default function useModelStyle() {
3635
{
3736
response_function: () => {
3837
dataStyleStore.getStyle(id).visibility = visibility
39-
// hybridViewerStore.setVisibility(id, visibility)
38+
hybridViewerStore.setVisibility(id, visibility)
4039
console.log(setModelVisibility.name, { id }, modelVisibility(id))
4140
},
4241
},
@@ -84,7 +83,6 @@ export default function useModelStyle() {
8483
return dataStyleStore.getStyle(id).color
8584
}
8685
function setModelColor(id, color) {
87-
console.log("setModelColor", id, color)
8886
return viewer_call(
8987
{
9088
schema: model_schemas.color,
@@ -136,7 +134,6 @@ export default function useModelStyle() {
136134

137135
function applyModelDefaultStyle(id) {
138136
const style = dataStyleStore.getStyle(id)
139-
console.log("applyModelDefaultStyle", id, style)
140137
const promise_array = []
141138
for (const [key, value] of Object.entries(style)) {
142139
if (key === "visibility") {
@@ -157,7 +154,6 @@ export default function useModelStyle() {
157154
throw new Error("Unknown model key: " + key)
158155
}
159156
}
160-
console.log("applyModelDefaultStyle", { promise_array })
161157
return Promise.all(promise_array)
162158
}
163159

internal_stores/model/lines.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export function useModelLinesStyle() {
2626
modelLineStyle(id, line_id).visibility = visibility
2727
}
2828
function setModelLinesVisibility(id, line_ids, visibility) {
29-
console.log("setModelLinesVisibility", id, line_ids, visibility)
3029
const line_flat_indexes = dataBaseStore.getFlatIndexes(id, line_ids)
3130
return viewer_call(
3231
{
@@ -56,7 +55,6 @@ export function useModelLinesStyle() {
5655
modelLineStyle(id, line_id).color = color
5756
}
5857
function setModelLinesColor(id, line_ids, color) {
59-
console.log("setModelLinesColor", id, line_ids, color)
6058
const line_flat_indexes = dataBaseStore.getFlatIndexes(id, line_ids)
6159
return viewer_call(
6260
{

internal_stores/model/points.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export function useModelPointsStyle() {
1414
return modelPointsStyle(id).visibility
1515
}
1616
function setModelPointsVisibility(id, visibility) {
17-
console.log("setModelPointsVisibility", id, visibility)
1817
return viewer_call(
1918
{
2019
schema: model_points_schemas.visibility,
@@ -37,7 +36,6 @@ export function useModelPointsStyle() {
3736
return modelPointsStyle(id).size
3837
}
3938
function setModelPointsSize(id, size) {
40-
console.log("setModelPointsSize", id, size)
4139
return viewer_call(
4240
{
4341
schema: model_points_schemas.size,

internal_stores/model/surfaces.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export function useModelSurfacesStyle() {
2222
modelSurfaceStyle(id, surface_id).visibility = visibility
2323
}
2424
function setModelSurfacesVisibility(id, surface_ids, visibility) {
25-
console.log("setModelSurfacesVisibility", id, surface_ids, visibility)
2625
const surface_flat_indexes = dataBaseStore.getFlatIndexes(id, surface_ids)
2726
return viewer_call(
2827
{
@@ -52,7 +51,6 @@ export function useModelSurfacesStyle() {
5251
}
5352

5453
function setModelSurfacesColor(id, surface_ids, color) {
55-
console.log("setModelSurfacesColor", id, surface_ids, color)
5654
const surface_flat_indexes = dataBaseStore.getFlatIndexes(id, surface_ids)
5755
return viewer_call(
5856
{
@@ -76,9 +74,7 @@ export function useModelSurfacesStyle() {
7674
}
7775

7876
function applyModelSurfacesStyle(id) {
79-
console.log("applyModelSurfacesStyle", id)
8077
const surfaces_style = dataStyleStore.getStyle(id).surfaces
81-
console.log("surfaces_style", surfaces_style)
8278
const surface_ids = dataBaseStore.getSurfacesUuids(id)
8379
return Promise.all([
8480
setModelSurfacesVisibility(id, surface_ids, surfaces_style.visibility),

tests/integration/setup.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async function setupIntegrationTests(file_name, geode_object) {
4747
infraStore.app_mode = appMode.BROWSER
4848

4949
const microservices_path = path.join("tests", "integration", "microservices")
50-
const project_folder_path = path.join(__dirname, "data", uuidv4())
50+
const project_folder_path = path.join(data_folder, uuidv4())
5151
const upload_folder_path = path.join(__dirname, "data", "uploads")
5252
const back_path = path.join(
5353
executable_path(path.join(microservices_path, "back")),
@@ -132,7 +132,7 @@ async function setupIntegrationTests(file_name, geode_object) {
132132
expect(viewerStore.status).toBe(Status.CONNECTED)
133133
console.log("END OF SETUP")
134134

135-
return { id, back_port, viewer_port }
135+
return { id, back_port, viewer_port, project_folder_path }
136136
}
137137

138138
const mockLockRequest = vi.fn().mockImplementation(async (name, callback) => {
@@ -146,16 +146,12 @@ vi.stubGlobal("navigator", {
146146
},
147147
})
148148

149-
let foldersBeforeTests = new Set()
150-
151149
beforeAll(() => {
152150
global.WebSocket = WebSocket
153-
foldersBeforeTests = getCurrentFolders(data_folder)
154151
})
155152

156153
afterAll(() => {
157154
delete global.WebSocket
158-
cleanupCreatedFolders(data_folder, foldersBeforeTests)
159155
})
160156

161157
export { setupIntegrationTests }

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,30 @@ import Status from "~/utils/status"
77
import * as composables from "~/composables/viewer_call"
88
import { useDataStyleStore } from "~/stores/data_style"
99
import { useViewerStore } from "~/stores/viewer"
10-
import { kill_back, kill_viewer } from "~/utils/local"
10+
import { delete_folder_recursive, kill_back, kill_viewer } from "~/utils/local"
1111
import { setupIntegrationTests } from "../../../setup.js"
1212

1313
// Local constants
1414
const mesh_edges_schemas = viewer_schemas.opengeodeweb_viewer.mesh.edges
1515
const file_name = "test.og_edc2d"
1616
const geode_object = "EdgedCurve2D"
1717

18-
let id, back_port, viewer_port
18+
let id, back_port, viewer_port, project_folder_path
1919

2020
beforeEach(async () => {
21-
;({ id, back_port, viewer_port } = await setupIntegrationTests(
22-
file_name,
23-
geode_object,
24-
))
21+
;({ id, back_port, viewer_port, project_folder_path } =
22+
await setupIntegrationTests(file_name, geode_object))
2523
}, 25000)
2624

2725
afterEach(async () => {
28-
console.log("afterEach mesh edges kill", back_port, viewer_port)
26+
console.log(
27+
"afterEach mesh edges kill",
28+
back_port,
29+
viewer_port,
30+
project_folder_path,
31+
)
2932
await Promise.all([kill_back(back_port), kill_viewer(viewer_port)])
33+
delete_folder_recursive(project_folder_path)
3034
})
3135

3236
describe("Mesh edges", () => {

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,30 @@ import Status from "~/utils/status"
77
import * as composables from "~/composables/viewer_call"
88
import { useDataStyleStore } from "~/stores/data_style"
99
import { useViewerStore } from "~/stores/viewer"
10-
import { kill_back, kill_viewer } from "~/utils/local"
10+
import { delete_folder_recursive, kill_back, kill_viewer } from "~/utils/local"
1111
import { setupIntegrationTests } from "../../../setup.js"
1212

1313
// Local constants
1414
const mesh_schemas = viewer_schemas.opengeodeweb_viewer.mesh
1515
const file_name = "test.og_rgd3d"
1616
const geode_object = "RegularGrid3D"
1717

18-
let id, back_port, viewer_port
18+
let id, back_port, viewer_port, project_folder_path
1919

2020
beforeEach(async () => {
21-
;({ id, back_port, viewer_port } = await setupIntegrationTests(
22-
file_name,
23-
geode_object,
24-
))
21+
;({ id, back_port, viewer_port, project_folder_path } =
22+
await setupIntegrationTests(file_name, geode_object))
2523
}, 20000)
2624

2725
afterEach(async () => {
28-
console.log("afterEach mesh index kill", back_port, viewer_port)
26+
console.log(
27+
"afterEach mesh index kill",
28+
back_port,
29+
viewer_port,
30+
project_folder_path,
31+
)
2932
await Promise.all([kill_back(back_port), kill_viewer(viewer_port)])
33+
delete_folder_recursive(project_folder_path)
3034
})
3135

3236
describe("Mesh", () => {
@@ -35,8 +39,8 @@ describe("Mesh", () => {
3539
const dataStyleStore = useDataStyleStore()
3640
const viewerStore = useViewerStore()
3741
const visibility = true
38-
await dataStyleStore.setMeshVisibility(id, visibility)
3942
const spy = vi.spyOn(composables, "viewer_call")
43+
await dataStyleStore.setMeshVisibility(id, visibility)
4044
expect(spy).toHaveBeenCalledWith(
4145
{
4246
schema: mesh_schemas.visibility,

0 commit comments

Comments
 (0)