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
4 changes: 3 additions & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@
"vitest/no-hooks": "off",
"vitest/no-importing-vitest-globals": "off",
"max-lines-per-function": "off",
"max-statements": "off"
"max-statements": "off",
"vitest/prefer-to-be-truthy": "off",
"vitest/prefer-to-be-falsy": "off"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/components/ExtensionSelector.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe(ExtensionSelector, () => {
props: { geode_object_type: "BRep", filenames: ["test.toto"] },
});
await nextTick();
expect(wrapper.exists()).toBeTruthy();
expect(wrapper.exists()).toBe(true);
const v_card = await wrapper.findAllComponents(components.VCard);
await v_card[SECOND_INDEX].trigger("click");
expect(wrapper.emitted()).toHaveProperty("update_values");
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/components/FeedBack/ErrorsBanner.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe(FeedBackErrorBanner, () => {
const reload_spy = vi.spyOn(wrapper.vm, "reload");
const feedbackStore = useFeedbackStore();
await feedbackStore.$patch({ server_error: true });
expect(feedbackStore.server_error).toBeTruthy();
expect(feedbackStore.server_error).toBe(true);
const v_btn = wrapper.findAll(".v-btn");
await v_btn[0].trigger("click");
expect(reload_spy).toHaveBeenCalledTimes(CALLED_TIMES);
Expand All @@ -35,6 +35,6 @@ describe(FeedBackErrorBanner, () => {
const feedbackStore = useFeedbackStore();
const v_btn = wrapper.findAll(".v-btn");
await v_btn[1].trigger("click");
expect(feedbackStore.server_error).toBeFalsy();
expect(feedbackStore.server_error).toBe(false);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe("Inspector/InspectionButton", () => {
props: { geode_object_type, filename },
});

expect(wrapper.exists()).toBeTruthy();
expect(wrapper.exists()).toBe(true);
const v_btn = await wrapper.findComponent(components.VBtn);
await v_btn.trigger("click");
await flushPromises();
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/components/Inspector/ResultPanel.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
props: { inspection_result },
});

expect(wrapper.exists()).toBeTruthy();
expect(wrapper.exists()).toBe(true);
expect(wrapper.componentVM.inspection_result).toStrictEqual(inspection_result);

const child_result_panel_wrapper = await wrapper.findComponent(InspectorResultPanel);
expect(child_result_panel_wrapper.exists()).toBeTruthy();
expect(child_result_panel_wrapper.exists()).toBe(true);
expect(child_result_panel_wrapper.componentVM.inspection_result).toStrictEqual(
inspection_result[0].children,
);
Expand All @@ -47,9 +47,9 @@
props: { inspection_result },
});

expect(wrapper.exists()).toBeTruthy();
expect(wrapper.exists()).toBe(true);

console.log({ wrapper });

Check warning on line 52 in tests/unit/components/Inspector/ResultPanel.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(no-console)

Unexpected console statement.

expect(wrapper.componentVM.inspection_result).toStrictEqual(inspection_result);
});
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/components/Launcher.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe(Launcher, () => {
plugins: [vuetify, pinia],
},
});
expect(wrapper.exists()).toBeTruthy();
expect(wrapper.exists()).toBe(true);
await infraStore.$patch({ is_captcha_validated: true });
await flushPromises();
expect(infraStore.create_backend).toHaveBeenCalled();
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/components/MissingFilesSelector.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe(MissingFilesSelector, () => {
});

const file_uploader = wrapper.findComponent(FileUploader);
expect(file_uploader.exists()).toBeTruthy();
expect(file_uploader.exists()).toBe(true);

