Michael Rawlings 4a73060bc6 Cleanup tests (#1341)
Cleanup tests and add assertions that all deprecated tests log warnings, and all non deprecated tests don't.
2019-05-28 10:54:31 -07:00

24 lines
843 B
JavaScript

var expect = require("chai").expect;
module.exports = function(helpers, done) {
require("marko/jquery").patchComponent(window.$);
try {
var component = helpers.mount(require.resolve("./index"), {});
expect(component.$().attr("class")).to.equal("app-jquery-proxy");
expect(component.$("#foo").html()).to.equal("foo");
expect(component.$("#fooText").html()).to.equal("fooText");
expect(component.$("#foo-text").html()).to.equal("foo-text");
expect(component.$("#ul li").length).to.equal(3);
expect(component.$("button").html()).to.equal("Test Button");
expect(component.$("li", "ul").length).to.equal(3);
component.$(function() {
done();
});
} finally {
delete require("marko/runtime/components/Component").prototype.$;
}
};