Skip to content

Commit 32c1476

Browse files
fix failing vitests since addition of job stop button
1 parent f6698a2 commit 32c1476

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

client/src/components/JobInformation/JobInformation.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import "@tests/vitest/mockHelpPopovers";
22

3+
import { createTestingPinia } from "@pinia/testing";
34
import { getLocalVue } from "@tests/vitest/helpers";
45
import { mount } from "@vue/test-utils";
56
import flushPromises from "flush-promises";
@@ -61,6 +62,7 @@ describe("JobInformation/JobInformation.vue", () => {
6162
wrapper = mount(JobInformation, {
6263
propsData,
6364
localVue,
65+
pinia: createTestingPinia({ createSpy: vi.fn }),
6466
});
6567
await flushPromises();
6668
jobInfoTable = wrapper.find("#job-information");

client/src/components/WorkflowInvocationState/JobStep.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import { createTestingPinia } from "@pinia/testing";
12
import { mount, shallowMount } from "@vue/test-utils";
23
import flushPromises from "flush-promises";
3-
import { describe, expect, it } from "vitest";
4+
import { describe, expect, it, vi } from "vitest";
45

56
import type { JobBaseModel } from "@/api/jobs";
67
import { statePlaceholders } from "@/composables/useInvocationGraph";
@@ -27,6 +28,7 @@ describe("Job Step", () => {
2728
jobs: TEST_JOBS_JSON,
2829
invocationId: TEST_INVOCATION_ID,
2930
},
31+
pinia: createTestingPinia({ createSpy: vi.fn }),
3032
});
3133
await flushPromises();
3234

@@ -75,6 +77,7 @@ describe("Job Step", () => {
7577
jobs: TEST_JOBS_JSON,
7678
invocationId: TEST_INVOCATION_ID,
7779
},
80+
pinia: createTestingPinia({ createSpy: vi.fn }),
7881
});
7982
await flushPromises();
8083

@@ -124,6 +127,7 @@ describe("Job Step", () => {
124127
jobs: [singleJob],
125128
invocationId: TEST_INVOCATION_ID,
126129
},
130+
pinia: createTestingPinia({ createSpy: vi.fn }),
127131
});
128132
await flushPromises();
129133

client/src/components/WorkflowInvocationState/JobStepJobs.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ import TEST_JOBS_JSON from "./test/json/jobs.json";
1313

1414
import JobStepJobs from "./JobStepJobs.vue";
1515

16+
vi.mock("vue-router/composables", () => ({
17+
useRoute: vi.fn(() => ({})),
18+
}));
19+
1620
const localVue = getLocalVue();
1721

1822
const { server, http } = useServerMock();

0 commit comments

Comments
 (0)