mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
test history import warning
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { shallowMount } from "@vue/test-utils";
|
||||
import { getLocalVue } from "tests/jest/helpers";
|
||||
import { mount } from "@vue/test-utils";
|
||||
import { getLocalVue, wait } from "tests/jest/helpers";
|
||||
import HistoryImport from "./HistoryImport.vue";
|
||||
import MockAdapter from "axios-mock-adapter";
|
||||
import axios from "axios";
|
||||
@@ -21,7 +21,7 @@ describe("HistoryImport.vue", () => {
|
||||
beforeEach(async () => {
|
||||
axiosMock = new MockAdapter(axios);
|
||||
axiosMock.onGet(TEST_PLUGINS_URL).reply(200, [{ id: "foo", writable: false }]);
|
||||
wrapper = shallowMount(HistoryImport, {
|
||||
wrapper = mount(HistoryImport, {
|
||||
propsData: {},
|
||||
localVue,
|
||||
});
|
||||
@@ -76,6 +76,23 @@ describe("HistoryImport.vue", () => {
|
||||
expect(wrapper.vm.complete).toBeTruthy();
|
||||
});
|
||||
|
||||
it("warns about shared history imports", async () => {
|
||||
const input = wrapper.find("input[type=url]");
|
||||
await input.setValue("https://usegalaxy.org/u/some_user/h/exported_history");
|
||||
|
||||
await wait(210);
|
||||
|
||||
const alert = wrapper.find(".alert");
|
||||
expect(alert.classes()).toContain("alert-warning");
|
||||
expect(alert.text()).toContain(
|
||||
"It looks like you are trying to import a history by URL from another galaxy instance"
|
||||
);
|
||||
|
||||
// Link to the GTN
|
||||
const link = alert.find("a");
|
||||
expect(link.text()).toContain("GTN");
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
axiosMock.restore();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user