Browse Source

fix: 按照comment修改

es6
windy 5 years ago
parent
commit
4ba4f4f7c3
  1. 5
      test/utils.js
  2. 2
      test/widget/button.test.js
  3. 4
      test/widget/text.test.js

5
test/utils.js

@ -2,8 +2,9 @@
BI.Test = {}; BI.Test = {};
_.extend(BI.Test, { _.extend(BI.Test, {
createWidget: function (widgetJson) { createWidget: function (widgetJson) {
var widget = BI.createWidget(widgetJson); var widget = BI.createWidget(BI.extend(widgetJson, {
widget._isRoot = true; root: true
}));
widget._mount(); widget._mount();
widget.element.appendTo("body"); widget.element.appendTo("body");
return widget; return widget;

2
test/widget/button.test.js

@ -16,7 +16,7 @@ describe("ButtonTest", function () {
}); });
BI.nextTick(function () { BI.nextTick(function () {
button.element.click(); 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(); done();
}); });

4
test/widget/text.test.js

@ -11,7 +11,7 @@ describe("TextTest", function () {
type: "bi.text" type: "bi.text"
}); });
text.setText("AAA"); 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" type: "bi.text"
}); });
text.setStyle({"color": "red"}); text.setStyle({"color": "red"});
expect(text.element[0].style.color).to.equal("red"); expect(text.element.getStyle("color")).to.equal("rgb(255, 0, 0)");
}); });
}); });

Loading…
Cancel
Save