zsmj1994
5 years ago
31 changed files with 1558 additions and 503 deletions
@ -0,0 +1,79 @@
|
||||
/** |
||||
* @author Kobi |
||||
* @date 2020/5/12 |
||||
*/ |
||||
|
||||
describe("test node.arrow", function () { |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("doRedMark 和 unRedMark", function () { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.arrow_group_node", |
||||
text: "要标红的AAA", |
||||
}); |
||||
widget.doRedMark("AAA"); |
||||
expect(widget.element.find(".bi-keyword-red-mark").length).to.not.equal(0); |
||||
widget.unRedMark(); |
||||
expect(widget.element.find(".bi-keyword-red-mark").length).to.equal(0); |
||||
widget.destroy(); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("doClick", function (done) { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.arrow_group_node", |
||||
text: "AAA", |
||||
}); |
||||
BI.nextTick(function () { |
||||
widget.element.click(); |
||||
expect(widget.element.find(".expander-down-font").length).to.not.equal(0); |
||||
BI.delay(function () { |
||||
BI.nextTick(function () { |
||||
widget.checkbox.element.click(); |
||||
expect(widget.element.find(".expander-right-font").length).to.not.equal(0); |
||||
widget.destroy(); |
||||
done(); |
||||
}); |
||||
}, 300); |
||||
}); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("点击图标", function (done) { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.arrow_group_node", |
||||
text: "AAA", |
||||
}); |
||||
BI.nextTick(function () { |
||||
widget.checkbox.element.click(); |
||||
expect(widget.element.find(".expander-down-font").length).to.not.equal(0); |
||||
BI.delay(function () { |
||||
BI.nextTick(function () { |
||||
widget.checkbox.element.click(); |
||||
expect(widget.element.find(".expander-right-font").length).to.not.equal(0); |
||||
widget.destroy(); |
||||
done(); |
||||
}); |
||||
}, 300); |
||||
}); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("setText", function () { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.arrow_group_node", |
||||
text: "AAA", |
||||
}); |
||||
widget.setText("BBB"); |
||||
expect(widget.element.find(".bi-text").text()).to.equal("BBB"); |
||||
widget.destroy(); |
||||
}); |
||||
}); |
@ -0,0 +1,66 @@
|
||||
/** |
||||
* @author Kobi |
||||
* @date 2020/5/12 |
||||
*/ |
||||
|
||||
describe("test node.first.plus", function () { |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("doRedMark 和 unRedMark", function () { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.first_plus_group_node", |
||||
text: "要标红的AAA", |
||||
}); |
||||
widget.doRedMark("AAA"); |
||||
expect(widget.element.find(".bi-keyword-red-mark").length).to.not.equal(0); |
||||
widget.unRedMark(); |
||||
expect(widget.element.find(".bi-keyword-red-mark").length).to.equal(0); |
||||
widget.destroy(); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("doClick", function (done) { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.first_plus_group_node", |
||||
text: "AAA", |
||||
}); |
||||
BI.nextTick(function () { |
||||
widget.element.click(); |
||||
expect(widget.element.find(".tree-expand-icon-type2").length).to.not.equal(0); |
||||
BI.delay(function () { |
||||
BI.nextTick(function () { |
||||
widget.element.click(); |
||||
expect(widget.element.find(".tree-expand-icon-type2").length).to.equal(0); |
||||
widget.destroy(); |
||||
done(); |
||||
}); |
||||
}, 300); |
||||
}); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("点击图标", function (done) { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.first_plus_group_node", |
||||
text: "AAA", |
||||
}); |
||||
BI.nextTick(function () { |
||||
widget.checkbox.element.click(); |
||||
expect(widget.element.find(".tree-expand-icon-type2").length).to.not.equal(0); |
||||
BI.delay(function () { |
||||
BI.nextTick(function () { |
||||
widget.checkbox.element.click(); |
||||
expect(widget.element.find(".tree-expand-icon-type2").length).to.equal(0); |
||||
widget.destroy(); |
||||
done(); |
||||
}); |
||||
}, 300); |
||||
}); |
||||
}); |
||||
}); |
@ -0,0 +1,66 @@
|
||||
/** |
||||
* @author Kobi |
||||
* @date 2020/5/12 |
||||
*/ |
||||
|
||||
describe("test node.icon.arrow", function () { |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("doRedMark 和 unRedMark", function () { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.icon_arrow_node", |
||||
text: "要标红的AAA", |
||||
}); |
||||
widget.doRedMark("AAA"); |
||||
expect(widget.element.find(".bi-keyword-red-mark").length).to.not.equal(0); |
||||
widget.unRedMark(); |
||||
expect(widget.element.find(".bi-keyword-red-mark").length).to.equal(0); |
||||
widget.destroy(); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("doClick", function (done) { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.icon_arrow_node", |
||||
text: "AAA", |
||||
}); |
||||
BI.nextTick(function () { |
||||
widget.element.click(); |
||||
expect(widget.element.find(".expander-down-font").length).to.not.equal(0); |
||||
BI.delay(function () { |
||||
BI.nextTick(function () { |
||||
widget.checkbox.element.click(); |
||||
expect(widget.element.find(".expander-right-font").length).to.not.equal(0); |
||||
widget.destroy(); |
||||
done(); |
||||
}); |
||||
}, 300); |
||||
}); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("点击图标", function (done) { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.icon_arrow_node", |
||||
text: "AAA", |
||||
}); |
||||
BI.nextTick(function () { |
||||
widget.checkbox.element.click(); |
||||
expect(widget.element.find(".expander-down-font").length).to.not.equal(0); |
||||
BI.delay(function () { |
||||
BI.nextTick(function () { |
||||
widget.checkbox.element.click(); |
||||
expect(widget.element.find(".expander-right-font").length).to.not.equal(0); |
||||
widget.destroy(); |
||||
done(); |
||||
}); |
||||
}, 300); |
||||
}); |
||||
}); |
||||
}); |
@ -0,0 +1,66 @@
|
||||
/** |
||||
* @author Kobi |
||||
* @date 2020/5/12 |
||||
*/ |
||||
|
||||
describe("test node.last.plus", function () { |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("doRedMark 和 unRedMark", function () { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.last_plus_group_node", |
||||
text: "要标红的AAA", |
||||
}); |
||||
widget.doRedMark("AAA"); |
||||
expect(widget.element.find(".bi-keyword-red-mark").length).to.not.equal(0); |
||||
widget.unRedMark(); |
||||
expect(widget.element.find(".bi-keyword-red-mark").length).to.equal(0); |
||||
widget.destroy(); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("doClick", function (done) { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.last_plus_group_node", |
||||
text: "AAA", |
||||
}); |
||||
BI.nextTick(function () { |
||||
widget.element.click(); |
||||
expect(widget.element.find(".tree-expand-icon-type4").length).to.not.equal(0); |
||||
BI.delay(function () { |
||||
BI.nextTick(function () { |
||||
widget.element.click(); |
||||
expect(widget.element.find(".tree-expand-icon-type4").length).to.equal(0); |
||||
widget.destroy(); |
||||
done(); |
||||
}); |
||||
}, 300); |
||||
}); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("点击图标", function (done) { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.last_plus_group_node", |
||||
text: "AAA", |
||||
}); |
||||
BI.nextTick(function () { |
||||
widget.checkbox.element.click(); |
||||
expect(widget.element.find(".tree-expand-icon-type4").length).to.not.equal(0); |
||||
BI.delay(function () { |
||||
BI.nextTick(function () { |
||||
widget.checkbox.element.click(); |
||||
expect(widget.element.find(".tree-expand-icon-type4").length).to.equal(0); |
||||
widget.destroy(); |
||||
done(); |
||||
}); |
||||
}, 300); |
||||
}); |
||||
}); |
||||
}); |
@ -0,0 +1,66 @@
|
||||
/** |
||||
* @author Kobi |
||||
* @date 2020/5/12 |
||||
*/ |
||||
|
||||
describe("test node.mid.plus", function () { |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("doRedMark 和 unRedMark", function () { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.mid_plus_group_node", |
||||
text: "要标红的AAA", |
||||
}); |
||||
widget.doRedMark("AAA"); |
||||
expect(widget.element.find(".bi-keyword-red-mark").length).to.not.equal(0); |
||||
widget.unRedMark(); |
||||
expect(widget.element.find(".bi-keyword-red-mark").length).to.equal(0); |
||||
widget.destroy(); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("doClick", function (done) { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.mid_plus_group_node", |
||||
text: "AAA", |
||||
}); |
||||
BI.nextTick(function () { |
||||
widget.element.click(); |
||||
expect(widget.element.find(".tree-expand-icon-type3").length).to.not.equal(0); |
||||
BI.delay(function () { |
||||
BI.nextTick(function () { |
||||
widget.element.click(); |
||||
expect(widget.element.find(".tree-expand-icon-type3").length).to.equal(0); |
||||
widget.destroy(); |
||||
done(); |
||||
}); |
||||
}, 300); |
||||
}); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("点击图标", function (done) { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.mid_plus_group_node", |
||||
text: "AAA", |
||||
}); |
||||
BI.nextTick(function () { |
||||
widget.checkbox.element.click(); |
||||
expect(widget.element.find(".tree-expand-icon-type3").length).to.not.equal(0); |
||||
BI.delay(function () { |
||||
BI.nextTick(function () { |
||||
widget.checkbox.element.click(); |
||||
expect(widget.element.find(".tree-expand-icon-type3").length).to.equal(0); |
||||
widget.destroy(); |
||||
done(); |
||||
}); |
||||
}, 300); |
||||
}); |
||||
}); |
||||
}); |
@ -0,0 +1,73 @@
|
||||
/** |
||||
* @author Kobi |
||||
* @date 2020/5/12 |
||||
*/ |
||||
|
||||
describe("test node.multilayer.icon.arrow", function () { |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("doRedMark 和 unRedMark", function () { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.multilayer_icon_arrow_node", |
||||
text: "要标红的AAA", |
||||
layer: 3, |
||||
}); |
||||
expect(widget.isOnce()).to.equal(true); |
||||
widget.doRedMark("AAA"); |
||||
expect(widget.element.find(".bi-keyword-red-mark").length).to.not.equal(0); |
||||
widget.unRedMark(); |
||||
expect(widget.element.find(".bi-keyword-red-mark").length).to.equal(0); |
||||
widget.destroy(); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("isSelected 和 setSelected", function () { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.multilayer_icon_arrow_node", |
||||
text: "AAA", |
||||
layer: 3, |
||||
}); |
||||
widget.setSelected(true); |
||||
expect(widget.element.find(".active").length).to.not.equal(0); |
||||
expect(widget.isSelected()).to.equal(true); |
||||
widget.destroy(); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("doClick", function (done) { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.multilayer_icon_arrow_node", |
||||
text: "AAA", |
||||
layer: 3, |
||||
}); |
||||
BI.nextTick(function () { |
||||
widget.element.click(); |
||||
expect(widget.isSelected()).to.equal(true); |
||||
widget.destroy(); |
||||
done(); |
||||
}); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("点击图标", function (done) { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.multilayer_icon_arrow_node", |
||||
text: "AAA", |
||||
layer: 3, |
||||
}); |
||||
BI.nextTick(function () { |
||||
widget.node.element.click(); |
||||
expect(widget.element.find(".expander-down-font").length).to.not.equal(0); |
||||
widget.destroy(); |
||||
done(); |
||||
}); |
||||
}); |
||||
}); |
@ -0,0 +1,66 @@
|
||||
/** |
||||
* @author Kobi |
||||
* @date 2020/5/12 |
||||
*/ |
||||
|
||||
describe("test node.plus", function () { |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("doRedMark 和 unRedMark", function () { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.plus_group_node", |
||||
text: "要标红的AAA", |
||||
}); |
||||
widget.doRedMark("AAA"); |
||||
expect(widget.element.find(".bi-keyword-red-mark").length).to.not.equal(0); |
||||
widget.unRedMark(); |
||||
expect(widget.element.find(".bi-keyword-red-mark").length).to.equal(0); |
||||
widget.destroy(); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("doClick", function (done) { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.plus_group_node", |
||||
text: "AAA", |
||||
}); |
||||
BI.nextTick(function () { |
||||
widget.element.click(); |
||||
expect(widget.element.find(".tree-expand-icon-type1").length).to.not.equal(0); |
||||
BI.delay(function () { |
||||
BI.nextTick(function () { |
||||
widget.element.click(); |
||||
expect(widget.element.find(".tree-expand-icon-type1").length).to.equal(0); |
||||
widget.destroy(); |
||||
done(); |
||||
}); |
||||
}, 300); |
||||
}); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_kobi |
||||
**/ |
||||
it("点击图标", function (done) { |
||||
var widget = BI.Test.createWidget({ |
||||
type: "bi.plus_group_node", |
||||
text: "AAA", |
||||
}); |
||||
BI.nextTick(function () { |
||||
widget.checkbox.element.click(); |
||||
expect(widget.element.find(".tree-expand-icon-type1").length).to.not.equal(0); |
||||
BI.delay(function () { |
||||
BI.nextTick(function () { |
||||
widget.checkbox.element.click(); |
||||
expect(widget.element.find(".tree-expand-icon-type1").length).to.equal(0); |
||||
widget.destroy(); |
||||
done(); |
||||
}); |
||||
}, 300); |
||||
}); |
||||
}); |
||||
}); |
@ -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(); |
||||
}); |
||||
|
||||
}); |
@ -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(); |
||||
}); |
||||
|
||||
}); |
@ -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(); |
||||
}); |
||||
|
||||
}); |
@ -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(); |
||||
}); |
||||
|
||||
}); |
@ -0,0 +1,11 @@
|
||||
import { _BasicButton } from "./button.basic"; |
||||
|
||||
export interface _NodeButton extends _BasicButton { |
||||
isOpened: () => void; |
||||
|
||||
setOpened: (b: boolean) => void; |
||||
|
||||
triggerCollapse: () => void; |
||||
|
||||
triggerExpand: () => void; |
||||
} |
@ -0,0 +1,15 @@
|
||||
import { _Widget } from "../../core/widget"; |
||||
|
||||
export interface _DownListCombo extends _Widget { |
||||
hideView: () => void; |
||||
|
||||
showView: (e?: any) => void; |
||||
|
||||
populate: (items?: any) => void; |
||||
} |
||||
|
||||
export interface _DownListComboStatic { |
||||
EVENT_CHANGE: string; |
||||
EVENT_SON_VALUE_CHANGE: string; |
||||
EVENT_BEFORE_POPUPVIEW: string; |
||||
} |
Loading…
Reference in new issue