Skip to content

Commit 748a17d

Browse files
MaxNumeriquegithub-actions[bot]
authored andcommitted
Apply prepare changes
1 parent 20b1ed1 commit 748a17d

3 files changed

Lines changed: 109 additions & 67 deletions

File tree

.oxlintrc.json

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,27 @@
2121
"oxc/no-async-await": "off",
2222
"oxc/no-rest-spread-properties": "off", // Enable if older browser support is needed
2323
"eslint/max-statements": ["warn", 20],
24-
"eslint/id-length": ["error", { "exceptions": ["x", "y", "z", "i", "j", "k", "r", "g", "b", "id", "ID", "fs", "os"], "min": 3 }],
24+
"eslint/id-length": [
25+
"error",
26+
{
27+
"exceptions": [
28+
"x",
29+
"y",
30+
"z",
31+
"i",
32+
"j",
33+
"k",
34+
"r",
35+
"g",
36+
"b",
37+
"id",
38+
"ID",
39+
"fs",
40+
"os"
41+
],
42+
"min": 3
43+
}
44+
],
2545
"eslint/no-console": "warn", // Disable for debugging. Disable later to not have browser logs
2646
"sort-imports": ["error", { "allowSeparatedGroups": true }],
2747
"eslint/no-undefined": "off", // Conflict with unicorn/no-typeof-undefined which prefers direct undefined comparison
@@ -32,7 +52,6 @@
3252
"oxc/no-optional-chaining": "off",
3353
"node/no-process-env": "off",
3454
"no-continue": "off",
35-
"import/no-nodejs-modules": "off",
3655
"import/unambiguous": "off",
3756
"max-params": ["warn", { "max": 4 }],
3857
"eslint/no-magic-numbers": [
@@ -41,7 +60,7 @@
4160
"ignore": [-1, 0, 1, 2, 3, 4],
4261
"ignoreArrayIndexes": true
4362
}
44-
],
63+
]
4564
},
4665
"overrides": [
4766
{
@@ -52,15 +71,16 @@
5271
{
5372
"case": "pascalCase"
5473
}
55-
],
74+
]
5675
}
5776
},
5877
{
5978
"files": [
6079
"app/plugins/**",
6180
"node_scripts/**",
6281
"server/**",
63-
"*.config.js", ],
82+
"*.config.js"
83+
],
6484
"rules": {
6585
"import/no-default-export": "off"
6686
}
@@ -69,9 +89,7 @@
6989
"files": ["tests/**"],
7090
"rules": {
7191
"vitest/require-hook": "off",
72-
"vitest/no-hooks": "off",
73-
"vitest/no-importing-vitest-globals": "off",
74-
"import/no-relative-parent-imports": "warn",
92+
"vitest/no-hooks": "off"
7593
}
7694
},
7795
{

tests/unit/composables/project_manager.nuxt.test.js

Lines changed: 63 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -135,51 +135,71 @@ const hybridViewerStoreMock = {
135135

136136
// MOCKS
137137
vi.stubGlobal("$fetch", vi.fn().mockResolvedValue({ snapshot: snapshotMock }))
138-
vi.mock(import("../../../internal/utils/viewer_call", () => ({
139-
viewer_call: viewer_call_mock_fn,
140-
})))
138+
vi.mock(
139+
import("../../../internal/utils/viewer_call", () => ({
140+
viewer_call: viewer_call_mock_fn,
141+
})),
142+
)
141143

142-
vi.mock(import("@ogw_front/composables/api_fetch", () => ({
143-
api_fetch: vi.fn(async (_req, options = {}) => {
144-
const response = {
145-
_data: new Blob(["zipcontent"], { type: "application/zip" }),
146-
headers: {
147-
get: (k) => (k === "new-file-name" ? "project_123.vease" : undefined),
148-
},
149-
}
150-
if (options.response_function) {
151-
await options.response_function(response)
152-
}
153-
return response
154-
}),
155-
})))
144+
vi.mock(
145+
import("@ogw_front/composables/api_fetch", () => ({
146+
api_fetch: vi.fn(async (_req, options = {}) => {
147+
const response = {
148+
_data: new Blob(["zipcontent"], { type: "application/zip" }),
149+
headers: {
150+
get: (k) => (k === "new-file-name" ? "project_123.vease" : undefined),
151+
},
152+
}
153+
if (options.response_function) {
154+
await options.response_function(response)
155+
}
156+
return response
157+
}),
158+
})),
159+
)
156160
vi.mock(import("js-file-download", () => ({ default: vi.fn() })))
157-
vi.mock(import("@ogw_front/stores/infra", () => ({
158-
useInfraStore: () => infraStoreMock,
159-
})))
160-
vi.mock(import("@ogw_front/stores/viewer", () => ({
161-
useViewerStore: () => viewerStoreMock,
162-
})))
163-
vi.mock(import("@ogw_front/stores/treeview", () => ({
164-
useTreeviewStore: () => treeviewStoreMock,
165-
})))
166-
vi.mock(import("@ogw_front/stores/data", () => ({
167-
useDataStore: () => dataStoreMock,
168-
})))
169-
vi.mock(import("@ogw_front/stores/data_style", () => ({
170-
useDataStyleStore: () => dataStyleStoreMock,
171-
})))
172-
vi.mock(import("@ogw_front/stores/hybrid_viewer", () => ({
173-
useHybridViewerStore: () => hybridViewerStoreMock,
174-
})))
175-
vi.mock(import("@ogw_front/stores/geode", () => ({
176-
useGeodeStore: () => geodeStoreMock,
177-
})))
178-
vi.mock(import("@ogw_front/stores/app", () => ({
179-
useAppStore: () => ({
180-
exportStores: vi.fn(() => ({ projectName: "mockedProject" })),
181-
}),
182-
})))
161+
vi.mock(
162+
import("@ogw_front/stores/infra", () => ({
163+
useInfraStore: () => infraStoreMock,
164+
})),
165+
)
166+
vi.mock(
167+
import("@ogw_front/stores/viewer", () => ({
168+
useViewerStore: () => viewerStoreMock,
169+
})),
170+
)
171+
vi.mock(
172+
import("@ogw_front/stores/treeview", () => ({
173+
useTreeviewStore: () => treeviewStoreMock,
174+
})),
175+
)
176+
vi.mock(
177+
import("@ogw_front/stores/data", () => ({
178+
useDataStore: () => dataStoreMock,
179+
})),
180+
)
181+
vi.mock(
182+
import("@ogw_front/stores/data_style", () => ({
183+
useDataStyleStore: () => dataStyleStoreMock,
184+
})),
185+
)
186+
vi.mock(
187+
import("@ogw_front/stores/hybrid_viewer", () => ({
188+
useHybridViewerStore: () => hybridViewerStoreMock,
189+
})),
190+
)
191+
vi.mock(
192+
import("@ogw_front/stores/geode", () => ({
193+
useGeodeStore: () => geodeStoreMock,
194+
})),
195+
)
196+
vi.mock(
197+
import("@ogw_front/stores/app", () => ({
198+
useAppStore: () => ({
199+
exportStores: vi.fn(() => ({ projectName: "mockedProject" })),
200+
}),
201+
})),
202+
)
183203

184204
vi.stubGlobal("useAppStore", () => ({
185205
exportStores: vi.fn(() => ({ projectName: "mockedProject" })),

tests/unit/plugins/project_load.nuxt.test.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,26 @@ const PANEL_WIDTH = 320
1313
const Z_SCALE = 1.5
1414
const STORES_SLICE_START = 1
1515

16-
vi.mock(import("../../../internal/utils/viewer_call", () => ({
17-
viewer_call: vi.fn(async () => {
18-
await Promise.resolve()
19-
}),
20-
})))
21-
vi.mock(import("../../../app/stores/hybrid_viewer", () => ({
22-
useHybridViewerStore: () => ({
23-
$id: "hybridViewer",
24-
initHybridViewer: vi.fn(),
25-
clear: vi.fn(),
26-
addItem: vi.fn(),
27-
setZScaling: vi.fn(),
28-
save: vi.fn(),
29-
load: vi.fn(),
30-
}),
31-
})))
16+
vi.mock(
17+
import("../../../internal/utils/viewer_call", () => ({
18+
viewer_call: vi.fn(async () => {
19+
await Promise.resolve()
20+
}),
21+
})),
22+
)
23+
vi.mock(
24+
import("../../../app/stores/hybrid_viewer", () => ({
25+
useHybridViewerStore: () => ({
26+
$id: "hybridViewer",
27+
initHybridViewer: vi.fn(),
28+
clear: vi.fn(),
29+
addItem: vi.fn(),
30+
setZScaling: vi.fn(),
31+
save: vi.fn(),
32+
load: vi.fn(),
33+
}),
34+
})),
35+
)
3236

3337
beforeEach(() => {
3438
setupActivePinia()

0 commit comments

Comments
 (0)