Browse Source
Merge in VISUAL/fineui from ~GUY/fineui:master to master * commit 'db356a09031bb049829a540748d022b635d63900': 优化一下 优化一下 优化一下 优化一下 生命周期可以通过属性传递操作es6
guy
4 years ago
6 changed files with 113 additions and 65 deletions
@ -0,0 +1,38 @@
|
||||
/** |
||||
* 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(); |
||||
}); |
||||
|
||||
}); |
Loading…
Reference in new issue