diff --git a/test/utils.js b/test/utils.js index a377cb3a3..b5927fa70 100644 --- a/test/utils.js +++ b/test/utils.js @@ -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; diff --git a/test/widget/button.test.js b/test/widget/button.test.js index 34fb15ca6..afc8b7dff 100644 --- a/test/widget/button.test.js +++ b/test/widget/button.test.js @@ -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(); }); diff --git a/test/widget/text.test.js b/test/widget/text.test.js index 1f8e8b49d..f49a17e8d 100644 --- a/test/widget/text.test.js +++ b/test/widget/text.test.js @@ -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 () { type: "bi.text" }); text.setStyle({"color": "red"}); - expect(text.element[0].style.color).to.equal("red"); + expect(text.element.getStyle("color")).to.equal("rgb(255, 0, 0)"); }); });