From c7afb99a4ea26fe6c49b82f4dc718e069707a688 Mon Sep 17 00:00:00 2001
From: windy <1374721899@qq.com>
Date: Tue, 10 Dec 2019 13:54:11 +0800
Subject: [PATCH 1/3] =?UTF-8?q?BI-52072=20test:=20=E9=92=A9=E5=AD=90?=
=?UTF-8?q?=E5=92=8C=E5=8D=95=E6=B5=8B=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package.json | 8 +++++++-
src/core/platform/web/jquery/__test__/fn.test.js | 12 ++++++++++++
src/widget/dynamicdate/__test__/dynamicdate.test.js | 6 +++---
.../dynamicdatetime/__test__/dynamicdatetime.test.js | 4 ++--
4 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/package.json b/package.json
index f8e2f9636..83f98ca68 100644
--- a/package.json
+++ b/package.json
@@ -40,6 +40,7 @@
"grunt-contrib-watch": "1.0.0",
"grunt-webpack": "3.1.3",
"html-webpack-plugin": "3.2.0",
+ "husky": "^3.1.0",
"karma": "3.1.4",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "2.2.0",
@@ -86,5 +87,10 @@
"finebi"
],
"author": "fanruan",
- "license": "MIT"
+ "license": "MIT",
+ "husky": {
+ "hooks": {
+ "pre-push": "npm run test"
+ }
+ }
}
diff --git a/src/core/platform/web/jquery/__test__/fn.test.js b/src/core/platform/web/jquery/__test__/fn.test.js
index 8a2b475f7..edcbe5b3a 100644
--- a/src/core/platform/web/jquery/__test__/fn.test.js
+++ b/src/core/platform/web/jquery/__test__/fn.test.js
@@ -61,4 +61,16 @@ describe("标红test", function () {
expect(a.element.html()).to.equal("a啊");
a.destroy();
});
+
+ /**
+ * test_author_windy
+ */
+ it("中文拼音", function () {
+ var a = BI.Test.createWidget({
+ type: "bi.layout",
+ });
+ a.element.__textKeywordMarked__("日期", "日期");
+ expect(a.element.html()).to.equal("日期");
+ a.destroy();
+ });
});
\ No newline at end of file
diff --git a/src/widget/dynamicdate/__test__/dynamicdate.test.js b/src/widget/dynamicdate/__test__/dynamicdate.test.js
index 28ff2e9d9..308c09094 100644
--- a/src/widget/dynamicdate/__test__/dynamicdate.test.js
+++ b/src/widget/dynamicdate/__test__/dynamicdate.test.js
@@ -54,7 +54,7 @@ describe("DateCombo", function () {
// 输入8, 检查popup是否收起
BI.Test.triggerKeyDown(dateCombo.element.find(".bi-date-trigger .bi-input"), "8", 56, function () {
BI.nextTick(function () {
- expect(dateCombo.element.find(".bi-date-trigger + .bi-popup-view").css("display")).to.equal("none");
+ expect(dateCombo.element.find(".bi-date-trigger + .bi-popup-view").length).to.equal(0);
// 清空输入, 检查popup是否弹出
BI.Test.triggerKeyDown(dateCombo.element.find(".bi-date-trigger .bi-input"), "", BI.KeyCode.BACKSPACE, function () {
BI.nextTick(function () {
@@ -82,7 +82,7 @@ describe("DateCombo", function () {
dateCombo.element.find(".bi-date-trigger .bi-basic-button").click();
BI.nextTick(function () {
dateCombo.element.find(".bi-calendar:visible .bi-list-item-select :contains(5)").parent().click();
- expect(dateCombo.element.find(".bi-date-trigger + .bi-popup-view").css("display")).to.equal("none");
+ expect(dateCombo.element.find(".bi-date-trigger + .bi-popup-view").length).to.equal(0);
dateCombo.destroy();
done();
})
@@ -105,7 +105,7 @@ describe("DateCombo", function () {
var input = dateCombo.element.find(".bi-date-trigger .bi-input");
BI.Test.triggerKeyDown(input, null, BI.KeyCode.ENTER, function () {
BI.delay(function () {
- expect(dateCombo.element.find(".bi-date-trigger + .bi-popup-view").css("display")).to.equal("none");
+ expect(dateCombo.element.find(".bi-date-trigger + .bi-popup-view").length).to.equal(0);
dateCombo.destroy();
done();
}, 300);
diff --git a/src/widget/dynamicdatetime/__test__/dynamicdatetime.test.js b/src/widget/dynamicdatetime/__test__/dynamicdatetime.test.js
index c6ffded8e..a11918655 100644
--- a/src/widget/dynamicdatetime/__test__/dynamicdatetime.test.js
+++ b/src/widget/dynamicdatetime/__test__/dynamicdatetime.test.js
@@ -63,7 +63,7 @@ describe("DateTimeCombo", function () {
// 输入8, 检查popup是否收起
BI.Test.triggerKeyDown(dateCombo.element.find(".bi-date-time-trigger .bi-input"), "8", 56, function () {
BI.nextTick(function () {
- expect(dateCombo.element.find(".bi-date-time-trigger + .bi-popup-view").css("display")).to.equal("none");
+ expect(dateCombo.element.find(".bi-date-time-trigger + .bi-popup-view").length).to.equal(0);
// 清空输入, 检查popup是否弹出
BI.Test.triggerKeyDown(dateCombo.element.find(".bi-date-time-trigger .bi-input"), "", BI.KeyCode.BACKSPACE, function () {
BI.nextTick(function () {
@@ -115,7 +115,7 @@ describe("DateTimeCombo", function () {
var input = dateCombo.element.find(".bi-date-time-trigger .bi-input");
BI.Test.triggerKeyDown(input, null, BI.KeyCode.ENTER, function () {
BI.delay(function () {
- expect(dateCombo.element.find(".bi-date-time-trigger + .bi-popup-view").css("display")).to.equal("none");
+ expect(dateCombo.element.find(".bi-date-time-trigger + .bi-popup-view").length).to.equal(0);
dateCombo.destroy();
done();
}, 300);
From adcc23c5c255964a0132414bb0b782a3176a2707 Mon Sep 17 00:00:00 2001
From: windy <1374721899@qq.com>
Date: Tue, 17 Dec 2019 16:24:49 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=E4=B8=8B?=
=?UTF-8?q?=E6=8B=89=E6=A0=91=E9=80=89=E5=80=BC=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/base/tree/ztree/asynctree.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/base/tree/ztree/asynctree.js b/src/base/tree/ztree/asynctree.js
index 8ed74b820..7a4ffb112 100644
--- a/src/base/tree/ztree/asynctree.js
+++ b/src/base/tree/ztree/asynctree.js
@@ -115,6 +115,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
var name = this._getNodeValue(treeNode);
// var values = parentValues.concat([name]);
if (treeNode.checked === true) {
+ this._addTreeNode(this.options.paras.selectedValues, parentValues, name, {});
} else {
var tNode = treeNode;
var pNode = this._getTree(this.options.paras.selectedValues, parentValues);
@@ -185,7 +186,7 @@ BI.AsyncTree = BI.inherit(BI.TreeView, {
if (BI.isNull(compare[n])) {
self._addTreeNode(map, parent, n, item);
} else if (BI.isEmpty(compare[n])) {
- self._addTreeNode(map, parent, n, {});
+ self._addTreeNode(map, parent, n, item);
} else {
track(parent.concat([n]), node[n], compare[n]);
}
From b3f995a0c0650ad3c1100e1b35c04a2949c858ef Mon Sep 17 00:00:00 2001
From: windy <1374721899@qq.com>
Date: Tue, 17 Dec 2019 16:26:24 +0800
Subject: [PATCH 3/3] update
---
package.json | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/package.json b/package.json
index 83f98ca68..285b08f85 100644
--- a/package.json
+++ b/package.json
@@ -87,10 +87,5 @@
"finebi"
],
"author": "fanruan",
- "license": "MIT",
- "husky": {
- "hooks": {
- "pre-push": "npm run test"
- }
- }
+ "license": "MIT"
}