const v_file_input = file_uploader.find('input[type="file"]');
const files = [new File(["fake_file"], "fake_file.txt")];
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/components/PackagesVersions.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ describe(PackagesVersions, () => {
},
props: { schema },
});
expect(wrapper.exists()).toBeTruthy();
expect(wrapper.exists()).toBe(true);
});
});
2 changes: 1 addition & 1 deletion tests/unit/components/Step.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ describe(Step, () => {
},
props: { step_index: 0 },
});
expect(wrapper.exists()).toBeTruthy();
expect(wrapper.exists()).toBe(true);
});
});
2 changes: 1 addition & 1 deletion tests/unit/components/Stepper.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ describe(Stepper, () => {
provide: { stepper_tree },
},
});
expect(wrapper.exists()).toBeTruthy();
expect(wrapper.exists()).toBe(true);
});
});
2 changes: 1 addition & 1 deletion tests/unit/composables/api_fetch.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ describe("geodeStore.request()", () => {
handler: () => ({ result: "success" }),
});
await geodeStore.request(schema, params, callbacks);
expect(errorCalled).toBeFalsy();
expect(errorCalled).toBe(false);
});
});
2 changes: 1 addition & 1 deletion tests/unit/stores/feedback.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe("Feedback Store", () => {
const feedbackStore = useFeedbackStore();
feedbackStore.$patch({ server_error: true });
feedbackStore.delete_server_error();
expect(feedbackStore.server_error).toBeFalsy();
expect(feedbackStore.server_error).toBe(false);
});
});
});
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/stores/geode.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ describe("geode store", () => {
test("is_busy", () => {
const geodeStore = useGeodeStore();
geodeStore.request_counter = EXPECTED_ONE_REQUEST;
expect(geodeStore.is_busy).toBeTruthy();
expect(geodeStore.is_busy).toBe(true);
});

test("not is_busy", () => {
const geodeStore = useGeodeStore();
geodeStore.request_counter = EXPECTED_NO_REQUEST;
expect(geodeStore.is_busy).toBeFalsy();
expect(geodeStore.is_busy).toBe(false);
});
});
});
Expand Down
20 changes: 10 additions & 10 deletions tests/unit/stores/infra.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe("Infra Store", () => {
describe("microservices_connected", () => {
test("test no microservices registered", () => {
const infraStore = useInfraStore();
expect(infraStore.microservices_connected).toBeTruthy();
expect(infraStore.microservices_connected).toBe(true);
});
test("test geode false & viewer false", () => {
const infraStore = useInfraStore();
Expand All @@ -85,7 +85,7 @@ describe("Infra Store", () => {

geodeStore.$patch({ status: Status.NOT_CONNECTED });
viewerStore.$patch({ status: Status.NOT_CONNECTED });
expect(infraStore.microservices_connected).toBeFalsy();
expect(infraStore.microservices_connected).toBe(false);
});
test("test geode true & viewer false", () => {
const infraStore = useInfraStore();
Expand All @@ -105,7 +105,7 @@ describe("Infra Store", () => {

geodeStore.$patch({ status: Status.CONNECTED });
viewerStore.$patch({ status: Status.NOT_CONNECTED });
expect(infraStore.microservices_connected).toBeFalsy();
expect(infraStore.microservices_connected).toBe(false);
});
test("test geode false & viewer true", () => {
const infraStore = useInfraStore();
Expand All @@ -125,7 +125,7 @@ describe("Infra Store", () => {

geodeStore.$patch({ status: Status.NOT_CONNECTED });
viewerStore.$patch({ status: Status.CONNECTED });
expect(infraStore.microservices_connected).toBeFalsy();
expect(infraStore.microservices_connected).toBe(false);
});
test("test geode true & viewer true", () => {
const infraStore = useInfraStore();
Expand All @@ -145,14 +145,14 @@ describe("Infra Store", () => {

geodeStore.$patch({ status: Status.CONNECTED });
viewerStore.$patch({ status: Status.CONNECTED });
expect(infraStore.microservices_connected).toBeTruthy();
expect(infraStore.microservices_connected).toBe(true);
});
});

describe("microservices_busy", () => {
test("test no microservices registered", () => {
const infraStore = useInfraStore();
expect(infraStore.microservices_busy).toBeFalsy();
expect(infraStore.microservices_busy).toBe(false);
});
test("test geode false & viewer false", () => {
const infraStore = useInfraStore();
Expand All @@ -172,7 +172,7 @@ describe("Infra Store", () => {

geodeStore.$patch({ request_counter: 0 });
viewerStore.$patch({ request_counter: 0 });
expect(infraStore.microservices_busy).toBeFalsy();
expect(infraStore.microservices_busy).toBe(false);
});
test("test geode true & viewer false", () => {
const infraStore = useInfraStore();
Expand All @@ -192,7 +192,7 @@ describe("Infra Store", () => {

geodeStore.$patch({ request_counter: 1 });
viewerStore.$patch({ request_counter: 0 });
expect(infraStore.microservices_busy).toBeTruthy();
expect(infraStore.microservices_busy).toBe(true);
});
test("test geode false & viewer true", () => {
const infraStore = useInfraStore();
Expand All @@ -212,7 +212,7 @@ describe("Infra Store", () => {

geodeStore.$patch({ request_counter: 0 });
viewerStore.$patch({ request_counter: 1 });
expect(infraStore.microservices_busy).toBeTruthy();
expect(infraStore.microservices_busy).toBe(true);
});
test("test geode true & viewer true", () => {
const infraStore = useInfraStore();
Expand All @@ -232,7 +232,7 @@ describe("Infra Store", () => {

geodeStore.$patch({ request_counter: 1 });
viewerStore.$patch({ request_counter: 1 });
expect(infraStore.microservices_busy).toBeTruthy();
expect(infraStore.microservices_busy).toBe(true);
});
});
});
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/stores/lambda.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe("Lambda Store", () => {
describe("is_busy", () => {
test("test is_busy is always false", () => {
const lambdaStore = useLambdaStore();
expect(lambdaStore.is_busy).toBeFalsy();
expect(lambdaStore.is_busy).toBe(false);
});
});
});
Expand Down Expand Up @@ -92,7 +92,7 @@ describe("Lambda Store", () => {

expect(lambdaStore.status).toBe(Status.CONNECTED);
expect(id).toBe(TEST_ID);
expect(feedbackStore.server_error).toBeFalsy();
expect(feedbackStore.server_error).toBe(false);
});

test("failed launch - error response", async () => {
Expand All @@ -115,7 +115,7 @@ describe("Lambda Store", () => {
await expect(lambdaStore.launch()).rejects.toThrow("Failed to launch lambda backend");

expect(lambdaStore.status).toBe(Status.NOT_CONNECTED);
expect(feedbackStore.server_error).toBeTruthy();
expect(feedbackStore.server_error).toBe(true);
});
});

Expand Down
6 changes: 3 additions & 3 deletions tests/unit/stores/viewer.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ describe("Viewer Store", () => {
test("test is_busy", () => {
const viewerStore = useViewerStore();
viewerStore.request_counter = 1;
expect(viewerStore.is_busy).toBeTruthy();
expect(viewerStore.is_busy).toBe(true);
});
test("test not is_busy", () => {
const viewerStore = useViewerStore();
viewerStore.request_counter = 0;
expect(viewerStore.is_busy).toBeFalsy();
expect(viewerStore.is_busy).toBe(false);
});
});
});
Expand All @@ -143,7 +143,7 @@ describe("Viewer Store", () => {
test("test true", async () => {
const viewerStore = useViewerStore();
await viewerStore.toggle_picking_mode(true);
expect(viewerStore.picking_mode).toBeTruthy();
expect(viewerStore.picking_mode).toBe(true);
});
});

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/utils/validate_schema.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ describe("validate schema", () => {
test("ajv wrong params", () => {
const params = {};
const { valid, error } = validate_schema(schema, params);
expect(valid).toBeFalsy();
expect(valid).toBe(false);
expect(error).toBe("data must have required property 'var_1'");
});

test("good params", () => {
const params = { var_1: "test", var_2: VAL_5 };
const { valid, error } = validate_schema(schema, params);
expect(valid).toBeTruthy();
expect(valid).toBe(true);
expect(error).toBe("No errors");
});
});
Loading