Skip to content

Commit 01291f9

Browse files
Merge pull request #193 from Geode-solutions/next
No commit message
2 parents cfabade + 52983d7 commit 01291f9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

stores/infra.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const use_infra_store = defineStore("infra", {
4848
actions: {
4949
async create_backend() {
5050
if (this.status === Status.CREATED) return
51-
navigator.locks.request("infra.create_backend", async (lock) => {
51+
return navigator.locks.request("infra.create_backend", async (lock) => {
5252
this.status = Status.CREATING
5353
if (this.status === Status.CREATED) return
5454
console.log("LOCK GRANTED !", lock)

stores/viewer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const use_viewer_store = defineStore("viewer", {
5959
async ws_connect() {
6060
if (process.env.NODE_ENV == "test") return
6161
if (this.status === Status.CONNECTED) return
62-
navigator.locks.request("viewer.ws_connect", async (lock) => {
62+
return navigator.locks.request("viewer.ws_connect", async (lock) => {
6363
if (this.status === Status.CONNECTED) return
6464
console.log("VIEWER LOCK GRANTED !", lock)
6565
this.status = Status.CONNECTING

test/stores/Infra.nuxt.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ describe("Infra Store", () => {
123123
test("test without end-point", async () => {
124124
await infra_store.create_backend()
125125
console.log("geode_store.status", geode_store.status)
126-
expect(infra_store.status).toBe(Status.CREATING)
126+
expect(infra_store.status).toBe(Status.NOT_CREATED)
127127
expect(geode_store.status).toBe(Status.NOT_CONNECTED)
128128
expect(viewer_store.status).toBe(Status.NOT_CONNECTED)
129129
})
@@ -133,10 +133,10 @@ describe("Infra Store", () => {
133133
handler: () => ({ ID: "123456" }),
134134
})
135135
await infra_store.create_backend()
136-
expect(infra_store.status).toBe(Status.CREATING)
136+
expect(infra_store.status).toBe(Status.CREATED)
137137
expect(geode_store.status).toBe(Status.NOT_CONNECTED)
138138
expect(viewer_store.status).toBe(Status.NOT_CONNECTED)
139-
expect(feedback_store.server_error).toBe(false)
139+
expect(feedback_store.server_error).toBe(true)
140140
})
141141
})
142142
})

0 commit comments

Comments
 (0)