WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"unplugin-auto-import": "20.0.0",
"vite": "6.3.5",
"vite-plugin-vuetify": "2.1.1",
"vitest": "3.2.4",
"vitest": "4.0.15",
"vitest-environment-nuxt": "1.0.1"
},
"overrides": {
Expand Down
1 change: 0 additions & 1 deletion tests/integration/microservices/back/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
# pip-compile --output-file=tests/integration/microservices/back/requirements.txt tests/integration/microservices/back/requirements.in
#

opengeodeweb-back==5.*,>=5.14.1
1 change: 0 additions & 1 deletion tests/integration/microservices/viewer/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
# pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt tests/integration/microservices/viewer/requirements.in
#

opengeodeweb-viewer==1.*,>=1.13.2
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,60 @@
import Status from "@ogw_front/utils/status"

import { setActivePinia } from "pinia"
import { createTestingPinia } from "@pinia/testing"

Check failure on line 5 in tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(sort-imports)

Imports should be sorted alphabetically.

import { run_function_when_microservices_connected } from "@ogw_front/composables/run_function_when_microservices_connected"
import { useInfraStore } from "@ogw_front/stores/infra"
import { useGeodeStore } from "@ogw_front/stores/geode"

Check warning on line 9 in tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint-plugin-import(max-dependencies)

File has too many dependencies (12). Maximum allowed is 10.

Check failure on line 9 in tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(sort-imports)

Imports should be sorted alphabetically.
import { useViewerStore } from "@ogw_front/stores/viewer"

beforeEach(async () => {
const pinia = createTestingPinia({
stubActions: false,
createSpy: vi.fn,
})
setActivePinia(pinia)
})

Check warning on line 18 in tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(require-await)

Async function has no 'await' expression.

describe("run_function_when_microservices_connected", () => {
const dumb_obj = { dumb_method: () => true }

beforeEach(async () => {
const infraStore = useInfraStore()
const geodeStore = useGeodeStore()
const viewerStore = useViewerStore()

// Register microservices in infra store
infraStore.register_microservice(geodeStore, {
request: vi.fn(),
connect: vi.fn(),
launch: vi.fn(),
})
infraStore.register_microservice(viewerStore, {
request: vi.fn(),
connect: vi.fn(),
launch: vi.fn(),
})

await geodeStore.$patch({ status: Status.NOT_CONNECTED })
await viewerStore.$patch({ status: Status.NOT_CONNECTED })
})

test("microservices connected", async () => {
test("microservices not connected", async () => {

Check failure on line 44 in tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint-plugin-jest(consistent-test-it)

Enforce `test` and `it` usage conventions
const geodeStore = useGeodeStore()
const viewerStore = useViewerStore()
const infraStore = useInfraStore()
const spy = vi.spyOn(dumb_obj, "dumb_method")
run_function_when_microservices_connected(dumb_obj.dumb_method)
await geodeStore.$patch({ status: Status.CONNECTED })
await viewerStore.$patch({ status: Status.CONNECTED })
expect(spy).toHaveBeenCalled()
})
await geodeStore.$patch({ status: Status.NOT_CONNECTED })
await viewerStore.$patch({ status: Status.NOT_CONNECTED })
console.log("geodeStore", geodeStore.status)

Check failure on line 52 in tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(no-console)

Unexpected console statement.
console.log("viewerStore", viewerStore.status)

Check failure on line 53 in tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(no-console)

Unexpected console statement.

console.log("microservices_connected", infraStore.microservices_connected)

Check failure on line 55 in tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(no-console)

Unexpected console statement.
expect(spy).not.toHaveBeenCalled()
})
test("microservices not connected", async () => {

Check failure on line 58 in tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint-plugin-jest(consistent-test-it)

Enforce `test` and `it` usage conventions
const geodeStore = useGeodeStore()
const viewerStore = useViewerStore()
const infraStore = useInfraStore()
Expand All @@ -59,10 +63,20 @@
run_function_when_microservices_connected(dumb_obj.dumb_method)
await geodeStore.$patch({ status: Status.NOT_CONNECTED })
await viewerStore.$patch({ status: Status.NOT_CONNECTED })
console.log("geodeStore", geodeStore.status)

Check failure on line 66 in tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(no-console)

Unexpected console statement.
console.log("viewerStore", viewerStore.status)

Check failure on line 67 in tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(no-console)

Unexpected console statement.

console.log("microservices_connected", infraStore.microservices_connected)

Check failure on line 69 in tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(no-console)

Unexpected console statement.
expect(spy).not.toHaveBeenCalled()
})

test("microservices connected", async () => {
const geodeStore = useGeodeStore()
const viewerStore = useViewerStore()
const spy = vi.spyOn(dumb_obj, "dumb_method")
run_function_when_microservices_connected(dumb_obj.dumb_method)
await geodeStore.$patch({ status: Status.CONNECTED })
await viewerStore.$patch({ status: Status.CONNECTED })
expect(spy).toHaveBeenCalled()
})
})

Check warning on line 82 in tests/unit/composables/run_function_when_microservices_connected.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(max-lines-per-function)

The function has too many lines (63). Maximum allowed is 50.