Skip to content

Commit ec40020

Browse files
authored
Merge pull request #278 from Geode-solutions/fix/vitest_4
Fix/vitest 4
2 parents 18f17df + 308134c commit ec40020

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"unplugin-auto-import": "20.0.0",
3131
"vite": "6.3.5",
3232
"vite-plugin-vuetify": "2.1.1",
33-
"vitest": "3.2.4",
33+
"vitest": "4.0.15",
3434
"vitest-environment-nuxt": "1.0.1"
3535
},
3636
"overrides": {

tests/integration/microservices/back/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
# pip-compile --output-file=tests/integration/microservices/back/requirements.txt tests/integration/microservices/back/requirements.in
66
#
77

8-
opengeodeweb-back==5.*,>=5.14.1

tests/integration/microservices/viewer/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
# pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt tests/integration/microservices/viewer/requirements.in
66
#
77

8-
opengeodeweb-viewer==1.*,>=1.13.2

tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,20 @@ describe("run_function_when_microservices_connected", () => {
4141
await viewerStore.$patch({ status: Status.NOT_CONNECTED })
4242
})
4343

44-
test("microservices connected", async () => {
44+
test("microservices not connected", async () => {
4545
const geodeStore = useGeodeStore()
4646
const viewerStore = useViewerStore()
47+
const infraStore = useInfraStore()
4748
const spy = vi.spyOn(dumb_obj, "dumb_method")
4849
run_function_when_microservices_connected(dumb_obj.dumb_method)
49-
await geodeStore.$patch({ status: Status.CONNECTED })
50-
await viewerStore.$patch({ status: Status.CONNECTED })
51-
expect(spy).toHaveBeenCalled()
52-
})
50+
await geodeStore.$patch({ status: Status.NOT_CONNECTED })
51+
await viewerStore.$patch({ status: Status.NOT_CONNECTED })
52+
console.log("geodeStore", geodeStore.status)
53+
console.log("viewerStore", viewerStore.status)
5354

55+
console.log("microservices_connected", infraStore.microservices_connected)
56+
expect(spy).not.toHaveBeenCalled()
57+
})
5458
test("microservices not connected", async () => {
5559
const geodeStore = useGeodeStore()
5660
const viewerStore = useViewerStore()
@@ -65,4 +69,14 @@ describe("run_function_when_microservices_connected", () => {
6569
console.log("microservices_connected", infraStore.microservices_connected)
6670
expect(spy).not.toHaveBeenCalled()
6771
})
72+
73+
test("microservices connected", async () => {
74+
const geodeStore = useGeodeStore()
75+
const viewerStore = useViewerStore()
76+
const spy = vi.spyOn(dumb_obj, "dumb_method")
77+
run_function_when_microservices_connected(dumb_obj.dumb_method)
78+
await geodeStore.$patch({ status: Status.CONNECTED })
79+
await viewerStore.$patch({ status: Status.CONNECTED })
80+
expect(spy).toHaveBeenCalled()
81+
})
6882
})

0 commit comments

Comments
 (0)