diff --git a/src/base/list/__test__/listview.test.js b/src/base/list/__test__/listview.test.js new file mode 100644 index 000000000..4be8993c5 --- /dev/null +++ b/src/base/list/__test__/listview.test.js @@ -0,0 +1,48 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2020/3/24 + */ + +// TODO 展示类控件测什么没想好标记一下 +describe("ListView && VirtualList", function () { + + /** + * test_author_windy + */ + it("ListView初始化测试", function () { + var a = BI.Test.createWidget({ + type: "bi.list_view", + el: { + type: "bi.left" + }, + items: BI.map(BI.range(0, 100), function (i, item) { + return BI.extend({}, item, { + type: "bi.label", + width: 200, + height: 200, + text: (i + 1) + }); + }) + }); + a.destroy(); + }); + + + /** + * test_author_windy + */ + it("VirtualList初始化测试", function () { + var a = BI.Test.createWidget({ + type: "bi.virtual_list", + items: BI.map(BI.range(0, 100), function (i, item) { + return BI.extend({}, item, { + type: "bi.label", + height: 30, + text: (i + 1) + "." + item.text + }); + }) + }); + a.destroy(); + }); +}); \ No newline at end of file diff --git a/src/widget/singleslider/__test__/singleslider.test.js b/src/widget/singleslider/__test__/singleslider.test.js new file mode 100644 index 000000000..8a37715e9 --- /dev/null +++ b/src/widget/singleslider/__test__/singleslider.test.js @@ -0,0 +1,71 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2020/3/24 + */ + +describe("SingleSlider", function () { + + /** + * test_author_windy + */ + it("singleSlider", function () { + var widget = BI.Test.createWidget({ + type: "bi.single_slider", + digit: 0, + width: 300, + height: 50 + }); + widget.setMinAndMax({ + min: 10, + max: 120 + }); + widget.setValue(30); + widget.populate(); + expect(widget.element.find(".blue-track").width() > 0).to.equal(true); + widget.destroy(); + }); + + /** + * test_author_windy + */ + it("singleSlidernormal", function () { + var widget = BI.Test.createWidget({ + type: "bi.single_slider_normal", + digit: 0, + width: 300, + height: 50 + }); + widget.setMinAndMax({ + min: 10, + max: 120 + }); + widget.setValue(30); + widget.populate(); + expect(widget.element.find(".blue-track").width() > 0).to.equal(true); + widget.destroy(); + }); + + + /** + * test_author_windy + */ + it("singleSliderlabel", function () { + var widget = BI.Test.createWidget({ + type: "bi.single_slider_label", + width: 300, + height: 50, + digit: 0, + unit: "个", + cls: "layout-bg-white" + }); + widget.setMinAndMax({ + min: 10, + max: 120 + }); + widget.setValue(30); + widget.populate(); + expect(widget.element.find(".blue-track").width() > 0).to.equal(true); + widget.destroy(); + }); +}); \ No newline at end of file