forked from fanruan/fineui
Browse Source
* commit '5d53c42f268c6c23b83f74fdaa0ff780ca84c8d0': REPORT-29006 fix: 默认值问题 BI-61182 test: 修复改了text空格显示后的报错单测es6
windy
5 years ago
8 changed files with 62 additions and 10 deletions
@ -0,0 +1,49 @@
|
||||
/** |
||||
* @author windy |
||||
* @version 2.0 |
||||
* Created by windy on 2020/4/3 |
||||
*/ |
||||
|
||||
describe("lazy_loader", function () { |
||||
|
||||
/** |
||||
* test_author_windy |
||||
**/ |
||||
it("setValue", function () { |
||||
var items = BI.map(BI.range(0, 100), function (idx, v) { |
||||
return { |
||||
type: "bi.single_select_item", |
||||
text: v, |
||||
value: v |
||||
} |
||||
}); |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.lazy_loader", |
||||
el: { |
||||
layouts: [{ |
||||
type: "bi.left", |
||||
hgap: 5 |
||||
}] |
||||
} |
||||
}); |
||||
widget.populate(items); |
||||
expect(widget.getAllButtons().length).to.equal(100); |
||||
widget.addItems([{ |
||||
type: "bi.single_select_item", |
||||
text: 102, |
||||
value: 102 |
||||
}, { |
||||
type: "bi.single_select_item", |
||||
text: 103, |
||||
value: 103 |
||||
}]); |
||||
expect(widget.getAllLeaves().length).to.equal(102); |
||||
widget.setValue(102); |
||||
expect(widget.getValue()[0]).to.equal(102); |
||||
expect(widget.getSelectedButtons().length).to.equal(1); |
||||
widget.setNotSelectedValue(102); |
||||
expect(widget.getNotSelectedValue()[0]).to.equal(102); |
||||
expect(widget.getNotSelectedButtons().length).to.equal(1); |
||||
widget.destroy(); |
||||
}); |
||||
}); |
Loading…
Reference in new issue