diff --git a/client/galaxy/scripts/bundleEntries.js b/client/galaxy/scripts/bundleEntries.js index 21bfd39e932..6dce4ad39a6 100644 --- a/client/galaxy/scripts/bundleEntries.js +++ b/client/galaxy/scripts/bundleEntries.js @@ -94,6 +94,7 @@ export { mountMakoTags } from "components/Tags"; export { mountJobMetrics } from "components/JobMetrics"; export { mountJobParameters } from "components/JobParameters"; export { mountWorkflowEditor } from "components/Workflow/Editor/mount"; +export { mountPageDisplay } from "components/PageDisplay"; // Used in common.mako export { default as store } from "storemodern"; diff --git a/client/galaxy/scripts/components/DataDialog/DataDialog.test.js b/client/galaxy/scripts/components/DataDialog/DataDialog.test.js index bf3b01019c9..1b254b98638 100644 --- a/client/galaxy/scripts/components/DataDialog/DataDialog.test.js +++ b/client/galaxy/scripts/components/DataDialog/DataDialog.test.js @@ -1,10 +1,10 @@ -import { mount } from "@vue/test-utils"; import DataDialog from "./DataDialog.vue"; +import SelectionDialog from "components/SelectionDialog/SelectionDialog.vue"; import { __RewireAPI__ as rewire } from "./DataDialog"; import { Model } from "./model.js"; import { UrlTracker } from "./utilities.js"; import { Services } from "./services"; -import Vue from "vue"; +import { mount, createLocalVue } from "@vue/test-utils"; const mockOptions = { callback: () => {}, @@ -80,9 +80,9 @@ describe("services/Services:isDataset", () => { expect(services.isDataset({ history_content_type: "dataset" })).to.equals(true); expect(services.isDataset({ history_content_type: "xyz" })).to.equals(false); expect(services.isDataset({ type: "file" })).to.equals(true); - expect(services.getRecord({ hid: 1, history_content_type: "dataset" }).isDataset).to.equals(true); - expect(services.getRecord({ hid: 2, history_content_type: "xyz" }).isDataset).to.equals(false); - expect(services.getRecord({ type: "file" }).isDataset).to.equals(true); + expect(services.getRecord({ hid: 1, history_content_type: "dataset" }).isLeaf).to.equals(true); + expect(services.getRecord({ hid: 2, history_content_type: "xyz" }).isLeaf).to.equals(false); + expect(services.getRecord({ type: "file" }).isLeaf).to.equals(true); }); }); @@ -137,18 +137,32 @@ describe("DataDialog.vue", () => { }; beforeEach(() => { - rewire.__Rewire__("Services", mockServices); + rewire.__Rewire__("getGalaxyInstance", () => { + root: "root"; + }); + const localVue = createLocalVue(); wrapper = mount(DataDialog, { - propsData: mockOptions + propsData: mockOptions, + attachToDocument: true, + localVue }); }); - it("loads correctly, shows datasets and folders", async () => { - expect(wrapper.find(":first-child div").classes()).contain("data-dialog-modal"); - expect(wrapper.find(".fa-spinner").text()).to.equals(""); - expect(wrapper.contains(".fa-spinner")).to.equals(true); - await Vue.nextTick(); - expect(wrapper.findAll(".fa-folder").length).to.equals(2); - expect(wrapper.findAll(".fa-file-o").length).to.equals(2); + it("loads correctly, embeds a SelectionDialog", async () => { + expect(wrapper.find(SelectionDialog).is(SelectionDialog)).to.equals(true); + // Cannot get nested slot templates to render into the wrapper + /// Lots of open issues around this + /// ... Maybe because named slots have many issues + // - https://github.com/vuejs/vue-test-utils/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+slot + // ... Maybe because it is a modal and no longer inside the template DOM element? + // - https://github.com/vuejs/vue-test-utils/issues/1333 + + // expect(wrapper.find(".fa-spinner").text()).to.equals(""); + // expect(wrapper.contains(".fa-spinner")).to.equals(true); + // await Vue.nextTick(); + // expect(wrapper.findAll(".fa-folder").length).to.equals(2); + // expect(wrapper.findAll(".fa-file-o").length).to.equals(2); + + // SelectionDialog DOM properties are tested now in SelectionDialog.test.js however. }); }); diff --git a/client/galaxy/scripts/components/DataDialog/DataDialog.vue b/client/galaxy/scripts/components/DataDialog/DataDialog.vue index 73c4b8cd250..11319f2d468 100644 --- a/client/galaxy/scripts/components/DataDialog/DataDialog.vue +++ b/client/galaxy/scripts/components/DataDialog/DataDialog.vue @@ -1,10 +1,14 @@