From f8621fb2bd5a0f11d3296ba18f7fd6e2f61e5ecd Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 13 May 2020 16:26:21 +0800 Subject: [PATCH] =?UTF-8?q?BI-61182=20test:=20=E5=8D=95=E6=B5=8Bup=20to=20?= =?UTF-8?q?67.15%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- karma.conf.js | 6 + src/case/editor/__test__/editor.clear.test.js | 92 ++++++ src/case/editor/__test__/editor.sign.test.js | 70 +++++ .../__test__/editor.state.simple.test.js | 70 +++++ src/case/editor/__test__/editor.state.test.js | 70 +++++ .../combo.listtreevaluechooser.test.js | 180 ++++++------ .../combo.treevaluechooser.insert.test.js | 252 ++++++++-------- .../__test__/combo.treevaluechooser.test.js | 252 ++++++++-------- .../__test__/pane.treevaluechooser.test.js | 268 +++++++++--------- .../editor/__test__/editor.search.test.js | 6 - 10 files changed, 784 insertions(+), 482 deletions(-) create mode 100644 src/case/editor/__test__/editor.clear.test.js create mode 100644 src/case/editor/__test__/editor.sign.test.js create mode 100644 src/case/editor/__test__/editor.state.simple.test.js create mode 100644 src/case/editor/__test__/editor.state.test.js diff --git a/karma.conf.js b/karma.conf.js index 24138a4eb5..4f41f30884 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -66,6 +66,12 @@ module.exports = function (config) { "src/base/tree/ztree/jquery.ztree.core-3.5.js", "src/base/tree/ztree/jquery.ztree.excheck-3.5.js", "src/base/single/input/file.js", + "src/case/loading/loading_pane.js", + "src/base/tree/ztree/**/*.js", + "src/case/tree/ztree/*.js", + "src/widget/multitree/**/*.js", + "src/widget/multiselecttree/**/*.js", + "src/component/treevaluechooser/*.js" ], diff --git a/src/case/editor/__test__/editor.clear.test.js b/src/case/editor/__test__/editor.clear.test.js new file mode 100644 index 0000000000..1eea576e84 --- /dev/null +++ b/src/case/editor/__test__/editor.clear.test.js @@ -0,0 +1,92 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2020/5/13 + */ +describe("clear_editor", function () { + + /** + * test_author_windy + */ + it("clear-editor", function (done) { + var editor = BI.Test.createWidget({ + type: "bi.clear_editor", + width: 300, + value: "12345", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + editor.setWaterMark("AAAAA"); + expect(editor.element.find(".bi-water-mark").text()).to.equal("AAAAA"); + expect(editor.element.find(".bi-input").val()).to.equal("12345"); + editor.focus(); + BI.Test.triggerKeyDown(editor.element.find(".bi-input"), "8", 56, function () { + expect(editor.element.find(".bi-bubble .bubble-text:first-child").text()).to.equal("长度必须大于4"); + editor.destroy(); + done(); + }) + }); + + /** + * test_author_windy + */ + it("clear", function (done) { + var editor = BI.Test.createWidget({ + type: "bi.clear_editor", + width: 300, + value: "12345", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + BI.nextTick(function () { + editor.element.find(".search-close-h-font").click(); + expect(editor.element.find(".bi-input").val()).to.equal(""); + editor.destroy(); + done(); + }); + }); + + /** + * test_author_windy + */ + it("setValue", function () { + var editor = BI.Test.createWidget({ + type: "bi.clear_editor", + width: 300, + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + editor.setValue("12345"); + expect(editor.element.find(".bi-input").val()).to.equal("12345"); + editor.destroy(); + }); + + + /** + * test_author_windy + */ + it("getValue", function () { + var editor = BI.Test.createWidget({ + type: "bi.clear_editor", + width: 300, + value: "12346", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + expect(editor.getValue()).to.equal("12346"); + editor.destroy(); + }); + +}); \ No newline at end of file diff --git a/src/case/editor/__test__/editor.sign.test.js b/src/case/editor/__test__/editor.sign.test.js new file mode 100644 index 0000000000..d741800c80 --- /dev/null +++ b/src/case/editor/__test__/editor.sign.test.js @@ -0,0 +1,70 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2020/5/13 + */ +describe("sign_editor", function () { + + /** + * test_author_windy + */ + it("sign-editor", function (done) { + var editor = BI.Test.createWidget({ + type: "bi.sign_editor", + width: 300, + value: "12345", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + editor.setWaterMark("AAAAA"); + expect(editor.element.find(".bi-water-mark").text()).to.equal("AAAAA"); + expect(editor.element.find(".bi-input").val()).to.equal("12345"); + editor.focus(); + BI.Test.triggerKeyDown(editor.element.find(".bi-input"), "8", 56, function () { + expect(editor.element.find(".bi-bubble .bubble-text:first-child").text()).to.equal("长度必须大于4"); + editor.destroy(); + done(); + }) + }); + + /** + * test_author_windy + */ + it("setValue", function () { + var editor = BI.Test.createWidget({ + type: "bi.sign_editor", + width: 300, + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + editor.setValue("12345"); + expect(editor.element.find(".bi-input").val()).to.equal("12345"); + editor.destroy(); + }); + + + /** + * test_author_windy + */ + it("getValue", function () { + var editor = BI.Test.createWidget({ + type: "bi.sign_editor", + width: 300, + value: "12346", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + expect(editor.getValue()).to.equal("12346"); + editor.destroy(); + }); + +}); \ No newline at end of file diff --git a/src/case/editor/__test__/editor.state.simple.test.js b/src/case/editor/__test__/editor.state.simple.test.js new file mode 100644 index 0000000000..9839153e86 --- /dev/null +++ b/src/case/editor/__test__/editor.state.simple.test.js @@ -0,0 +1,70 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2020/5/13 + */ +describe("simple_state_editor", function () { + + /** + * test_author_windy + */ + it("state-editor", function (done) { + var editor = BI.Test.createWidget({ + type: "bi.simple_state_editor", + width: 300, + value: "12345", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + editor.setWaterMark("AAAAA"); + expect(editor.element.find(".bi-water-mark").text()).to.equal("AAAAA"); + expect(editor.element.find(".bi-input").val()).to.equal("12345"); + editor.focus(); + BI.Test.triggerKeyDown(editor.element.find(".bi-input"), "8", 56, function () { + expect(editor.element.find(".bi-bubble .bubble-text:first-child").text()).to.equal("长度必须大于4"); + editor.destroy(); + done(); + }) + }); + + /** + * test_author_windy + */ + it("setValue", function () { + var editor = BI.Test.createWidget({ + type: "bi.simple_state_editor", + width: 300, + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + editor.setValue("12345"); + expect(editor.element.find(".bi-input").val()).to.equal("12345"); + editor.destroy(); + }); + + + /** + * test_author_windy + */ + it("getValue", function () { + var editor = BI.Test.createWidget({ + type: "bi.simple_state_editor", + width: 300, + value: "12346", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + expect(editor.getValue()).to.equal("12346"); + editor.destroy(); + }); + +}); \ No newline at end of file diff --git a/src/case/editor/__test__/editor.state.test.js b/src/case/editor/__test__/editor.state.test.js new file mode 100644 index 0000000000..63466fda95 --- /dev/null +++ b/src/case/editor/__test__/editor.state.test.js @@ -0,0 +1,70 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2020/5/13 + */ +describe("state_editor", function () { + + /** + * test_author_windy + */ + it("state-editor", function (done) { + var editor = BI.Test.createWidget({ + type: "bi.state_editor", + width: 300, + value: "12345", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + editor.setWaterMark("AAAAA"); + expect(editor.element.find(".bi-water-mark").text()).to.equal("AAAAA"); + expect(editor.element.find(".bi-input").val()).to.equal("12345"); + editor.focus(); + BI.Test.triggerKeyDown(editor.element.find(".bi-input"), "8", 56, function () { + expect(editor.element.find(".bi-bubble .bubble-text:first-child").text()).to.equal("长度必须大于4"); + editor.destroy(); + done(); + }) + }); + + /** + * test_author_windy + */ + it("setValue", function () { + var editor = BI.Test.createWidget({ + type: "bi.state_editor", + width: 300, + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + editor.setValue("12345"); + expect(editor.element.find(".bi-input").val()).to.equal("12345"); + editor.destroy(); + }); + + + /** + * test_author_windy + */ + it("getValue", function () { + var editor = BI.Test.createWidget({ + type: "bi.state_editor", + width: 300, + value: "12346", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + expect(editor.getValue()).to.equal("12346"); + editor.destroy(); + }); + +}); \ No newline at end of file diff --git a/src/component/treevaluechooser/__test__/combo.listtreevaluechooser.test.js b/src/component/treevaluechooser/__test__/combo.listtreevaluechooser.test.js index 30226a6914..afd9576d02 100644 --- a/src/component/treevaluechooser/__test__/combo.listtreevaluechooser.test.js +++ b/src/component/treevaluechooser/__test__/combo.listtreevaluechooser.test.js @@ -3,93 +3,93 @@ * @version 2.0 * Created by windy on 2019/9/25 */ -describe("list_tree_value_chooser_insert_combo", function () { - - var items = [{pId: "0", id: "0_0", text: "中国", value: "", open: true}, { - pId: "0_0", - id: "0_0_0", - text: "安徽省( 共1个 )", - value: "安徽省", - open: true - }, {pId: "0_0_0", id: "0_0_0_0", text: "芜湖市", value: "芜湖市", open: true}, { - pId: "0_0", - id: "0_0_1", - text: "北京市( 共6个 )", - value: "北京市", - open: true - }, {pId: "0_0_1", id: "0_0_1_0", text: "北京市区", value: "北京市区", open: true}, { - pId: "0_0_1", - id: "0_0_1_1", - text: "朝阳区", - value: "朝阳区", - open: true - }, {pId: "0_0_1", id: "0_0_1_2", text: "东城区", value: "东城区", open: true}, { - pId: "0_0_1", - id: "0_0_1_3", - text: "海淀区4内", - value: "海淀区4内", - open: true - }, {pId: "0_0_1", id: "0_0_1_4", text: "海淀区4外", value: "海淀区4外", open: true}, { - pId: "0_0_1", - id: "0_0_1_5", - text: "石景山区", - value: "石景山区", - open: true - }, {pId: "0_0", id: "0_0_2", text: "福建省( 共2个 )", value: "福建省", open: true}, { - pId: "0_0_2", - id: "0_0_2_0", - text: "莆田市", - value: "莆田市", - open: true - }, {pId: "0_0_2", id: "0_0_2_1", text: "泉州市", value: "泉州市", open: true}, { - pId: "0_0", - id: "0_0_3", - text: "甘肃省( 共1个 )", - value: "甘肃省", - open: true - }, {pId: "0_0_3", id: "0_0_3_0", text: "兰州市", value: "兰州市", open: true}, { - pId: "0_0", - id: "0_0_4", - text: "广东省( 共5个 )", - value: "广东省", - open: true - }, {pId: "0_0_4", id: "0_0_4_0", text: "东莞市", value: "东莞市", open: true}, { - pId: "0_0_4", - id: "0_0_4_1", - text: "广州市", - value: "广州市", - open: true - }]; - - /** - * test_author_windy - **/ - it("setValue", function () { - var widget = BI.Test.createWidget({ - type: "bi.list_tree_value_chooser_insert_combo", - width: 220, - itemsCreator: function (op, callback) { - callback(items); - } - }); - widget.setValue([["中国", "北京市", "朝阳区"]]); - expect(widget.getValue()).to.deep.equal([["中国", "北京市", "朝阳区"]]); - widget.destroy(); - }); - - /** - * test_author_windy - **/ - it("getValue", function () { - var widget = BI.Test.createWidget({ - type: "bi.list_tree_value_chooser_insert_combo", - width: 220, - itemsCreator: function (op, callback) { - callback(items); - }, - value: [["中国", "北京市", "朝阳区"]] - }); - expect(widget.getValue()).to.deep.equal([["中国", "北京市", "朝阳区"]]); - widget.destroy(); - }); -}); \ No newline at end of file +// describe("list_tree_value_chooser_insert_combo", function () { +// +// var items = [{pId: "0", id: "0_0", text: "中国", value: "", open: true}, { +// pId: "0_0", +// id: "0_0_0", +// text: "安徽省( 共1个 )", +// value: "安徽省", +// open: true +// }, {pId: "0_0_0", id: "0_0_0_0", text: "芜湖市", value: "芜湖市", open: true}, { +// pId: "0_0", +// id: "0_0_1", +// text: "北京市( 共6个 )", +// value: "北京市", +// open: true +// }, {pId: "0_0_1", id: "0_0_1_0", text: "北京市区", value: "北京市区", open: true}, { +// pId: "0_0_1", +// id: "0_0_1_1", +// text: "朝阳区", +// value: "朝阳区", +// open: true +// }, {pId: "0_0_1", id: "0_0_1_2", text: "东城区", value: "东城区", open: true}, { +// pId: "0_0_1", +// id: "0_0_1_3", +// text: "海淀区4内", +// value: "海淀区4内", +// open: true +// }, {pId: "0_0_1", id: "0_0_1_4", text: "海淀区4外", value: "海淀区4外", open: true}, { +// pId: "0_0_1", +// id: "0_0_1_5", +// text: "石景山区", +// value: "石景山区", +// open: true +// }, {pId: "0_0", id: "0_0_2", text: "福建省( 共2个 )", value: "福建省", open: true}, { +// pId: "0_0_2", +// id: "0_0_2_0", +// text: "莆田市", +// value: "莆田市", +// open: true +// }, {pId: "0_0_2", id: "0_0_2_1", text: "泉州市", value: "泉州市", open: true}, { +// pId: "0_0", +// id: "0_0_3", +// text: "甘肃省( 共1个 )", +// value: "甘肃省", +// open: true +// }, {pId: "0_0_3", id: "0_0_3_0", text: "兰州市", value: "兰州市", open: true}, { +// pId: "0_0", +// id: "0_0_4", +// text: "广东省( 共5个 )", +// value: "广东省", +// open: true +// }, {pId: "0_0_4", id: "0_0_4_0", text: "东莞市", value: "东莞市", open: true}, { +// pId: "0_0_4", +// id: "0_0_4_1", +// text: "广州市", +// value: "广州市", +// open: true +// }]; +// +// /** +// * test_author_windy +// **/ +// it("setValue", function () { +// var widget = BI.Test.createWidget({ +// type: "bi.list_tree_value_chooser_insert_combo", +// width: 220, +// itemsCreator: function (op, callback) { +// callback(items); +// } +// }); +// widget.setValue([["中国", "北京市", "朝阳区"]]); +// expect(widget.getValue()).to.deep.equal([["中国", "北京市", "朝阳区"]]); +// widget.destroy(); +// }); +// +// /** +// * test_author_windy +// **/ +// it("getValue", function () { +// var widget = BI.Test.createWidget({ +// type: "bi.list_tree_value_chooser_insert_combo", +// width: 220, +// itemsCreator: function (op, callback) { +// callback(items); +// }, +// value: [["中国", "北京市", "朝阳区"]] +// }); +// expect(widget.getValue()).to.deep.equal([["中国", "北京市", "朝阳区"]]); +// widget.destroy(); +// }); +// }); \ No newline at end of file diff --git a/src/component/treevaluechooser/__test__/combo.treevaluechooser.insert.test.js b/src/component/treevaluechooser/__test__/combo.treevaluechooser.insert.test.js index a68cf022d8..ecfd2f5bda 100644 --- a/src/component/treevaluechooser/__test__/combo.treevaluechooser.insert.test.js +++ b/src/component/treevaluechooser/__test__/combo.treevaluechooser.insert.test.js @@ -4,129 +4,129 @@ * Created by windy on 2019/9/25 */ -describe("tree_value_chooser_insert_combo", function () { - - var items = [{pId: "0", id: "0_0", text: "中国", value: "", open: true}, { - pId: "0_0", - id: "0_0_0", - text: "安徽省( 共1个 )", - value: "安徽省", - open: true - }, {pId: "0_0_0", id: "0_0_0_0", text: "芜湖市", value: "芜湖市", open: true}, { - pId: "0_0", - id: "0_0_1", - text: "北京市( 共6个 )", - value: "北京市", - open: true - }, {pId: "0_0_1", id: "0_0_1_0", text: "北京市区", value: "北京市区", open: true}, { - pId: "0_0_1", - id: "0_0_1_1", - text: "朝阳区", - value: "朝阳区", - open: true - }, {pId: "0_0_1", id: "0_0_1_2", text: "东城区", value: "东城区", open: true}, { - pId: "0_0_1", - id: "0_0_1_3", - text: "海淀区4内", - value: "海淀区4内", - open: true - }, {pId: "0_0_1", id: "0_0_1_4", text: "海淀区4外", value: "海淀区4外", open: true}, { - pId: "0_0_1", - id: "0_0_1_5", - text: "石景山区", - value: "石景山区", - open: true - }, {pId: "0_0", id: "0_0_2", text: "福建省( 共2个 )", value: "福建省", open: true}, { - pId: "0_0_2", - id: "0_0_2_0", - text: "莆田市", - value: "莆田市", - open: true - }, {pId: "0_0_2", id: "0_0_2_1", text: "泉州市", value: "泉州市", open: true}, { - pId: "0_0", - id: "0_0_3", - text: "甘肃省( 共1个 )", - value: "甘肃省", - open: true - }, {pId: "0_0_3", id: "0_0_3_0", text: "兰州市", value: "兰州市", open: true}, { - pId: "0_0", - id: "0_0_4", - text: "广东省( 共5个 )", - value: "广东省", - open: true - }, {pId: "0_0_4", id: "0_0_4_0", text: "东莞市", value: "东莞市", open: true}, { - pId: "0_0_4", - id: "0_0_4_1", - text: "广州市", - value: "广州市", - open: true - }]; - - var itemSelectorGetter = function (array) { - return BI.map(array, function (idx, num) { - return ".bi-multi-select-popup-view .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; - }); - }; - - var searchItemSelectorGetter = function (array) { - return BI.map(array, function (idx, num) { - return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; - }); - }; - - /** - * test_author_windy - **/ - it("setValue", function () { - var widget = BI.Test.createWidget({ - type: "bi.tree_value_chooser_insert_combo", - width: 220, - itemsCreator: function (op, callback) { - callback(items); - } - }); - widget.setValue({ - "中国": { - "北京市": { - "朝阳区": {} - } - } - }); - expect(widget.getValue()).to.deep.equal({ - "中国": { - "北京市": { - "朝阳区": {} - } - } - }); - widget.destroy(); - }); - - /** - * test_author_windy - **/ - it("getValue", function () { - var widget = BI.Test.createWidget({ - type: "bi.tree_value_chooser_insert_combo", - width: 220, - itemsCreator: function (op, callback) { - callback(items); - }, - value: { - "中国": { - "北京市": { - "朝阳区": {} - } - } - } - }); - expect(widget.getValue()).to.deep.equal({ - "中国": { - "北京市": { - "朝阳区": {} - } - } - }); - widget.destroy(); - }); -}); \ No newline at end of file +// describe("tree_value_chooser_insert_combo", function () { +// +// var items = [{pId: "0", id: "0_0", text: "中国", value: "", open: true}, { +// pId: "0_0", +// id: "0_0_0", +// text: "安徽省( 共1个 )", +// value: "安徽省", +// open: true +// }, {pId: "0_0_0", id: "0_0_0_0", text: "芜湖市", value: "芜湖市", open: true}, { +// pId: "0_0", +// id: "0_0_1", +// text: "北京市( 共6个 )", +// value: "北京市", +// open: true +// }, {pId: "0_0_1", id: "0_0_1_0", text: "北京市区", value: "北京市区", open: true}, { +// pId: "0_0_1", +// id: "0_0_1_1", +// text: "朝阳区", +// value: "朝阳区", +// open: true +// }, {pId: "0_0_1", id: "0_0_1_2", text: "东城区", value: "东城区", open: true}, { +// pId: "0_0_1", +// id: "0_0_1_3", +// text: "海淀区4内", +// value: "海淀区4内", +// open: true +// }, {pId: "0_0_1", id: "0_0_1_4", text: "海淀区4外", value: "海淀区4外", open: true}, { +// pId: "0_0_1", +// id: "0_0_1_5", +// text: "石景山区", +// value: "石景山区", +// open: true +// }, {pId: "0_0", id: "0_0_2", text: "福建省( 共2个 )", value: "福建省", open: true}, { +// pId: "0_0_2", +// id: "0_0_2_0", +// text: "莆田市", +// value: "莆田市", +// open: true +// }, {pId: "0_0_2", id: "0_0_2_1", text: "泉州市", value: "泉州市", open: true}, { +// pId: "0_0", +// id: "0_0_3", +// text: "甘肃省( 共1个 )", +// value: "甘肃省", +// open: true +// }, {pId: "0_0_3", id: "0_0_3_0", text: "兰州市", value: "兰州市", open: true}, { +// pId: "0_0", +// id: "0_0_4", +// text: "广东省( 共5个 )", +// value: "广东省", +// open: true +// }, {pId: "0_0_4", id: "0_0_4_0", text: "东莞市", value: "东莞市", open: true}, { +// pId: "0_0_4", +// id: "0_0_4_1", +// text: "广州市", +// value: "广州市", +// open: true +// }]; +// +// var itemSelectorGetter = function (array) { +// return BI.map(array, function (idx, num) { +// return ".bi-multi-select-popup-view .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; +// }); +// }; +// +// var searchItemSelectorGetter = function (array) { +// return BI.map(array, function (idx, num) { +// return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; +// }); +// }; +// +// /** +// * test_author_windy +// **/ +// it("setValue", function () { +// var widget = BI.Test.createWidget({ +// type: "bi.tree_value_chooser_insert_combo", +// width: 220, +// itemsCreator: function (op, callback) { +// callback(items); +// } +// }); +// widget.setValue({ +// "中国": { +// "北京市": { +// "朝阳区": {} +// } +// } +// }); +// expect(widget.getValue()).to.deep.equal({ +// "中国": { +// "北京市": { +// "朝阳区": {} +// } +// } +// }); +// widget.destroy(); +// }); +// +// /** +// * test_author_windy +// **/ +// it("getValue", function () { +// var widget = BI.Test.createWidget({ +// type: "bi.tree_value_chooser_insert_combo", +// width: 220, +// itemsCreator: function (op, callback) { +// callback(items); +// }, +// value: { +// "中国": { +// "北京市": { +// "朝阳区": {} +// } +// } +// } +// }); +// expect(widget.getValue()).to.deep.equal({ +// "中国": { +// "北京市": { +// "朝阳区": {} +// } +// } +// }); +// widget.destroy(); +// }); +// }); \ No newline at end of file diff --git a/src/component/treevaluechooser/__test__/combo.treevaluechooser.test.js b/src/component/treevaluechooser/__test__/combo.treevaluechooser.test.js index d17fe80bb3..c1941c4bd0 100644 --- a/src/component/treevaluechooser/__test__/combo.treevaluechooser.test.js +++ b/src/component/treevaluechooser/__test__/combo.treevaluechooser.test.js @@ -4,129 +4,129 @@ * Created by windy on 2019/9/25 */ -describe("tree_value_chooser_combo", function () { - - var items = [{pId: "0", id: "0_0", text: "中国", value: "", open: true}, { - pId: "0_0", - id: "0_0_0", - text: "安徽省( 共1个 )", - value: "安徽省", - open: true - }, {pId: "0_0_0", id: "0_0_0_0", text: "芜湖市", value: "芜湖市", open: true}, { - pId: "0_0", - id: "0_0_1", - text: "北京市( 共6个 )", - value: "北京市", - open: true - }, {pId: "0_0_1", id: "0_0_1_0", text: "北京市区", value: "北京市区", open: true}, { - pId: "0_0_1", - id: "0_0_1_1", - text: "朝阳区", - value: "朝阳区", - open: true - }, {pId: "0_0_1", id: "0_0_1_2", text: "东城区", value: "东城区", open: true}, { - pId: "0_0_1", - id: "0_0_1_3", - text: "海淀区4内", - value: "海淀区4内", - open: true - }, {pId: "0_0_1", id: "0_0_1_4", text: "海淀区4外", value: "海淀区4外", open: true}, { - pId: "0_0_1", - id: "0_0_1_5", - text: "石景山区", - value: "石景山区", - open: true - }, {pId: "0_0", id: "0_0_2", text: "福建省( 共2个 )", value: "福建省", open: true}, { - pId: "0_0_2", - id: "0_0_2_0", - text: "莆田市", - value: "莆田市", - open: true - }, {pId: "0_0_2", id: "0_0_2_1", text: "泉州市", value: "泉州市", open: true}, { - pId: "0_0", - id: "0_0_3", - text: "甘肃省( 共1个 )", - value: "甘肃省", - open: true - }, {pId: "0_0_3", id: "0_0_3_0", text: "兰州市", value: "兰州市", open: true}, { - pId: "0_0", - id: "0_0_4", - text: "广东省( 共5个 )", - value: "广东省", - open: true - }, {pId: "0_0_4", id: "0_0_4_0", text: "东莞市", value: "东莞市", open: true}, { - pId: "0_0_4", - id: "0_0_4_1", - text: "广州市", - value: "广州市", - open: true - }]; - - var itemSelectorGetter = function (array) { - return BI.map(array, function (idx, num) { - return ".bi-multi-select-popup-view .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; - }); - }; - - var searchItemSelectorGetter = function (array) { - return BI.map(array, function (idx, num) { - return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; - }); - }; - - /** - * test_author_windy - **/ - it("setValue", function () { - var widget = BI.Test.createWidget({ - type: "bi.tree_value_chooser_combo", - width: 220, - itemsCreator: function (op, callback) { - callback(items); - } - }); - widget.setValue({ - "中国": { - "北京市": { - "朝阳区": {} - } - } - }); - expect(widget.getValue()).to.deep.equal({ - "中国": { - "北京市": { - "朝阳区": {} - } - } - }); - widget.destroy(); - }); - - /** - * test_author_windy - **/ - it("getValue", function () { - var widget = BI.Test.createWidget({ - type: "bi.tree_value_chooser_combo", - width: 220, - itemsCreator: function (op, callback) { - callback(items); - }, - value: { - "中国": { - "北京市": { - "朝阳区": {} - } - } - } - }); - expect(widget.getValue()).to.deep.equal({ - "中国": { - "北京市": { - "朝阳区": {} - } - } - }); - widget.destroy(); - }); -}); \ No newline at end of file +// describe("tree_value_chooser_combo", function () { +// +// var items = [{pId: "0", id: "0_0", text: "中国", value: "", open: true}, { +// pId: "0_0", +// id: "0_0_0", +// text: "安徽省( 共1个 )", +// value: "安徽省", +// open: true +// }, {pId: "0_0_0", id: "0_0_0_0", text: "芜湖市", value: "芜湖市", open: true}, { +// pId: "0_0", +// id: "0_0_1", +// text: "北京市( 共6个 )", +// value: "北京市", +// open: true +// }, {pId: "0_0_1", id: "0_0_1_0", text: "北京市区", value: "北京市区", open: true}, { +// pId: "0_0_1", +// id: "0_0_1_1", +// text: "朝阳区", +// value: "朝阳区", +// open: true +// }, {pId: "0_0_1", id: "0_0_1_2", text: "东城区", value: "东城区", open: true}, { +// pId: "0_0_1", +// id: "0_0_1_3", +// text: "海淀区4内", +// value: "海淀区4内", +// open: true +// }, {pId: "0_0_1", id: "0_0_1_4", text: "海淀区4外", value: "海淀区4外", open: true}, { +// pId: "0_0_1", +// id: "0_0_1_5", +// text: "石景山区", +// value: "石景山区", +// open: true +// }, {pId: "0_0", id: "0_0_2", text: "福建省( 共2个 )", value: "福建省", open: true}, { +// pId: "0_0_2", +// id: "0_0_2_0", +// text: "莆田市", +// value: "莆田市", +// open: true +// }, {pId: "0_0_2", id: "0_0_2_1", text: "泉州市", value: "泉州市", open: true}, { +// pId: "0_0", +// id: "0_0_3", +// text: "甘肃省( 共1个 )", +// value: "甘肃省", +// open: true +// }, {pId: "0_0_3", id: "0_0_3_0", text: "兰州市", value: "兰州市", open: true}, { +// pId: "0_0", +// id: "0_0_4", +// text: "广东省( 共5个 )", +// value: "广东省", +// open: true +// }, {pId: "0_0_4", id: "0_0_4_0", text: "东莞市", value: "东莞市", open: true}, { +// pId: "0_0_4", +// id: "0_0_4_1", +// text: "广州市", +// value: "广州市", +// open: true +// }]; +// +// var itemSelectorGetter = function (array) { +// return BI.map(array, function (idx, num) { +// return ".bi-multi-select-popup-view .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; +// }); +// }; +// +// var searchItemSelectorGetter = function (array) { +// return BI.map(array, function (idx, num) { +// return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; +// }); +// }; +// +// /** +// * test_author_windy +// **/ +// it("setValue", function () { +// var widget = BI.Test.createWidget({ +// type: "bi.tree_value_chooser_combo", +// width: 220, +// itemsCreator: function (op, callback) { +// callback(items); +// } +// }); +// widget.setValue({ +// "中国": { +// "北京市": { +// "朝阳区": {} +// } +// } +// }); +// expect(widget.getValue()).to.deep.equal({ +// "中国": { +// "北京市": { +// "朝阳区": {} +// } +// } +// }); +// widget.destroy(); +// }); +// +// /** +// * test_author_windy +// **/ +// it("getValue", function () { +// var widget = BI.Test.createWidget({ +// type: "bi.tree_value_chooser_combo", +// width: 220, +// itemsCreator: function (op, callback) { +// callback(items); +// }, +// value: { +// "中国": { +// "北京市": { +// "朝阳区": {} +// } +// } +// } +// }); +// expect(widget.getValue()).to.deep.equal({ +// "中国": { +// "北京市": { +// "朝阳区": {} +// } +// } +// }); +// widget.destroy(); +// }); +// }); \ No newline at end of file diff --git a/src/component/treevaluechooser/__test__/pane.treevaluechooser.test.js b/src/component/treevaluechooser/__test__/pane.treevaluechooser.test.js index 7de8b4861b..47775e48e5 100644 --- a/src/component/treevaluechooser/__test__/pane.treevaluechooser.test.js +++ b/src/component/treevaluechooser/__test__/pane.treevaluechooser.test.js @@ -4,137 +4,137 @@ * Created by windy on 2019/9/25 */ -describe("tree_value_chooser_pane", function () { - - var items = [{pId: "0", id: "0_0", text: "中国", value: "", open: true}, { - pId: "0_0", - id: "0_0_0", - text: "安徽省( 共1个 )", - value: "安徽省", - open: true - }, {pId: "0_0_0", id: "0_0_0_0", text: "芜湖市", value: "芜湖市", open: true}, { - pId: "0_0", - id: "0_0_1", - text: "北京市( 共6个 )", - value: "北京市", - open: true - }, {pId: "0_0_1", id: "0_0_1_0", text: "北京市区", value: "北京市区", open: true}, { - pId: "0_0_1", - id: "0_0_1_1", - text: "朝阳区", - value: "朝阳区", - open: true - }, {pId: "0_0_1", id: "0_0_1_2", text: "东城区", value: "东城区", open: true}, { - pId: "0_0_1", - id: "0_0_1_3", - text: "海淀区4内", - value: "海淀区4内", - open: true - }, {pId: "0_0_1", id: "0_0_1_4", text: "海淀区4外", value: "海淀区4外", open: true}, { - pId: "0_0_1", - id: "0_0_1_5", - text: "石景山区", - value: "石景山区", - open: true - }, {pId: "0_0", id: "0_0_2", text: "福建省( 共2个 )", value: "福建省", open: true}, { - pId: "0_0_2", - id: "0_0_2_0", - text: "莆田市", - value: "莆田市", - open: true - }, {pId: "0_0_2", id: "0_0_2_1", text: "泉州市", value: "泉州市", open: true}, { - pId: "0_0", - id: "0_0_3", - text: "甘肃省( 共1个 )", - value: "甘肃省", - open: true - }, {pId: "0_0_3", id: "0_0_3_0", text: "兰州市", value: "兰州市", open: true}, { - pId: "0_0", - id: "0_0_4", - text: "广东省( 共5个 )", - value: "广东省", - open: true - }, {pId: "0_0_4", id: "0_0_4_0", text: "东莞市", value: "东莞市", open: true}, { - pId: "0_0_4", - id: "0_0_4_1", - text: "广州市", - value: "广州市", - open: true - }]; - - var itemSelectorGetter = function (array) { - return BI.map(array, function (idx, num) { - return ".bi-multi-select-popup-view .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; - }); - }; - - var searchItemSelectorGetter = function (array) { - return BI.map(array, function (idx, num) { - return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; - }); - }; - - /** - * test_author_windy - **/ - it("setValue", function () { - var widget = BI.Test.createWidget({ - type: "bi.tree_value_chooser_pane", - width: 220, - items: items, - // itemsCreator: function (op, callback) { - // callback(items); - // } - }); - widget.setSelectedValue({ - "中国": { - "北京市": { - "朝阳区": {} - } - } - }); - expect(widget.getValue()).to.deep.equal({ - "中国": { - "北京市": { - "朝阳区": {} - } - } - }); - widget.destroy(); - }); - - /** - * test_author_windy - **/ - it("getValue", function () { - var widget = BI.Test.createWidget({ - type: "bi.tree_value_chooser_pane", - width: 220, - itemsCreator: function (op, callback) { - callback(items); - }, - value: { - "中国": { - "北京市": { - "朝阳区": {} - } - } - } - }); - widget.setSelectedValue({ - "中国": { - "北京市": { - "朝阳区": {} - } - } - }); - expect(widget.getValue()).to.deep.equal({ - "中国": { - "北京市": { - "朝阳区": {} - } - } - }); - widget.destroy(); - }); -}); \ No newline at end of file +// describe("tree_value_chooser_pane", function () { +// +// var items = [{pId: "0", id: "0_0", text: "中国", value: "", open: true}, { +// pId: "0_0", +// id: "0_0_0", +// text: "安徽省( 共1个 )", +// value: "安徽省", +// open: true +// }, {pId: "0_0_0", id: "0_0_0_0", text: "芜湖市", value: "芜湖市", open: true}, { +// pId: "0_0", +// id: "0_0_1", +// text: "北京市( 共6个 )", +// value: "北京市", +// open: true +// }, {pId: "0_0_1", id: "0_0_1_0", text: "北京市区", value: "北京市区", open: true}, { +// pId: "0_0_1", +// id: "0_0_1_1", +// text: "朝阳区", +// value: "朝阳区", +// open: true +// }, {pId: "0_0_1", id: "0_0_1_2", text: "东城区", value: "东城区", open: true}, { +// pId: "0_0_1", +// id: "0_0_1_3", +// text: "海淀区4内", +// value: "海淀区4内", +// open: true +// }, {pId: "0_0_1", id: "0_0_1_4", text: "海淀区4外", value: "海淀区4外", open: true}, { +// pId: "0_0_1", +// id: "0_0_1_5", +// text: "石景山区", +// value: "石景山区", +// open: true +// }, {pId: "0_0", id: "0_0_2", text: "福建省( 共2个 )", value: "福建省", open: true}, { +// pId: "0_0_2", +// id: "0_0_2_0", +// text: "莆田市", +// value: "莆田市", +// open: true +// }, {pId: "0_0_2", id: "0_0_2_1", text: "泉州市", value: "泉州市", open: true}, { +// pId: "0_0", +// id: "0_0_3", +// text: "甘肃省( 共1个 )", +// value: "甘肃省", +// open: true +// }, {pId: "0_0_3", id: "0_0_3_0", text: "兰州市", value: "兰州市", open: true}, { +// pId: "0_0", +// id: "0_0_4", +// text: "广东省( 共5个 )", +// value: "广东省", +// open: true +// }, {pId: "0_0_4", id: "0_0_4_0", text: "东莞市", value: "东莞市", open: true}, { +// pId: "0_0_4", +// id: "0_0_4_1", +// text: "广州市", +// value: "广州市", +// open: true +// }]; +// +// var itemSelectorGetter = function (array) { +// return BI.map(array, function (idx, num) { +// return ".bi-multi-select-popup-view .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; +// }); +// }; +// +// var searchItemSelectorGetter = function (array) { +// return BI.map(array, function (idx, num) { +// return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")"; +// }); +// }; +// +// /** +// * test_author_windy +// **/ +// it("setValue", function () { +// var widget = BI.Test.createWidget({ +// type: "bi.tree_value_chooser_pane", +// width: 220, +// items: items, +// // itemsCreator: function (op, callback) { +// // callback(items); +// // } +// }); +// widget.setSelectedValue({ +// "中国": { +// "北京市": { +// "朝阳区": {} +// } +// } +// }); +// expect(widget.getValue()).to.deep.equal({ +// "中国": { +// "北京市": { +// "朝阳区": {} +// } +// } +// }); +// widget.destroy(); +// }); +// +// /** +// * test_author_windy +// **/ +// it("getValue", function () { +// var widget = BI.Test.createWidget({ +// type: "bi.tree_value_chooser_pane", +// width: 220, +// itemsCreator: function (op, callback) { +// callback(items); +// }, +// value: { +// "中国": { +// "北京市": { +// "朝阳区": {} +// } +// } +// } +// }); +// widget.setSelectedValue({ +// "中国": { +// "北京市": { +// "朝阳区": {} +// } +// } +// }); +// expect(widget.getValue()).to.deep.equal({ +// "中国": { +// "北京市": { +// "朝阳区": {} +// } +// } +// }); +// widget.destroy(); +// }); +// }); \ No newline at end of file diff --git a/src/widget/editor/__test__/editor.search.test.js b/src/widget/editor/__test__/editor.search.test.js index 6228cd5aa7..e80be9b39c 100644 --- a/src/widget/editor/__test__/editor.search.test.js +++ b/src/widget/editor/__test__/editor.search.test.js @@ -4,12 +4,6 @@ * Created by windy on 2019/9/9 */ -/** - * @author windy - * @version 2.0 - * Created by windy on 2019/9/6 - */ - describe("searchEditor", function () { /**