Browse Source

fix: 按照comment修改

master
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 = {};
_.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;

2
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();
});

4
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)");
});
});

Loading…
Cancel
Save