Skip to content

Commit

Permalink
fix function name
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Oct 3, 2024
1 parent 6c42d6f commit 2154292
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const localVue = getLocalVue();
* @param unimportableWorkflow Whether the workflow import should fail
* @returns The wrapper object
*/
async function mountWorkflowRunButton(ownsWorkflow = true, hasReturnBtn = false, unimportableWorkflow = false) {
async function mountWorkflowInvocationHeader(ownsWorkflow = true, hasReturnBtn = false, unimportableWorkflow = false) {
const wrapper = shallowMount(WorkflowInvocationHeader as object, {
propsData: {
invocation: {
Expand Down Expand Up @@ -96,7 +96,7 @@ async function mountWorkflowRunButton(ownsWorkflow = true, hasReturnBtn = false,
describe("WorkflowInvocationHeader renders", () => {
// Included both cases in one test because these are always constant
it("(always) the workflow name in header and run button in actions", async () => {
const { wrapper } = await mountWorkflowRunButton();
const { wrapper } = await mountWorkflowInvocationHeader();

const heading = wrapper.find(SELECTORS.INVOKED_WORKFLOW_HEADING);
expect(heading.text()).toBe(`Invoked Workflow: "${SAMPLE_WORKFLOW.name}"`);
Expand All @@ -107,13 +107,13 @@ describe("WorkflowInvocationHeader renders", () => {
});

it("return to invocations list button if not from panel", async () => {
const { wrapper } = await mountWorkflowRunButton(false, true);
const { wrapper } = await mountWorkflowInvocationHeader(false, true);
const returnButton = wrapper.find(SELECTORS.RETURN_TO_INVOCATIONS_LIST_BUTTON);
expect(returnButton.text()).toBe("Invocations List");
});

it("edit button if user owns the workflow", async () => {
const { wrapper } = await mountWorkflowRunButton();
const { wrapper } = await mountWorkflowInvocationHeader();
const actionsGroup = wrapper.find(SELECTORS.ACTIONS_BUTTON_GROUP);
const editButton = actionsGroup.find(SELECTORS.EDIT_WORKFLOW_BUTTON);
expect(editButton.attributes("to")).toBe(
Expand All @@ -122,7 +122,7 @@ describe("WorkflowInvocationHeader renders", () => {
});

it("import button instead if user does not own the workflow", async () => {
const { wrapper } = await mountWorkflowRunButton(false);
const { wrapper } = await mountWorkflowInvocationHeader(false);
const actionsGroup = wrapper.find(SELECTORS.ACTIONS_BUTTON_GROUP);
const importButton = actionsGroup.find(SELECTORS.IMPORT_WORKFLOW_BUTTON);
expect(importButton.exists()).toBe(true);
Expand All @@ -131,7 +131,7 @@ describe("WorkflowInvocationHeader renders", () => {

describe("Importing a workflow in WorkflowInvocationHeader", () => {
it("should show a confirmation dialog when the import is successful", async () => {
const { wrapper } = await mountWorkflowRunButton(false);
const { wrapper } = await mountWorkflowInvocationHeader(false);
const actionsGroup = wrapper.find(SELECTORS.ACTIONS_BUTTON_GROUP);
const importButton = actionsGroup.find(SELECTORS.IMPORT_WORKFLOW_BUTTON);

Expand All @@ -145,7 +145,7 @@ describe("Importing a workflow in WorkflowInvocationHeader", () => {
});

it("should show an error dialog when the import fails", async () => {
const { wrapper } = await mountWorkflowRunButton(false, false, true);
const { wrapper } = await mountWorkflowInvocationHeader(false, false, true);
const actionsGroup = wrapper.find(SELECTORS.ACTIONS_BUTTON_GROUP);
const importButton = actionsGroup.find(SELECTORS.IMPORT_WORKFLOW_BUTTON);

Expand Down

0 comments on commit 2154292

Please sign in to comment.