").css({
+ BI.isNull($mask) && ($mask = BI.Widget._renderEngine.createElement("
").css({
position: "absolute",
zIndex: BI.zIndex_tip - 2,
top: 0,
@@ -75,7 +77,7 @@ BI.Msg = function () {
right: 0,
bottom: 0,
opacity: 0.5
- }).appendTo("body");
+ }).appendTo("body"));
$pop = BI.Widget._renderEngine.createElement("
").css({
position: "absolute",
zIndex: BI.zIndex_tip - 1,
@@ -85,8 +87,12 @@ BI.Msg = function () {
bottom: 0
}).appendTo("body");
var close = function () {
- messageShow.destroy();
- $mask.remove();
+ messageShows[messageShows.length - 1].destroy();
+ messageShows.pop();
+ if (messageShows.length === 0) {
+ $mask.remove();
+ $mask = null;
+ }
};
var controlItems = [];
if (hasCancel === true) {
@@ -191,7 +197,7 @@ BI.Msg = function () {
]
};
- messageShow = BI.createWidget(conf);
+ messageShows[messageShows.length] = BI.createWidget(conf);
}
};
}();
\ No newline at end of file
diff --git a/src/base/grid/__test__/grid.test.js b/src/base/grid/__test__/grid.test.js
new file mode 100644
index 0000000000..d65c3d24cd
--- /dev/null
+++ b/src/base/grid/__test__/grid.test.js
@@ -0,0 +1,41 @@
+/**
+ * @author windy
+ * @version 2.0
+ * Created by windy on 2020/3/20
+ */
+describe("GridTest", function () {
+
+ /**
+ * test_author_windy
+ */
+ it("grid", function () {
+ var items = [];
+ var rowCount = 1000, columnCount = 100;
+ for (var i = 0; i < rowCount; i++) {
+ items[i] = [];
+ for (var j = 0; j < columnCount; j++) {
+ items[i][j] = {
+ type: "bi.label",
+ text: i + "-" + j
+ };
+ }
+ }
+ var grid = BI.createWidget({
+ type: "bi.grid_view",
+ width: 400,
+ height: 300,
+ estimatedRowSize: 30,
+ estimatedColumnSize: 100,
+ items: items,
+ scrollTop: 100,
+ rowHeightGetter: function () {
+ return 30;
+ },
+ columnWidthGetter: function () {
+ return 100;
+ }
+ });
+ // TODO 性能展示类控件,不知道要测啥,标记一下
+ grid.destroy();
+ });
+});
\ No newline at end of file
diff --git a/src/case/colorchooser/farbtastic/__test__/farbtastic.test.js b/src/case/colorchooser/farbtastic/__test__/farbtastic.test.js
new file mode 100644
index 0000000000..b3703d908c
--- /dev/null
+++ b/src/case/colorchooser/farbtastic/__test__/farbtastic.test.js
@@ -0,0 +1,21 @@
+/**
+ * @author windy
+ * @version 2.0
+ * Created by windy on 2020/3/20
+ */
+describe("FarbtasticTest", function () {
+
+ /**
+ * test_author_windy
+ */
+ it("Farbtastic", function () {
+ var a = BI.Test.createWidget({
+ type: "bi.farbtastic",
+ height: 200,
+ width: 200
+ });
+ a.setValue("#d56c6c");
+ expect(a.getValue()).to.equal("#d56c6c");
+ a.destroy();
+ });
+});
\ No newline at end of file
diff --git a/src/case/pager/__test__/pager.test.js b/src/case/pager/__test__/pager.test.js
index 257e79272e..a0904109e2 100644
--- a/src/case/pager/__test__/pager.test.js
+++ b/src/case/pager/__test__/pager.test.js
@@ -78,4 +78,20 @@ describe("PagerTest", function () {
a.clear();
a.destroy();
});
+
+ /**
+ * test_author_windy
+ */
+ it("detail_Pager", function () {
+ var a = BI.Test.createWidget({
+ type: "bi.detail_pager",
+ pages: 100
+ });
+ a.setAllPages(200);
+ a.populate();
+ a.setValue(200);
+ expect(a.hasPrev(200)).to.equal(true);
+ expect(a.hasNext(200)).to.equal(false);
+ a.destroy();
+ });
});
\ No newline at end of file