Skip to content

Commit 4be8923

Browse files
refactor vuetify imports in tests [skip ci]
1 parent c4b1214 commit 4be8923

15 files changed

+26
-141
lines changed

tests/unit/components/CrsSelector.nuxt.test.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
1-
import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
2-
1+
import { mountSuspended } from "@nuxt/test-utils/runtime"
32
import { describe, expect, test, vi } from "vitest"
43
import { setActivePinia } from "pinia"
54
import { createTestingPinia } from "@pinia/testing"
6-
import { createVuetify } from "vuetify"
7-
import * as components from "vuetify/components"
8-
import * as directives from "vuetify/directives"
95

106
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
11-
127
import CrsSelector from "@ogw_front/components/CrsSelector"
138
import { useGeodeStore } from "@ogw_front/stores/geode"
149

10+
import { vuetify } from "../../utils"
11+
1512
const crs_selector_schema =
1613
schemas.opengeodeweb_back.geographic_coordinate_systems
1714

18-
const vuetify = createVuetify({
19-
components,
20-
directives,
21-
})
22-
2315
describe("CrsSelector", () => {
2416
const pinia = createTestingPinia({
2517
stubActions: false,

tests/unit/components/ExtensionSelector.nuxt.test.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
11
import { describe, expect, test, vi } from "vitest"
22
import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
3-
4-
import { createVuetify } from "vuetify"
5-
import * as components from "vuetify/components"
6-
import * as directives from "vuetify/directives"
73
import { setActivePinia } from "pinia"
84
import { createTestingPinia } from "@pinia/testing"
5+
import * as components from "vuetify/components"
96

7+
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
108
import ExtensionSelector from "@ogw_front/components/ExtensionSelector"
11-
129
import { useGeodeStore } from "@ogw_front/stores/geode"
13-
14-
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
10+
import { vuetify } from "../../utils"
1511

1612
const schema = schemas.opengeodeweb_back.geode_objects_and_output_extensions
1713

18-
const vuetify = createVuetify({
19-
components,
20-
directives,
21-
})
22-
2314
describe("ExtensionSelector", async () => {
2415
const pinia = createTestingPinia({
2516
stubActions: false,

tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
import { describe, expect, test, vi } from "vitest"
22
import { mount } from "@vue/test-utils"
3-
import { createVuetify } from "vuetify"
4-
import * as components from "vuetify/components"
5-
import * as directives from "vuetify/directives"
63
import { createTestingPinia } from "@pinia/testing"
74
import { setActivePinia } from "pinia"
85

96
import FeedBackErrorBanner from "@ogw_front/components/FeedBack/ErrorBanner"
107
import { useFeedbackStore } from "@ogw_front/stores/feedback"
11-
12-
const vuetify = createVuetify({
13-
components,
14-
directives,
15-
})
8+
import { vuetify } from "../../../utils"
169

1710
describe("FeedBackErrorBanner", async () => {
18-
;(test(`Test reload`, async () => {
11+
test(`Test reload`, async () => {
1912
const pinia = createTestingPinia({
2013
stubActions: false,
2114
createSpy: vi.fn,
@@ -56,5 +49,5 @@ describe("FeedBackErrorBanner", async () => {
5649
const v_btn = wrapper.findAll(".v-btn")
5750
await v_btn[1].trigger("click")
5851
expect(feedbackStore.server_error).toBe(false)
59-
}))
52+
})
6053
})

tests/unit/components/FeedBack/Snackers.nuxt.test.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,13 @@
22
vi.stubGlobal("visualViewport", new EventTarget())
33
import { describe, expect, test, vi } from "vitest"
44
import { mount } from "@vue/test-utils"
5-
import { createVuetify } from "vuetify"
65
import * as components from "vuetify/components"
7-
import * as directives from "vuetify/directives"
8-
96
import { setActivePinia } from "pinia"
107
import { createTestingPinia } from "@pinia/testing"
118

129
import FeedBackSnackers from "@ogw_front/components/FeedBack/Snackers"
1310
import { useFeedbackStore } from "@ogw_front/stores/feedback"
14-
15-
const vuetify = createVuetify({
16-
components,
17-
directives,
18-
})
11+
import { vuetify } from "../../../utils"
1912

2013
describe("FeedBackSnackers", async () => {
2114
test(`Test delete error`, async () => {

tests/unit/components/FileSelector.nuxt.test.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import { describe, expect, test, vi } from "vitest"
22
import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
33
import { flushPromises } from "@vue/test-utils"
4-
5-
import { createVuetify } from "vuetify"
64
import * as components from "vuetify/components"
7-
import * as directives from "vuetify/directives"
85

96
import { setActivePinia } from "pinia"
107
import { createTestingPinia } from "@pinia/testing"
@@ -14,15 +11,11 @@ import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
1411
import FileSelector from "@ogw_front/components/FileSelector"
1512
import FileUploader from "@ogw_front/components/FileUploader"
1613
import { useGeodeStore } from "@ogw_front/stores/geode"
14+
import { vuetify } from "../../utils"
1715

1816
const allowed_files_schema = schemas.opengeodeweb_back.allowed_files
1917
const upload_file_schema = schemas.opengeodeweb_back.upload_file
2018

21-
const vuetify = createVuetify({
22-
components,
23-
directives,
24-
})
25-
2619
describe("FileSelector", async () => {
2720
const pinia = createTestingPinia({
2821
stubActions: false,

tests/unit/components/FileUploader.nuxt.test.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import { describe, expect, test, vi } from "vitest"
22
import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
33
import { flushPromises } from "@vue/test-utils"
4-
5-
import { createVuetify } from "vuetify"
64
import * as components from "vuetify/components"
7-
import * as directives from "vuetify/directives"
85
import { setActivePinia } from "pinia"
96
import { createTestingPinia } from "@pinia/testing"
107

@@ -13,12 +10,9 @@ import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
1310
import FileUploader from "@ogw_front/components/FileUploader"
1411
import { useGeodeStore } from "@ogw_front/stores/geode"
1512

16-
const upload_file_schema = schemas.opengeodeweb_back.upload_file
13+
import { vuetify } from "../../utils"
1714

18-
const vuetify = createVuetify({
19-
components,
20-
directives,
21-
})
15+
const upload_file_schema = schemas.opengeodeweb_back.upload_file
2216

2317
describe("FileUploader", async () => {
2418
const pinia = createTestingPinia({

tests/unit/components/Inspector/InspectionButton.nuxt.test.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
import { describe, expect, test, vi } from "vitest"
2-
import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
2+
import { mountSuspended } from "@nuxt/test-utils/runtime"
33
import { flushPromises } from "@vue/test-utils"
4-
5-
import { createVuetify } from "vuetify"
64
import * as components from "vuetify/components"
7-
import * as directives from "vuetify/directives"
85
import { setActivePinia } from "pinia"
96
import { createTestingPinia } from "@pinia/testing"
107

118
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
129
import InspectorInspectionButton from "@ogw_front/components/Inspector/InspectionButton"
1310
import { useGeodeStore } from "@ogw_front/stores/geode"
14-
const schema = schemas.opengeodeweb_back.inspect_file
11+
import { vuetify } from "../../../utils"
1512

16-
const vuetify = createVuetify({
17-
components,
18-
directives,
19-
})
13+
const schema = schemas.opengeodeweb_back.inspect_file
2014

2115
describe("Inspector/InspectionButton", async () => {
2216
const pinia = createTestingPinia({

tests/unit/components/Inspector/ResultPanel.nuxt.test.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
import { describe, expect, test } from "vitest"
22
import { mountSuspended } from "@nuxt/test-utils/runtime"
33

4-
import { createVuetify } from "vuetify"
5-
import * as components from "vuetify/components"
6-
import * as directives from "vuetify/directives"
7-
84
import InspectorResultPanel from "@ogw_front/components/Inspector/ResultPanel"
9-
10-
const vuetify = createVuetify({
11-
components,
12-
directives,
13-
})
5+
import { vuetify } from "../../../utils"
146

157
describe("Inspector/ResultPanel", async () => {
168
test(`Test with issues`, async () => {

tests/unit/components/Launcher.nuxt.test.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
import { describe, expect, test, vi } from "vitest"
22
import { flushPromises } from "@vue/test-utils"
33
import { mountSuspended } from "@nuxt/test-utils/runtime"
4-
5-
import { createVuetify } from "vuetify"
6-
import * as components from "vuetify/components"
7-
import * as directives from "vuetify/directives"
8-
94
import { setActivePinia } from "pinia"
105
import { createTestingPinia } from "@pinia/testing"
116

127
import Launcher from "@ogw_front/components/Launcher"
138

149
import { useInfraStore } from "@ogw_front/stores/infra"
15-
16-
const vuetify = createVuetify({
17-
components,
18-
directives,
19-
})
10+
import { vuetify } from "../../utils"
2011

2112
// Mock navigator.locks API
2213
const mockLockRequest = vi.fn().mockImplementation(async (name, callback) => {

tests/unit/components/MissingFilesSelector.nuxt.test.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import { describe, expect, test, vi } from "vitest"
22
import { registerEndpoint, mountSuspended } from "@nuxt/test-utils/runtime"
33
import { flushPromises } from "@vue/test-utils"
4-
5-
import { createVuetify } from "vuetify"
64
import * as components from "vuetify/components"
7-
import * as directives from "vuetify/directives"
85
import { setActivePinia } from "pinia"
96
import { createTestingPinia } from "@pinia/testing"
107

@@ -14,14 +11,11 @@ import MissingFilesSelector from "@ogw_front/components/MissingFilesSelector"
1411
import FileUploader from "@ogw_front/components/FileUploader"
1512
import { useGeodeStore } from "@ogw_front/stores/geode"
1613

14+
import { vuetify } from "../../utils"
15+
1716
const missing_files_schema = schemas.opengeodeweb_back.missing_files
1817
const upload_file_schema = schemas.opengeodeweb_back.upload_file
1918

20-
const vuetify = createVuetify({
21-
components,
22-
directives,
23-
})
24-
2519
describe("MissingFilesSelector", async () => {
2620
const pinia = createTestingPinia({
2721
stubActions: false,

0 commit comments

Comments
 (0)