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
15 changes: 0 additions & 15 deletions .eslintrc.cjs

This file was deleted.

3 changes: 2 additions & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
"max-statements": "off",
"vitest/prefer-to-be-truthy": "off",
"vitest/prefer-to-be-falsy": "off",
"vitest/require-test-timeout": "warn"
"vitest/require-test-timeout": "warn",
"vitest/prefer-importing-vitest-globals": "off"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions app/components/Inspector/InspectionButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const toggle_loading = useToggle(loading);
async function get_inspection_results() {
toggle_loading();
const params = {
geode_object_type: geode_object_type,
filename: filename,
geode_object_type,
filename,
};
const geodeStore = useGeodeStore();

Expand Down
2 changes: 1 addition & 1 deletion app/components/Viewer/Options/TextureItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ onMounted(() => {
function getTextureCoordinates() {
geodeStore.request(
back_schemas.opengeodeweb_back.texture_coordinates,
{ id: id },
{ id },
{
response_function: (response) => {
texture_coordinates.value = response.texture_coordinates;
Expand Down
28 changes: 0 additions & 28 deletions eslint.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion internal/utils/upload_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{ route, file },
{ request_error_function, response_function, response_error_function } = {},
) {
console.log("[UPLOAD_FILE] Uploading file", { route, file });

Check warning on line 8 in internal/utils/upload_file.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(no-console)

Unexpected console statement.
const feedbackStore = useFeedbackStore();
if (!(file instanceof File)) {
throw new Error("file must be a instance of File");
Expand All @@ -16,7 +16,7 @@

const request_options = {
method: "PUT",
body: body,
body,
};
microservice.start_request();
return await $fetch(route, {
Expand Down
5 changes: 2 additions & 3 deletions nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// Node imports
import path, { dirname } from "node:path";
import { fileURLToPath } from "node:url";
import path from "node:path";

// Local imports
import package_json from "./package.json";

const __dirname = dirname(fileURLToPath(import.meta.url));
const __dirname = import.meta.dirname;

export default defineNuxtConfig({
runtimeConfig: {
Expand Down
8 changes: 0 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,9 @@
"@pinia/testing": "1.0.3",
"@vitejs/plugin-vue": "6.0.4",
"@vue/test-utils": "2.4.6",
"eslint": "9.26.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-nuxt": "4.0.0",
"eslint-plugin-prettier": "5.4.0",
"eslint-plugin-prettier-vue": "5.0.0",
"eslint-plugin-vue": "10.1.0",
"eslint-plugin-vuetify": "2.5.2",
"happy-dom": "20.0.11",
"msw": "2.11.1",
"playwright-core": "1.52.0",
"prettier": "3.3.3",
"resize-observer-polyfill": "1.5.1",
"unplugin-auto-import": "20.0.0",
"vite": "7.3.1",
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/components/FileSelector.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,46 +23,46 @@
const geodeStore = useGeodeStore();
geodeStore.base_url = "";

test(`Select file`, async () => {
registerEndpoint(allowed_files_schema.$id, {
method: allowed_files_schema.methods[FIRST_INDEX],
handler: () => ({
extensions: ["1", "2", "3"],
}),
});
const wrapper = await mountSuspended(FileSelector, {
global: {
plugins: [vuetify, pinia],
},
props: { multiple: false, auto_upload: false },
});

const file_uploader = wrapper.findComponent(FileUploader);

registerEndpoint(upload_file_schema.$id, {
method: upload_file_schema.methods[SECOND_INDEX],
handler: () => ({}),
});

const v_file_input = file_uploader.find('input[type="file"]');
const files = [new File(["fake_file"], "fake_file.txt")];
const auto_upload = false;
Object.defineProperty(v_file_input.element, "files", {
value: files,
writable: true,
});
await v_file_input.trigger("change");
const v_btn = wrapper.findComponent(components.VBtn);
await v_btn.trigger("click");
await flushPromises();
await flushPromises();
expect(wrapper.emitted()).toHaveProperty("update_values");
expect(wrapper.emitted().update_values).toHaveLength(EXPECTED_LENGTH);
expect(wrapper.emitted().update_values[FIRST_INDEX][FIRST_INDEX]).toEqual({
files,
auto_upload,
});
});

Check warning on line 65 in tests/unit/components/FileSelector.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint-plugin-vitest(require-test-timeout)

Test is missing a timeout.

describe(FileSelector, () => {
registerEndpoint(allowed_files_schema.$id, {
Expand All @@ -78,46 +78,46 @@
});

const files = [new File(["fake_file"], "fake_file.txt")];
test("auto_upload true", async () => {
const wrapper = await mountSuspended(FileSelector, {
global: {
plugins: [vuetify, pinia],
},
props: {
multiple: false,
files: files,
files,
auto_upload: true,
},
});

await flushPromises();
expect(wrapper.componentVM.files).toEqual(files);
expect(wrapper.emitted()).toHaveProperty("update_values");
expect(wrapper.emitted().update_values).toHaveLength(EXPECTED_LENGTH);
expect(wrapper.emitted().update_values[FIRST_INDEX][FIRST_INDEX]).toEqual({
files,
auto_upload: false,
});
});

Check warning on line 101 in tests/unit/components/FileSelector.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint-plugin-vitest(require-test-timeout)

Test is missing a timeout.

test("auto_upload false", async () => {
const wrapper = await mountSuspended(FileSelector, {
global: {
plugins: [vuetify, pinia],
},
props: {
multiple: false,
files: files,
files,
auto_upload: false,
},
});

await flushPromises();

const file_uploader = wrapper.findComponent(FileUploader);
expect(wrapper.vm.files).toEqual(files);
const upload_files = vi.spyOn(file_uploader.vm, "upload_files");
expect(upload_files).not.toHaveBeenCalled();
});

Check warning on line 121 in tests/unit/components/FileSelector.nuxt.test.js

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint-plugin-vitest(require-test-timeout)

Test is missing a timeout.
});
});
8 changes: 3 additions & 5 deletions tests/vitest.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { defineConfig } from "vitest/config";
import { defineVitestProject } from "@nuxt/test-utils/config";
import { fileURLToPath } from "node:url";
import path from "node:path";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const __dirname = import.meta.dirname;

const RETRIES = 3;
const DEFAULT_RETRY = 0;
Expand All @@ -22,14 +21,13 @@ export default defineConfig({
},
},
test: {
globals: false,
setupFiles: [path.resolve(__dirname, "./setup_indexeddb.js")],
projects: [
await defineVitestProject({
test: {
name: "unit",
globals: false,
include: ["tests/unit/**/*.test.js"],
globals: true,
environment: "nuxt",
testTimeout: TIMEOUTS.unit,
setupFiles: [path.resolve(__dirname, "./setup_indexeddb.js")],
Expand All @@ -44,8 +42,8 @@ export default defineConfig({
await defineVitestProject({
test: {
name: "integration",
globals: false,
include: ["tests/integration/**/*.test.js"],
globals: true,
environment: "nuxt",
fileParallelism: false,
testTimeout: TIMEOUTS.integration,
Expand Down
Loading