diff --git a/client/src/components/Workflow/Invocations.test.js b/client/src/components/Workflow/Invocations.test.js index a5c0371b43e..35ad7eb1285 100644 --- a/client/src/components/Workflow/Invocations.test.js +++ b/client/src/components/Workflow/Invocations.test.js @@ -8,7 +8,7 @@ import { parseISO, formatDistanceToNow } from "date-fns"; const localVue = getLocalVue(); -describe("Invocations.vue without invocation", () => { +describe("Invocations.vue without invocations", () => { let axiosMock; let wrapper; let propsData; @@ -38,6 +38,38 @@ describe("Invocations.vue without invocation", () => { }); }); +describe("Invocations.vue for a workflow invocations", () => { + let axiosMock; + let wrapper; + let propsData; + + beforeEach(async () => { + axiosMock = new MockAdapter(axios); + axiosMock.onAny().reply(200, [], { total_matches: "0" }); + propsData = { + ownerGrid: false, + storedWorkflowName: "My Workflow", + storedWorkflowId: "abcde145678", + }; + wrapper = mount(Invocations, { + propsData, + localVue, + }); + }); + + afterEach(() => { + axiosMock.restore(); + }); + + it("title should be shown", async () => { + expect(wrapper.find("#invocations-title").text()).toBe("Workflow Invocations for My Workflow"); + }); + + it("no invocations message should be shown when not loading", async () => { + expect(wrapper.find("#no-invocations").exists()).toBe(true); + }); +}); + describe("Invocations.vue with invocation", () => { let wrapper; let propsData; diff --git a/client/src/components/Workflow/Invocations.vue b/client/src/components/Workflow/Invocations.vue index e3d21c0d0d1..5f35603d978 100644 --- a/client/src/components/Workflow/Invocations.vue +++ b/client/src/components/Workflow/Invocations.vue @@ -1,7 +1,7 @@