mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Cleanup tests and add assertions that all deprecated tests log warnings, and all non deprecated tests don't.
24 lines
843 B
JavaScript
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.$;
|
|
}
|
|
};
|