mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Replace qunit backbone tests with jest
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { mount } from "@vue/test-utils";
|
||||
import { getLocalVue } from "jest/helpers";
|
||||
import FormHidden from "./FormHidden";
|
||||
|
||||
const localVue = getLocalVue();
|
||||
|
||||
describe("FormHidden", () => {
|
||||
let wrapper;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = mount(FormHidden, {
|
||||
propsData: {
|
||||
value: false,
|
||||
info: "info",
|
||||
},
|
||||
localVue,
|
||||
});
|
||||
});
|
||||
|
||||
it("check initial value and value change", async () => {
|
||||
expect(wrapper.vm.value).toBe(false);
|
||||
await wrapper.setProps({ value: true });
|
||||
expect(wrapper.vm.value).toBe(true);
|
||||
expect(wrapper.text()).toBe("info");
|
||||
});
|
||||
});
|
||||
@@ -713,18 +713,6 @@ QUnit.test("message", function (assert) {
|
||||
assert.ok(message.$el.html() === "_new_message", "Correct new message.");
|
||||
});
|
||||
|
||||
QUnit.test("hidden", function (assert) {
|
||||
var hidden = new Ui.Hidden();
|
||||
$("body").prepend(hidden.$el);
|
||||
hidden.model.set("info", "_info");
|
||||
assert.ok(hidden.$info.css("display", "block"), "Info shown.");
|
||||
assert.ok(hidden.$info.html() === "_info", "Info text correct.");
|
||||
hidden.model.set("info", "");
|
||||
assert.ok(hidden.$info.css("display", "none"), "Info hidden.");
|
||||
hidden.model.set("value", "_value");
|
||||
assert.ok(hidden.$hidden.val() === "_value", "Correct value");
|
||||
});
|
||||
|
||||
QUnit.test("select-content", function (assert) {
|
||||
var select = new SelectContent.View({});
|
||||
$("body").prepend(select.$el);
|
||||
|
||||
Reference in New Issue
Block a user