Skip to content

Commit

Permalink
code cleanup console.log & remove async in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienChampagnol committed Oct 9, 2024
1 parent 647ee11 commit 2f92c7b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion test/components/CrsSelector.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const vuetify = createVuetify({
directives,
})

describe("CrsSelector.vue", async () => {
describe("CrsSelector.vue", () => {
const pinia = createTestingPinia()
setActivePinia(pinia)
const geode_store = use_geode_store()
Expand Down
19 changes: 6 additions & 13 deletions test/stores/Geode.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { describe, test, expect, expectTypeOf, beforeEach, vi } from "vitest"
import { registerEndpoint } from "@nuxt/test-utils/runtime"
import back_schemas from "@geode/opengeodeweb-back/schemas.json"

describe("Geode Store", async () => {
describe("Geode Store", () => {
const pinia = createTestingPinia({
stubActions: false,
})
Expand All @@ -20,7 +20,7 @@ describe("Geode Store", async () => {
})

describe("state", () => {
test("initial state", async () => {
test("initial state", () => {
expectTypeOf(geode_store.default_local_port).toBeString()
expectTypeOf(geode_store.request_counter).toBeNumber()
expectTypeOf(geode_store.is_running).toBeBoolean()
Expand Down Expand Up @@ -59,26 +59,19 @@ describe("Geode Store", async () => {

describe("base_url", () => {
test("test is_cloud false", () => {
console.log("is_cloud")
infra_store.is_cloud = false
console.log("is_cloud")
infra_store.domain_name = "localhost"
console.log("is_cloud")
const url = geode_store.port
console.log("port", url)
const url2 = geode_store.base_url
console.log("base_url", url2)
expect(geode_store.base_url).toBe("http://localhost:5000")
})
test("test is_cloud true", async () => {
test("test is_cloud true", () => {
infra_store.is_cloud = true
infra_store.ID = "123456"
infra_store.domain_name = "example.com"
expect(geode_store.base_url).toBe(
"https://example.com:443/123456/geode",
)
})
test("test is_cloud true, ID empty", async () => {
test("test is_cloud true, ID empty", () => {
infra_store.is_cloud = true
infra_store.ID = ""
infra_store.domain_name = "example.com"
Expand All @@ -100,8 +93,8 @@ describe("Geode Store", async () => {
})
})

describe("actions", async () => {
describe("do_ping", async () => {
describe("actions", () => {
describe("do_ping", () => {
const getFakeCall = vi.fn()
registerEndpoint(back_schemas.opengeodeweb_back.ping.$id, getFakeCall)

Expand Down
4 changes: 2 additions & 2 deletions test/stores/Infra.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ describe("Infra Store", () => {
})

describe("actions", () => {
describe("create_connexion", async () => {
describe("create_connexion", () => {
test("test without end-point", async () => {
await infra_store.create_connexion()
expect(infra_store.is_connexion_launched).toBe(true)
expect(feedback_store.server_error).toBe(true)
})
})
describe("create_backend", async () => {
describe("create_backend", () => {
test("test without end-point", async () => {
await infra_store.create_backend()
expect(geode_store.is_running).toBe(false)
Expand Down
6 changes: 3 additions & 3 deletions test/stores/Viewer.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe("Viewer Store", () => {
expect(viewer_store.base_url).toBe("ws://localhost:1234/ws")
})

test("test is_cloud true", async () => {
test("test is_cloud true", () => {
infra_store.is_cloud = true
infra_store.ID = "123456"
infra_store.domain_name = "example.com"
Expand All @@ -73,7 +73,7 @@ describe("Viewer Store", () => {
)
})

test("test is_cloud true, ID empty", async () => {
test("test is_cloud true, ID empty", () => {
infra_store.is_cloud = true
infra_store.ID = ""
infra_store.domain_name = "example.com"
Expand All @@ -95,7 +95,7 @@ describe("Viewer Store", () => {
})
describe("actions", () => {
// MISSING TEST ws_connect()
describe("toggle_picking_mode", async () => {
describe("toggle_picking_mode", () => {
test("test true", async () => {
await viewer_store.toggle_picking_mode(true)
expect(viewer_store.picking_mode).toBe(true)
Expand Down

0 comments on commit 2f92c7b

Please sign in to comment.