diff --git a/client/src/components/Form/FormElement.test.js b/client/src/components/Form/FormElement.test.js index 16c20981d56..90679aa5ae3 100644 --- a/client/src/components/Form/FormElement.test.js +++ b/client/src/components/Form/FormElement.test.js @@ -3,8 +3,6 @@ import { getLocalVue } from "jest/helpers"; import Vue from "vue"; import FormElement from "./FormElement"; -jest.mock("app"); - const localVue = getLocalVue(); describe("FormElement", () => { diff --git a/client/src/components/Workflow/Editor/Forms/FormTool.test.js b/client/src/components/Workflow/Editor/Forms/FormTool.test.js new file mode 100644 index 00000000000..b4548d74bfe --- /dev/null +++ b/client/src/components/Workflow/Editor/Forms/FormTool.test.js @@ -0,0 +1,67 @@ +import { mount } from "@vue/test-utils"; +import { getLocalVue } from "jest/helpers"; +import FormTool from "./FormTool"; +import MockCurrentUser from "components/providers/MockCurrentUser"; +import MockConfigProvider from "components/providers/MockConfigProvider"; + +const localVue = getLocalVue(); + +describe("FormTool", () => { + let wrapper; + + beforeEach(() => { + wrapper = mount(FormTool, { + propsData: { + id: "input", + datatypes: [], + getNode: () => { + return { + id: "id", + config_form: { + id: "tool_id+1.0", + name: "tool_name", + version: "1.0", + description: "description", + inputs: [], + help: "help_text", + versions: ["1.0", "2.0", "3.0"], + }, + outputs: [], + postJobActions: [], + }; + }, + getManager: () => { + return { + nodes: [], + }; + }, + }, + localVue, + stubs: { + CurrentUser: MockCurrentUser({ id: "fakeuser" }), + ConfigProvider: MockConfigProvider({ id: "fakeconfig" }), + FormElement: { template: "