@geode/opengeodeweb-front 10.7.0-rc.2 → 10.7.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.oxlintrc.json +3 -1
- package/app/stores/app.js +9 -12
- package/app/stores/geode.js +7 -4
- package/app/stores/viewer.js +5 -3
- package/package.json +1 -1
- package/server/api/app/project_folder_path.post.js +2 -5
- package/server/api/app/run_back.post.js +1 -5
- package/server/api/app/run_viewer.post.js +1 -5
- package/tests/unit/components/ExtensionSelector.nuxt.test.js +1 -1
- package/tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js +2 -2
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +1 -1
- package/tests/unit/components/Inspector/ResultPanel.nuxt.test.js +3 -3
- package/tests/unit/components/Launcher.nuxt.test.js +1 -1
- package/tests/unit/components/MissingFilesSelector.nuxt.test.js +1 -1
- package/tests/unit/components/PackagesVersions.nuxt.test.js +1 -1
- package/tests/unit/components/Step.nuxt.test.js +1 -1
- package/tests/unit/components/Stepper.nuxt.test.js +1 -1
- package/tests/unit/composables/api_fetch.nuxt.test.js +1 -1
- package/tests/unit/stores/feedback.nuxt.test.js +1 -1
- package/tests/unit/stores/geode.nuxt.test.js +2 -2
- package/tests/unit/stores/infra.nuxt.test.js +10 -10
- package/tests/unit/stores/lambda.nuxt.test.js +3 -3
- package/tests/unit/stores/viewer.nuxt.test.js +3 -3
- package/tests/unit/utils/validate_schema.nuxt.test.js +2 -2
package/.oxlintrc.json
CHANGED
|
@@ -119,7 +119,9 @@
|
|
|
119
119
|
"vitest/no-hooks": "off",
|
|
120
120
|
"vitest/no-importing-vitest-globals": "off",
|
|
121
121
|
"max-lines-per-function": "off",
|
|
122
|
-
"max-statements": "off"
|
|
122
|
+
"max-statements": "off",
|
|
123
|
+
"vitest/prefer-to-be-truthy": "off",
|
|
124
|
+
"vitest/prefer-to-be-falsy": "off"
|
|
123
125
|
}
|
|
124
126
|
},
|
|
125
127
|
{
|
package/app/stores/app.js
CHANGED
|
@@ -245,25 +245,22 @@ export const useAppStore = defineStore("app", () => {
|
|
|
245
245
|
|
|
246
246
|
const projectFolderPath = ref("");
|
|
247
247
|
function createProjectFolder() {
|
|
248
|
+
const { PROJECT } = useRuntimeConfig().public;
|
|
248
249
|
const schema = {
|
|
249
250
|
$id: "/api/app/project_folder_path",
|
|
250
251
|
methods: ["POST"],
|
|
251
252
|
type: "object",
|
|
252
|
-
properties: {},
|
|
253
|
-
required: [],
|
|
253
|
+
properties: { PROJECT: { type: "string" } },
|
|
254
|
+
required: ["PROJECT"],
|
|
254
255
|
additionalProperties: true,
|
|
255
256
|
};
|
|
256
|
-
|
|
257
|
-
return request(
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
response_function: (response) => {
|
|
262
|
-
console.log(`[APP] ${response.projectFolderPath} created`);
|
|
263
|
-
projectFolderPath.value = response.projectFolderPath;
|
|
264
|
-
},
|
|
257
|
+
const params = { PROJECT };
|
|
258
|
+
return request(schema, params, {
|
|
259
|
+
response_function: (response) => {
|
|
260
|
+
console.log(`[APP] ${response.projectFolderPath} created`);
|
|
261
|
+
projectFolderPath.value = response.projectFolderPath;
|
|
265
262
|
},
|
|
266
|
-
);
|
|
263
|
+
});
|
|
267
264
|
}
|
|
268
265
|
|
|
269
266
|
return {
|
package/app/stores/geode.js
CHANGED
|
@@ -81,16 +81,19 @@ export const useGeodeStore = defineStore("geode", {
|
|
|
81
81
|
launch(args) {
|
|
82
82
|
console.log("[GEODE] Launching back microservice...", { args });
|
|
83
83
|
const appStore = useAppStore();
|
|
84
|
+
const { COMMAND_BACK, NUXT_ROOT_PATH } = useRuntimeConfig().public;
|
|
84
85
|
const schema = {
|
|
85
86
|
$id: "/api/app/run_back",
|
|
86
87
|
methods: ["POST"],
|
|
87
88
|
type: "object",
|
|
88
|
-
properties: {
|
|
89
|
-
|
|
89
|
+
properties: {
|
|
90
|
+
COMMAND_BACK: { type: "string" },
|
|
91
|
+
NUXT_ROOT_PATH: { type: "string" },
|
|
92
|
+
},
|
|
93
|
+
required: ["COMMAND_BACK", "NUXT_ROOT_PATH"],
|
|
90
94
|
additionalProperties: true,
|
|
91
95
|
};
|
|
92
|
-
|
|
93
|
-
const params = { args };
|
|
96
|
+
const params = { COMMAND_BACK, NUXT_ROOT_PATH, args };
|
|
94
97
|
|
|
95
98
|
console.log("[GEODE] params", params);
|
|
96
99
|
return appStore.request(schema, params, {
|
package/app/stores/viewer.js
CHANGED
|
@@ -132,16 +132,18 @@ export const useViewerStore = defineStore(
|
|
|
132
132
|
function launch(args = ({ projectFolderPath } = {})) {
|
|
133
133
|
console.log("[VIEWER] Launching viewer microservice...", { args });
|
|
134
134
|
const appStore = useAppStore();
|
|
135
|
+
|
|
136
|
+
const { COMMAND_VIEWER, NUXT_ROOT_PATH } = useRuntimeConfig().public;
|
|
135
137
|
const schema = {
|
|
136
138
|
$id: "/api/app/run_viewer",
|
|
137
139
|
methods: ["POST"],
|
|
138
140
|
type: "object",
|
|
139
|
-
properties: {},
|
|
140
|
-
required: [],
|
|
141
|
+
properties: { COMMAND_VIEWER: { type: "string" }, NUXT_ROOT_PATH: { type: "string" } },
|
|
142
|
+
required: ["COMMAND_VIEWER", "NUXT_ROOT_PATH"],
|
|
141
143
|
additionalProperties: true,
|
|
142
144
|
};
|
|
143
145
|
|
|
144
|
-
const params = { args };
|
|
146
|
+
const params = { COMMAND_VIEWER, NUXT_ROOT_PATH, args };
|
|
145
147
|
console.log("[VIEWER] params", params);
|
|
146
148
|
|
|
147
149
|
return appStore.request(schema, params, {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Node imports
|
|
2
2
|
|
|
3
3
|
// Third party imports
|
|
4
|
-
import { createError, defineEventHandler } from "h3";
|
|
4
|
+
import { createError, defineEventHandler, readBody } from "h3";
|
|
5
5
|
|
|
6
6
|
// Local imports
|
|
7
7
|
import {
|
|
@@ -9,12 +9,9 @@ import {
|
|
|
9
9
|
generateProjectFolderPath,
|
|
10
10
|
} from "@geode/opengeodeweb-front/app/utils/local/path.js";
|
|
11
11
|
|
|
12
|
-
import { useRuntimeConfig } from "nitropack/runtime";
|
|
13
|
-
|
|
14
12
|
export default defineEventHandler(async (event) => {
|
|
15
13
|
try {
|
|
16
|
-
const
|
|
17
|
-
const { PROJECT } = config;
|
|
14
|
+
const { PROJECT } = await readBody(event);
|
|
18
15
|
const projectFolderPath = generateProjectFolderPath(PROJECT);
|
|
19
16
|
await createPath(projectFolderPath);
|
|
20
17
|
|
|
@@ -9,13 +9,9 @@ import {
|
|
|
9
9
|
runBack,
|
|
10
10
|
} from "@geode/opengeodeweb-front/app/utils/local/microservices.js";
|
|
11
11
|
|
|
12
|
-
import { useRuntimeConfig } from "nitropack/runtime";
|
|
13
|
-
|
|
14
12
|
export default defineEventHandler(async (event) => {
|
|
15
13
|
try {
|
|
16
|
-
const
|
|
17
|
-
const { COMMAND_BACK, NUXT_ROOT_PATH } = config;
|
|
18
|
-
const { args } = await readBody(event);
|
|
14
|
+
const { COMMAND_BACK, NUXT_ROOT_PATH, args } = await readBody(event);
|
|
19
15
|
const port = await runBack(COMMAND_BACK, NUXT_ROOT_PATH, args);
|
|
20
16
|
await addMicroserviceMetadatas(args.projectFolderPath, {
|
|
21
17
|
type: "back",
|
|
@@ -9,13 +9,9 @@ import {
|
|
|
9
9
|
runViewer,
|
|
10
10
|
} from "@geode/opengeodeweb-front/app/utils/local/microservices.js";
|
|
11
11
|
|
|
12
|
-
import { useRuntimeConfig } from "nitropack/runtime";
|
|
13
|
-
|
|
14
12
|
export default defineEventHandler(async (event) => {
|
|
15
13
|
try {
|
|
16
|
-
const
|
|
17
|
-
const { COMMAND_VIEWER, NUXT_ROOT_PATH } = config;
|
|
18
|
-
const { args } = await readBody(event);
|
|
14
|
+
const { COMMAND_VIEWER, NUXT_ROOT_PATH, args } = await readBody(event);
|
|
19
15
|
const port = await runViewer(COMMAND_VIEWER, NUXT_ROOT_PATH, args);
|
|
20
16
|
await addMicroserviceMetadatas(args.projectFolderPath, {
|
|
21
17
|
type: "viewer",
|
|
@@ -52,7 +52,7 @@ describe(ExtensionSelector, () => {
|
|
|
52
52
|
props: { geode_object_type: "BRep", filenames: ["test.toto"] },
|
|
53
53
|
});
|
|
54
54
|
await nextTick();
|
|
55
|
-
expect(wrapper.exists()).
|
|
55
|
+
expect(wrapper.exists()).toBe(true);
|
|
56
56
|
const v_card = await wrapper.findAllComponents(components.VCard);
|
|
57
57
|
await v_card[SECOND_INDEX].trigger("click");
|
|
58
58
|
expect(wrapper.emitted()).toHaveProperty("update_values");
|
|
@@ -20,7 +20,7 @@ describe(FeedBackErrorBanner, () => {
|
|
|
20
20
|
const reload_spy = vi.spyOn(wrapper.vm, "reload");
|
|
21
21
|
const feedbackStore = useFeedbackStore();
|
|
22
22
|
await feedbackStore.$patch({ server_error: true });
|
|
23
|
-
expect(feedbackStore.server_error).
|
|
23
|
+
expect(feedbackStore.server_error).toBe(true);
|
|
24
24
|
const v_btn = wrapper.findAll(".v-btn");
|
|
25
25
|
await v_btn[0].trigger("click");
|
|
26
26
|
expect(reload_spy).toHaveBeenCalledTimes(CALLED_TIMES);
|
|
@@ -35,6 +35,6 @@ describe(FeedBackErrorBanner, () => {
|
|
|
35
35
|
const feedbackStore = useFeedbackStore();
|
|
36
36
|
const v_btn = wrapper.findAll(".v-btn");
|
|
37
37
|
await v_btn[1].trigger("click");
|
|
38
|
-
expect(feedbackStore.server_error).
|
|
38
|
+
expect(feedbackStore.server_error).toBe(false);
|
|
39
39
|
});
|
|
40
40
|
});
|
|
@@ -53,7 +53,7 @@ describe("Inspector/InspectionButton", () => {
|
|
|
53
53
|
props: { geode_object_type, filename },
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
expect(wrapper.exists()).
|
|
56
|
+
expect(wrapper.exists()).toBe(true);
|
|
57
57
|
const v_btn = await wrapper.findComponent(components.VBtn);
|
|
58
58
|
await v_btn.trigger("click");
|
|
59
59
|
await flushPromises();
|
|
@@ -23,11 +23,11 @@ describe("Inspector/ResultPanel", () => {
|
|
|
23
23
|
props: { inspection_result },
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
expect(wrapper.exists()).
|
|
26
|
+
expect(wrapper.exists()).toBe(true);
|
|
27
27
|
expect(wrapper.componentVM.inspection_result).toStrictEqual(inspection_result);
|
|
28
28
|
|
|
29
29
|
const child_result_panel_wrapper = await wrapper.findComponent(InspectorResultPanel);
|
|
30
|
-
expect(child_result_panel_wrapper.exists()).
|
|
30
|
+
expect(child_result_panel_wrapper.exists()).toBe(true);
|
|
31
31
|
expect(child_result_panel_wrapper.componentVM.inspection_result).toStrictEqual(
|
|
32
32
|
inspection_result[0].children,
|
|
33
33
|
);
|
|
@@ -47,7 +47,7 @@ describe("Inspector/ResultPanel", () => {
|
|
|
47
47
|
props: { inspection_result },
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
expect(wrapper.exists()).
|
|
50
|
+
expect(wrapper.exists()).toBe(true);
|
|
51
51
|
|
|
52
52
|
console.log({ wrapper });
|
|
53
53
|
|
|
@@ -29,7 +29,7 @@ describe(Launcher, () => {
|
|
|
29
29
|
plugins: [vuetify, pinia],
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
|
-
expect(wrapper.exists()).
|
|
32
|
+
expect(wrapper.exists()).toBe(true);
|
|
33
33
|
await infraStore.$patch({ is_captcha_validated: true });
|
|
34
34
|
await flushPromises();
|
|
35
35
|
expect(infraStore.create_backend).toHaveBeenCalled();
|
|
@@ -50,7 +50,7 @@ describe(MissingFilesSelector, () => {
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
const file_uploader = wrapper.findComponent(FileUploader);
|
|
53
|
-
expect(file_uploader.exists()).
|
|
53
|
+
expect(file_uploader.exists()).toBe(true);
|
|
54
54
|
|
|
55
55
|
const v_file_input = file_uploader.find('input[type="file"]');
|
|
56
56
|
const files = [new File(["fake_file"], "fake_file.txt")];
|
|
@@ -68,7 +68,7 @@ describe("Feedback Store", () => {
|
|
|
68
68
|
const feedbackStore = useFeedbackStore();
|
|
69
69
|
feedbackStore.$patch({ server_error: true });
|
|
70
70
|
feedbackStore.delete_server_error();
|
|
71
|
-
expect(feedbackStore.server_error).
|
|
71
|
+
expect(feedbackStore.server_error).toBe(false);
|
|
72
72
|
});
|
|
73
73
|
});
|
|
74
74
|
});
|
|
@@ -107,13 +107,13 @@ describe("geode store", () => {
|
|
|
107
107
|
test("is_busy", () => {
|
|
108
108
|
const geodeStore = useGeodeStore();
|
|
109
109
|
geodeStore.request_counter = EXPECTED_ONE_REQUEST;
|
|
110
|
-
expect(geodeStore.is_busy).
|
|
110
|
+
expect(geodeStore.is_busy).toBe(true);
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
test("not is_busy", () => {
|
|
114
114
|
const geodeStore = useGeodeStore();
|
|
115
115
|
geodeStore.request_counter = EXPECTED_NO_REQUEST;
|
|
116
|
-
expect(geodeStore.is_busy).
|
|
116
|
+
expect(geodeStore.is_busy).toBe(false);
|
|
117
117
|
});
|
|
118
118
|
});
|
|
119
119
|
});
|
|
@@ -65,7 +65,7 @@ describe("Infra Store", () => {
|
|
|
65
65
|
describe("microservices_connected", () => {
|
|
66
66
|
test("test no microservices registered", () => {
|
|
67
67
|
const infraStore = useInfraStore();
|
|
68
|
-
expect(infraStore.microservices_connected).
|
|
68
|
+
expect(infraStore.microservices_connected).toBe(true);
|
|
69
69
|
});
|
|
70
70
|
test("test geode false & viewer false", () => {
|
|
71
71
|
const infraStore = useInfraStore();
|
|
@@ -85,7 +85,7 @@ describe("Infra Store", () => {
|
|
|
85
85
|
|
|
86
86
|
geodeStore.$patch({ status: Status.NOT_CONNECTED });
|
|
87
87
|
viewerStore.$patch({ status: Status.NOT_CONNECTED });
|
|
88
|
-
expect(infraStore.microservices_connected).
|
|
88
|
+
expect(infraStore.microservices_connected).toBe(false);
|
|
89
89
|
});
|
|
90
90
|
test("test geode true & viewer false", () => {
|
|
91
91
|
const infraStore = useInfraStore();
|
|
@@ -105,7 +105,7 @@ describe("Infra Store", () => {
|
|
|
105
105
|
|
|
106
106
|
geodeStore.$patch({ status: Status.CONNECTED });
|
|
107
107
|
viewerStore.$patch({ status: Status.NOT_CONNECTED });
|
|
108
|
-
expect(infraStore.microservices_connected).
|
|
108
|
+
expect(infraStore.microservices_connected).toBe(false);
|
|
109
109
|
});
|
|
110
110
|
test("test geode false & viewer true", () => {
|
|
111
111
|
const infraStore = useInfraStore();
|
|
@@ -125,7 +125,7 @@ describe("Infra Store", () => {
|
|
|
125
125
|
|
|
126
126
|
geodeStore.$patch({ status: Status.NOT_CONNECTED });
|
|
127
127
|
viewerStore.$patch({ status: Status.CONNECTED });
|
|
128
|
-
expect(infraStore.microservices_connected).
|
|
128
|
+
expect(infraStore.microservices_connected).toBe(false);
|
|
129
129
|
});
|
|
130
130
|
test("test geode true & viewer true", () => {
|
|
131
131
|
const infraStore = useInfraStore();
|
|
@@ -145,14 +145,14 @@ describe("Infra Store", () => {
|
|
|
145
145
|
|
|
146
146
|
geodeStore.$patch({ status: Status.CONNECTED });
|
|
147
147
|
viewerStore.$patch({ status: Status.CONNECTED });
|
|
148
|
-
expect(infraStore.microservices_connected).
|
|
148
|
+
expect(infraStore.microservices_connected).toBe(true);
|
|
149
149
|
});
|
|
150
150
|
});
|
|
151
151
|
|
|
152
152
|
describe("microservices_busy", () => {
|
|
153
153
|
test("test no microservices registered", () => {
|
|
154
154
|
const infraStore = useInfraStore();
|
|
155
|
-
expect(infraStore.microservices_busy).
|
|
155
|
+
expect(infraStore.microservices_busy).toBe(false);
|
|
156
156
|
});
|
|
157
157
|
test("test geode false & viewer false", () => {
|
|
158
158
|
const infraStore = useInfraStore();
|
|
@@ -172,7 +172,7 @@ describe("Infra Store", () => {
|
|
|
172
172
|
|
|
173
173
|
geodeStore.$patch({ request_counter: 0 });
|
|
174
174
|
viewerStore.$patch({ request_counter: 0 });
|
|
175
|
-
expect(infraStore.microservices_busy).
|
|
175
|
+
expect(infraStore.microservices_busy).toBe(false);
|
|
176
176
|
});
|
|
177
177
|
test("test geode true & viewer false", () => {
|
|
178
178
|
const infraStore = useInfraStore();
|
|
@@ -192,7 +192,7 @@ describe("Infra Store", () => {
|
|
|
192
192
|
|
|
193
193
|
geodeStore.$patch({ request_counter: 1 });
|
|
194
194
|
viewerStore.$patch({ request_counter: 0 });
|
|
195
|
-
expect(infraStore.microservices_busy).
|
|
195
|
+
expect(infraStore.microservices_busy).toBe(true);
|
|
196
196
|
});
|
|
197
197
|
test("test geode false & viewer true", () => {
|
|
198
198
|
const infraStore = useInfraStore();
|
|
@@ -212,7 +212,7 @@ describe("Infra Store", () => {
|
|
|
212
212
|
|
|
213
213
|
geodeStore.$patch({ request_counter: 0 });
|
|
214
214
|
viewerStore.$patch({ request_counter: 1 });
|
|
215
|
-
expect(infraStore.microservices_busy).
|
|
215
|
+
expect(infraStore.microservices_busy).toBe(true);
|
|
216
216
|
});
|
|
217
217
|
test("test geode true & viewer true", () => {
|
|
218
218
|
const infraStore = useInfraStore();
|
|
@@ -232,7 +232,7 @@ describe("Infra Store", () => {
|
|
|
232
232
|
|
|
233
233
|
geodeStore.$patch({ request_counter: 1 });
|
|
234
234
|
viewerStore.$patch({ request_counter: 1 });
|
|
235
|
-
expect(infraStore.microservices_busy).
|
|
235
|
+
expect(infraStore.microservices_busy).toBe(true);
|
|
236
236
|
});
|
|
237
237
|
});
|
|
238
238
|
});
|
|
@@ -64,7 +64,7 @@ describe("Lambda Store", () => {
|
|
|
64
64
|
describe("is_busy", () => {
|
|
65
65
|
test("test is_busy is always false", () => {
|
|
66
66
|
const lambdaStore = useLambdaStore();
|
|
67
|
-
expect(lambdaStore.is_busy).
|
|
67
|
+
expect(lambdaStore.is_busy).toBe(false);
|
|
68
68
|
});
|
|
69
69
|
});
|
|
70
70
|
});
|
|
@@ -92,7 +92,7 @@ describe("Lambda Store", () => {
|
|
|
92
92
|
|
|
93
93
|
expect(lambdaStore.status).toBe(Status.CONNECTED);
|
|
94
94
|
expect(id).toBe(TEST_ID);
|
|
95
|
-
expect(feedbackStore.server_error).
|
|
95
|
+
expect(feedbackStore.server_error).toBe(false);
|
|
96
96
|
});
|
|
97
97
|
|
|
98
98
|
test("failed launch - error response", async () => {
|
|
@@ -115,7 +115,7 @@ describe("Lambda Store", () => {
|
|
|
115
115
|
await expect(lambdaStore.launch()).rejects.toThrow("Failed to launch lambda backend");
|
|
116
116
|
|
|
117
117
|
expect(lambdaStore.status).toBe(Status.NOT_CONNECTED);
|
|
118
|
-
expect(feedbackStore.server_error).
|
|
118
|
+
expect(feedbackStore.server_error).toBe(true);
|
|
119
119
|
});
|
|
120
120
|
});
|
|
121
121
|
|
|
@@ -129,12 +129,12 @@ describe("Viewer Store", () => {
|
|
|
129
129
|
test("test is_busy", () => {
|
|
130
130
|
const viewerStore = useViewerStore();
|
|
131
131
|
viewerStore.request_counter = 1;
|
|
132
|
-
expect(viewerStore.is_busy).
|
|
132
|
+
expect(viewerStore.is_busy).toBe(true);
|
|
133
133
|
});
|
|
134
134
|
test("test not is_busy", () => {
|
|
135
135
|
const viewerStore = useViewerStore();
|
|
136
136
|
viewerStore.request_counter = 0;
|
|
137
|
-
expect(viewerStore.is_busy).
|
|
137
|
+
expect(viewerStore.is_busy).toBe(false);
|
|
138
138
|
});
|
|
139
139
|
});
|
|
140
140
|
});
|
|
@@ -143,7 +143,7 @@ describe("Viewer Store", () => {
|
|
|
143
143
|
test("test true", async () => {
|
|
144
144
|
const viewerStore = useViewerStore();
|
|
145
145
|
await viewerStore.toggle_picking_mode(true);
|
|
146
|
-
expect(viewerStore.picking_mode).
|
|
146
|
+
expect(viewerStore.picking_mode).toBe(true);
|
|
147
147
|
});
|
|
148
148
|
});
|
|
149
149
|
|
|
@@ -25,14 +25,14 @@ describe("validate schema", () => {
|
|
|
25
25
|
test("ajv wrong params", () => {
|
|
26
26
|
const params = {};
|
|
27
27
|
const { valid, error } = validate_schema(schema, params);
|
|
28
|
-
expect(valid).
|
|
28
|
+
expect(valid).toBe(false);
|
|
29
29
|
expect(error).toBe("data must have required property 'var_1'");
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
test("good params", () => {
|
|
33
33
|
const params = { var_1: "test", var_2: VAL_5 };
|
|
34
34
|
const { valid, error } = validate_schema(schema, params);
|
|
35
|
-
expect(valid).
|
|
35
|
+
expect(valid).toBe(true);
|
|
36
36
|
expect(error).toBe("No errors");
|
|
37
37
|
});
|
|
38
38
|
});
|