You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
798 B
39 lines
798 B
4 years ago
|
/**
|
||
|
* Created by guy on 2018/01/23.
|
||
|
*/
|
||
|
describe("widgetTest", function () {
|
||
|
|
||
|
before(function () {
|
||
|
});
|
||
|
|
||
|
/**
|
||
|
* test_author_guy
|
||
|
*/
|
||
|
it("widget生命周期测试", function () {
|
||
|
|
||
|
var Demo = BI.inherit(BI.Widget, {
|
||
|
render: function () {
|
||
|
return {
|
||
|
type: "bi.label",
|
||
|
text: "old"
|
||
|
};
|
||
|
}
|
||
|
});
|
||
|
BI.shortcut("demo.demo", Demo);
|
||
|
|
||
|
var demo = BI.Test.createWidget({
|
||
|
type: "demo.demo",
|
||
|
render: function () {
|
||
|
return {
|
||
|
type: "bi.label",
|
||
|
text: "new"
|
||
|
};
|
||
|
}
|
||
|
});
|
||
|
|
||
|
expect(demo.element.text()).to.equal("new");
|
||
|
demo.destroy();
|
||
|
});
|
||
|
|
||
|
});
|