Skip to content

Commit 8268987

Browse files
test okay
1 parent a09e243 commit 8268987

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed
Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,30 @@
1-
import { setActivePinia, createPinia } from "pinia"
21
import { describe, expect, test, beforeEach, vi } from "vitest"
32

43
describe("api_fetch.js", () => {
54
const geode_store = use_geode_store()
65
const websocket_store = use_websocket_store()
7-
const cloud_store = use_cloud_store()
86

97
const dumb_obj = { dumb_method: () => true }
108

119
beforeEach(async () => {
12-
setActivePinia(createPinia())
1310
await geode_store.$patch({ is_running: false })
1411
await websocket_store.$patch({ is_running: false })
1512
})
1613

1714
test("is_running true", async () => {
1815
const spy = vi.spyOn(dumb_obj, "dumb_method")
19-
console.log("cloud_store.is_running", cloud_store.is_running)
2016
await geode_store.$patch({ is_running: true })
2117
await websocket_store.$patch({ is_running: true })
2218

2319
await runFunctionIfCloudRunning(dumb_obj.dumb_method)
2420
expect(spy).toHaveBeenCalled()
2521
})
2622

27-
// test("is_running false", async () => {
28-
// const spy = vi.spyOn(dumb_obj, "dumb_method")
29-
// runFunctionIfCloudRunning(dumb_obj.dumb_method)
30-
// // expect(spy).not.toHaveBeenCalled()
31-
// await geode_store.$patch({ is_running: true })
32-
// await websocket_store.$patch({ is_running: true })
33-
// console.log("geode_store.is_running", geode_store.is_running)
34-
// console.log("websocket_store.is_running", websocket_store.is_running)
35-
// console.log("cloud_store.is_running", cloud_store.is_running)
36-
37-
// expect(spy).toHaveBeenCalled()
38-
// })
23+
test("is_running false", async () => {
24+
const spy = vi.spyOn(dumb_obj, "dumb_method")
25+
runFunctionIfCloudRunning(dumb_obj.dumb_method)
26+
await geode_store.$patch({ is_running: true })
27+
await websocket_store.$patch({ is_running: true })
28+
expect(spy).toHaveBeenCalled()
29+
})
3930
})

0 commit comments

Comments
 (0)