Skip to content

Commit dee5026

Browse files
unit tests
1 parent ff93298 commit dee5026

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

tests/unit/stores/Infra.nuxt.test.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -283,22 +283,26 @@ describe("Infra Store", () => {
283283
await infra_store.create_backend()
284284
expect(infra_store.status).toBe(Status.CREATED)
285285
})
286-
// test("test with end-point", async () => {
287-
// const infra_store = useInfraStore()
288-
// const geodeStore = useGeodeStore()
289-
// const viewerStore = useViewerStore()
290-
// const feedback_store = useFeedbackStore()
291-
292-
// registerEndpoint(infra_store.lambda_url, {
293-
// method: "POST",
294-
// handler: () => ({ ID: "123456" }),
295-
// })
296-
// await infra_store.create_backend()
297-
// expect(infra_store.status).toBe(Status.CREATED)
298-
// expect(geodeStore.status).toBe(Status.NOT_CONNECTED)
299-
// expect(viewerStore.status).toBe(Status.NOT_CONNECTED)
300-
// expect(feedback_store.server_error).toBe(true)
301-
// })
286+
test("test with end-point", async () => {
287+
const infra_store = useInfraStore()
288+
const geodeStore = useGeodeStore()
289+
const viewerStore = useViewerStore()
290+
const feedback_store = useFeedbackStore()
291+
const lambdaStore = useLambdaStore()
292+
293+
infra_store.app_mode = appMode.CLOUD
294+
const ID = "123456"
295+
registerEndpoint(lambdaStore.base_url, {
296+
method: "POST",
297+
handler: () => ({ ID }),
298+
})
299+
await infra_store.create_backend()
300+
expect(infra_store.status).toBe(Status.CREATED)
301+
expect(infra_store.ID).toBe(ID)
302+
303+
expect(geodeStore.status).toBe(Status.NOT_CONNECTED)
304+
expect(viewerStore.status).toBe(Status.NOT_CONNECTED)
305+
})
302306
})
303307
})
304308
})

0 commit comments

Comments
 (0)