Skip to content

Commit 28a92f7

Browse files
authored
Merge pull request galaxyproject#20755 from jmchilton/client_unit_test_output_2
More client unit test clean up.
2 parents e14238e + 3940779 commit 28a92f7

7 files changed

Lines changed: 17 additions & 5 deletions

File tree

client/src/components/DatasetInformation/DatasetError.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { getFakeRegisteredUser } from "@tests/test-data";
22
import { mount } from "@vue/test-utils";
33
import flushPromises from "flush-promises";
44
import { createPinia } from "pinia";
5-
import { getLocalVue } from "tests/jest/helpers";
5+
import { expectConfigurationRequest, getLocalVue } from "tests/jest/helpers";
66

77
import { HttpResponse, useServerMock } from "@/api/client/__mocks__";
88
import type { components } from "@/api/schema";
@@ -38,6 +38,7 @@ async function montDatasetError(has_duplicate_inputs = true, has_empty_inputs =
3838
};
3939

4040
server.use(
41+
expectConfigurationRequest(http, {}),
4142
http.get("/api/datasets/{dataset_id}", ({ response }) => {
4243
// We need to use untyped here because this endpoint is not
4344
// described in the OpenAPI spec due to its complexity for now.

client/src/components/DatasetInformation/DatasetInformation.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { createTestingPinia } from "@pinia/testing";
12
import { getLocalVue } from "@tests/jest/helpers";
23
import { mount, type Wrapper } from "@vue/test-utils";
34
import axios from "axios";
@@ -53,11 +54,14 @@ describe("DatasetInformation/DatasetInformation", () => {
5354
axiosMock = new MockAdapter(axios);
5455
axiosMock.onGet(new RegExp(`api/configuration/decode/*`)).reply(200, { decoded_id: 123 });
5556

57+
const pinia = createTestingPinia();
58+
5659
wrapper = mount(DatasetInformation as object, {
5760
propsData: {
5861
dataset: datasetResponse,
5962
},
6063
localVue,
64+
pinia,
6165
});
6266

6367
datasetInfoTable = wrapper.find("#dataset-details");

client/src/components/Form/Elements/FormData/FormData.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const props = withDefaults(
6060
tag?: string;
6161
userDefinedTitle?: string;
6262
workflowRun?: boolean;
63-
extendedCollectionType: ExtendedCollectionType;
63+
extendedCollectionType?: ExtendedCollectionType;
6464
}>(),
6565
{
6666
loading: false,

client/src/components/Form/Elements/FormSelect.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import "@/composables/__mocks__/filter";
2+
13
import { createTestingPinia } from "@pinia/testing";
24
import { mount } from "@vue/test-utils";
35
import { getLocalVue } from "tests/jest/helpers";

client/src/components/Panels/ToolPanel.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ async function initializePanel() {
9292
await toolStore.fetchTools();
9393
await toolStore.initializePanel();
9494
} catch (error) {
95-
console.error(`ToolPanel::initializePanel - ${error}`);
95+
if (process.env.NODE_ENV != "test") {
96+
console.error(`ToolPanel::initializePanel - ${error}`);
97+
}
98+
9699
errorMessage.value = errorMessageAsString(error);
97100
} finally {
98101
panelsFetched.value = true;

client/src/components/Tool/ToolForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ export default {
306306
this.currentVersion = newVersion || this.currentVersion;
307307
this.disabled = true;
308308
this.loading = true;
309-
console.debug("ToolForm - Requesting tool.", this.id);
309+
310310
return getToolFormData(this.id, this.currentVersion, this.job_id, this.history_id)
311311
.then((data) => {
312312
this.currentVersion = data.version;

client/src/utils/simple-error.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export function errorMessageAsString(e: any, defaultMessage = "Request failed.")
1919
}
2020

2121
export function rethrowSimple(e: any): never {
22-
console.debug(e);
22+
if (process.env.NODE_ENV != "test") {
23+
console.debug(e);
24+
}
2325
throw Error(errorMessageAsString(e));
2426
}

0 commit comments

Comments
 (0)