Skip to content

Commit ed9adce

Browse files
save
1 parent 8268987 commit ed9adce

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

stores/cloud.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const use_cloud_store = defineStore("cloud", {
3333
})
3434
console.log("error", error)
3535
if (data.value !== null) {
36+
console.log("geode_store.is_running = true")
3637
geode_store.is_running = true
3738
return geode_store.ping_task()
3839
} else {
@@ -41,6 +42,7 @@ export const use_cloud_store = defineStore("cloud", {
4142
}
4243
},
4344
async create_backend() {
45+
console.log("create backend")
4446
const geode_store = use_geode_store()
4547
const errors_store = use_errors_store()
4648
const config = useRuntimeConfig()

test/components/MissingFilesSelector.nuxt.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ describe("MissingFilesSelector.vue", async () => {
4747
})
4848
await flushPromises()
4949
await wrapper.vm.$nextTick()
50-
console.log("wrapper", wrapper.html())
5150

5251
// const VContainer = wrapper.findComponent(components.VContainer)
5352
// console.log("VContainer", VContainer)

test/stores/Cloud.nuxt.test.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { describe, test, expect } from "vitest"
2+
import registerEndpoint from "@nuxt/test-utils/runtime"
3+
4+
const cloud_store = use_cloud_store()
5+
const geode_store = use_geode_store()
6+
const websocket_store = use_websocket_store()
7+
8+
describe("Cloud Store", () => {
9+
describe("getters", () => {
10+
test("is_running", async () => {
11+
expect(cloud_store.is_running).toBe(false)
12+
await geode_store.$patch({ is_running: true })
13+
await websocket_store.$patch({ is_running: true })
14+
expect(cloud_store.is_running).toBe(true)
15+
})
16+
test("is_busy", async () => {
17+
expect(cloud_store.is_busy).toBe(false)
18+
await geode_store.start_request()
19+
await websocket_store.start_request()
20+
expect(cloud_store.is_busy).toBe(true)
21+
})
22+
})
23+
24+
describe("actions", () => {
25+
test("create_backend", async () => {
26+
expect(geode_store.is_running).toBe(false)
27+
registerEndpoint("/createbackend", {
28+
method: "POST",
29+
handler: () => {
30+
console.log("createbackend")
31+
return {}
32+
},
33+
})
34+
await cloud_store.create_connexion()
35+
expect(geode_store.is_running).toBe(true)
36+
})
37+
// test("create_connexion", async () => {
38+
// expect(geode_store.is_running).toBe(false)
39+
// registerEndpoint("/ping", {
40+
// method: "POST",
41+
// handler: () => {
42+
// console.log("ping")
43+
// return {}
44+
// },
45+
// })
46+
// await cloud_store.create_connexion()
47+
// expect(geode_store.is_running).toBe(true)
48+
// })
49+
})
50+
})

0 commit comments

Comments
 (0)