@ -2,8 +2,9 @@
BI.Test = {};
_.extend(BI.Test, {
createWidget: function (widgetJson) {
var widget = BI.createWidget(widgetJson);
widget._isRoot = true;
var widget = BI.createWidget(BI.extend(widgetJson, {
root: true
}));
widget._mount();
widget.element.appendTo("body");
return widget;
@ -16,7 +16,7 @@ describe("ButtonTest", function () {
});
BI.nextTick(function () {
button.element.click();
expect(button.element[0].querySelector(".bi-text").textContent).to.equal("click");
expect(button.element.children(".bi-text").text()).to.equal("click");
done();
@ -11,7 +11,7 @@ describe("TextTest", function () {
type: "bi.text"
text.setText("AAA");
expect(text.element[0].textContent).to.equal("AAA");
expect(text.element.text()).to.equal("AAA");
/**
@ -22,6 +22,6 @@ describe("TextTest", function () {
text.setStyle({"color": "red"});
expect(text.element[0].style.color).to.equal("red");
expect(text.element.getStyle("color")).to.equal("rgb(255, 0, 0)");