alan
5 years ago
55 changed files with 1778 additions and 591 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
||||
@import "../../index"; |
||||
|
||||
.bi-multi-select-trigger { |
||||
.border-corner-radius(2px, 2px, 2px, 2px); |
||||
|
||||
} |
@ -1,19 +0,0 @@
|
||||
/** |
||||
* @author windy |
||||
* @version 2.0 |
||||
* Created by windy on 2019/9/3 |
||||
*/ |
||||
|
||||
describe("DownListCombo", function () { |
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("defaultValue", function () { |
||||
var datePane = BI.Test.createWidget({ |
||||
type: "bi.down_list_combo", |
||||
adjustLength: 10, |
||||
items: [[{"el":{"text":"column 1111","iconCls1":"dot-e-font","value":12},"children":[{"text":"column 1.1","value":21,"cls":"dot-e-font"},{"text":"column 1.2","value":22,"cls":"dot-e-font"}]}],[{"el":{"text":"column 1111","iconCls1":"dot-e-font","value":11},"children":[{"text":"column 1.1","value":21,"cls":"dot-e-font"},{"text":"column 1.2","value":22,"cls":"dot-e-font"}]}]] |
||||
}); |
||||
}); |
||||
}); |
@ -0,0 +1,63 @@
|
||||
/** |
||||
* @author windy |
||||
* @version 2.0 |
||||
* Created by windy on 2019/9/3 |
||||
*/ |
||||
|
||||
describe("DownListCombo", function () { |
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("defaultValue", function () { |
||||
var downListCombo = BI.Test.createWidget({ |
||||
type: "bi.down_list_combo", |
||||
adjustLength: 10, |
||||
items: [[{"el":{"text":"column 1111","iconCls1":"dot-e-font","value":12},"children":[{"text":"column 1.1","value":21,"cls":"dot-e-font"},{"text":"column 1.2","value":22,"cls":"dot-e-font"}]}],[{"el":{"text":"column 1111","iconCls1":"dot-e-font","value":11},"children":[{"text":"column 1.1","value":21,"cls":"dot-e-font"},{"text":"column 1.2","value":22,"cls":"dot-e-font"}]}]] |
||||
}); |
||||
downListCombo.setValue([{value: 12, childValue: 21}]); |
||||
expect(downListCombo.getValue()).to.deep.equal([ { childValue: 21, value: 12 } ]); |
||||
downListCombo.destroy(); |
||||
}); |
||||
|
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("点击父亲选值", function (done) { |
||||
var downListCombo = BI.Test.createWidget({ |
||||
type: "bi.down_list_combo", |
||||
height: 30, |
||||
width: 30, |
||||
items: [[{"el":{"text":"column 1111","iconCls1":"dot-e-font","value":12},"children":[{"text":"column 1.1","value":21,"cls":"dot-e-font"},{"text":"column 1.2","value":22,"cls":"dot-e-font"}]}],[{"el":{"text":"column 1111","iconCls1":"dot-e-font","value":11},"children":[{"text":"column 1.1","value":21,"cls":"dot-e-font"},{"text":"column 1.2","value":22,"cls":"dot-e-font"}]}], [{"text": "column 1122", value: 32}, {"text": "column 1133", value: 33}]] |
||||
}); |
||||
downListCombo.element.children(".pull-down-font").click(); |
||||
BI.nextTick(function () { |
||||
downListCombo.element.find(".bi-down-list-group:last-child .bi-down-list-item").click(); |
||||
expect(downListCombo.getValue()).to.deep.equal([ { value: 33 } ]); |
||||
done(); |
||||
}); |
||||
}); |
||||
|
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("点击儿子选值", function (done) { |
||||
var downListCombo = BI.Test.createWidget({ |
||||
type: "bi.down_list_combo", |
||||
height: 30, |
||||
width: 30, |
||||
items: [[{"el":{"text":"column 1111","iconCls1":"dot-e-font","value":12},"children":[{"text":"column 1.1","value":21,"cls":"dot-e-font"},{"text":"column 1.2","value":22,"cls":"dot-e-font"}]}],[{"el":{"text":"column 1111","iconCls1":"dot-e-font","value":11},"children":[{"text":"column 1.1","value":21,"cls":"dot-e-font"},{"text":"column 1.2","value":22,"cls":"dot-e-font"}]}]] |
||||
}); |
||||
downListCombo.element.children(".pull-down-font").click(); |
||||
BI.Test.triggerMouseover(downListCombo.element.find(".bi-down-list-group:first-child .bi-down-list-group-item"), function () { |
||||
BI.nextTick(function () { |
||||
downListCombo.element.find(".child-down-list-item:first-child").click(); |
||||
expect(downListCombo.getValue()).to.deep.equal([ { childValue: 21, value: 12 } ]); |
||||
downListCombo.destroy(); |
||||
done(); |
||||
}); |
||||
}); |
||||
}); |
||||
}); |
@ -1,119 +0,0 @@
|
||||
/** |
||||
* @author windy |
||||
* @version 2.0 |
||||
* Created by windy on 2019/9/4 |
||||
*/ |
||||
|
||||
describe("DateCombo", function () { |
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("defaultValue", function () { |
||||
var dateCombo = BI.Test.createWidget({ |
||||
type: "bi.dynamic_date_combo", |
||||
value: { |
||||
type: 1, |
||||
value: { |
||||
year: 2018, |
||||
month: 2, |
||||
day: 23 |
||||
} |
||||
} |
||||
}); |
||||
expect(dateCombo.element.find(".bi-date-trigger .bi-label").text()).to.equal("2018-02-23"); |
||||
dateCombo.destroy(); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("测试输入值收起下拉清空值下拉出现", function (done) { |
||||
var dateCombo = BI.Test.createWidget({ |
||||
type: "bi.dynamic_date_combo", |
||||
width: 220, |
||||
height: 30, |
||||
value: { |
||||
type: 1, |
||||
value: { |
||||
year: 2018, |
||||
month: 2, |
||||
day: 23 |
||||
} |
||||
} |
||||
}); |
||||
BI.nextTick(function () { |
||||
dateCombo.element.find(".bi-date-trigger .bi-basic-button").click(); |
||||
// 输入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"); |
||||
// 清空输入, 检查popup是否弹出
|
||||
BI.Test.triggerKeyDown(dateCombo.element.find(".bi-date-trigger .bi-input"), "", BI.KeyCode.BACKSPACE, function () { |
||||
BI.nextTick(function () { |
||||
expect(dateCombo.element.find(".bi-date-trigger + .bi-popup-view").css("display")).to.equal("block"); |
||||
dateCombo.destroy(); |
||||
done(); |
||||
}); |
||||
}); |
||||
}); |
||||
}); |
||||
}); |
||||
|
||||
}); |
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("trigger的confirm-下拉面板选值confirm", function (done) { |
||||
var dateCombo = BI.Test.createWidget({ |
||||
type: "bi.dynamic_date_combo", |
||||
width: 220, |
||||
height: 30 |
||||
}); |
||||
// 点击日期,是否收起下拉
|
||||
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"); |
||||
dateCombo.destroy(); |
||||
done(); |
||||
}) |
||||
|
||||
}); |
||||
|
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("trigger的输入日期后confirm", function (done) { |
||||
var dateCombo = BI.Test.createWidget({ |
||||
type: "bi.dynamic_date_combo", |
||||
width: 220, |
||||
height: 30, |
||||
value: { |
||||
type: 1, |
||||
value: { |
||||
year: 2018, |
||||
month: 2, |
||||
day: 23 |
||||
} |
||||
} |
||||
}); |
||||
BI.nextTick(function () { |
||||
dateCombo.element.find(".bi-date-trigger .bi-basic-button").click(); |
||||
BI.nextTick(function () { |
||||
var input = dateCombo.element.find(".bi-date-trigger .bi-input"); |
||||
input.val("2017-1-1"); |
||||
BI.Test.triggerKeyDown(dateCombo.element.find(".bi-date-trigger .bi-input"), null, BI.KeyCode.ENTER, function () { |
||||
BI.delay(function () { |
||||
expect(dateCombo.element.find(".bi-date-trigger .bi-text-button").text()).to.equal("2017-01-01"); |
||||
dateCombo.destroy(); |
||||
done(); |
||||
}, 300); |
||||
}); |
||||
}); |
||||
}) |
||||
|
||||
}); |
||||
}); |
@ -0,0 +1,304 @@
|
||||
/** |
||||
* @author windy |
||||
* @version 2.0 |
||||
* Created by windy on 2019/9/4 |
||||
*/ |
||||
|
||||
describe("DateCombo", function () { |
||||
|
||||
before(function () { |
||||
BI.holidays = { |
||||
"2010-02-28": true, |
||||
"2010-02-27": true |
||||
}; |
||||
}); |
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("defaultValue", function () { |
||||
var dateCombo = BI.Test.createWidget({ |
||||
type: "bi.dynamic_date_combo", |
||||
value: { |
||||
type: 1, |
||||
value: { |
||||
year: 2018, |
||||
month: 2, |
||||
day: 23 |
||||
} |
||||
} |
||||
}); |
||||
expect(dateCombo.element.find(".bi-date-trigger .bi-label").text()).to.equal("2018-02-23"); |
||||
dateCombo.destroy(); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("测试输入值收起下拉清空值下拉出现", function (done) { |
||||
var dateCombo = BI.Test.createWidget({ |
||||
type: "bi.dynamic_date_combo", |
||||
width: 220, |
||||
height: 30, |
||||
value: { |
||||
type: 1, |
||||
value: { |
||||
year: 2018, |
||||
month: 2, |
||||
day: 23 |
||||
} |
||||
} |
||||
}); |
||||
BI.nextTick(function () { |
||||
dateCombo.element.find(".bi-date-trigger .bi-basic-button").click(); |
||||
// 输入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"); |
||||
// 清空输入, 检查popup是否弹出
|
||||
BI.Test.triggerKeyDown(dateCombo.element.find(".bi-date-trigger .bi-input"), "", BI.KeyCode.BACKSPACE, function () { |
||||
BI.nextTick(function () { |
||||
expect(dateCombo.element.find(".bi-date-trigger + .bi-popup-view").css("display")).to.equal("block"); |
||||
dateCombo.destroy(); |
||||
done(); |
||||
}); |
||||
}); |
||||
}); |
||||
}); |
||||
}); |
||||
|
||||
}); |
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("trigger的confirm-下拉面板选值confirm", function (done) { |
||||
var dateCombo = BI.Test.createWidget({ |
||||
type: "bi.dynamic_date_combo", |
||||
width: 220, |
||||
height: 30 |
||||
}); |
||||
// 点击日期,是否收起下拉
|
||||
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"); |
||||
dateCombo.destroy(); |
||||
done(); |
||||
}) |
||||
|
||||
}); |
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("下拉后直接点击外部的触发的confirm", function (done) { |
||||
var dateCombo = BI.Test.createWidget({ |
||||
type: "bi.dynamic_date_combo", |
||||
width: 220, |
||||
height: 30, |
||||
}); |
||||
// 点击日期,是否收起下拉
|
||||
BI.nextTick(function () { |
||||
dateCombo.element.find(".bi-date-trigger .bi-basic-button").click(); |
||||
BI.nextTick(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"); |
||||
dateCombo.destroy(); |
||||
done(); |
||||
}, 300); |
||||
}); |
||||
}) |
||||
}); |
||||
}); |
||||
|
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("点击清空", function (done) { |
||||
var dateCombo = BI.Test.createWidget({ |
||||
type: "bi.dynamic_date_combo", |
||||
width: 220, |
||||
height: 30, |
||||
value: { |
||||
type: 1, |
||||
value: { |
||||
year: 2018, |
||||
month: 2, |
||||
day: 23 |
||||
} |
||||
} |
||||
}); |
||||
dateCombo.element.find(".bi-date-trigger .bi-basic-button").click(); |
||||
BI.nextTick(function () { |
||||
dateCombo.element.find(".bi-dynamic-date-popup .bi-text:contains(清除)").parent().click(); |
||||
expect(BI.isNull(dateCombo.getValue())).to.equal(true); |
||||
dateCombo.destroy(); |
||||
done(); |
||||
}) |
||||
}); |
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("点击今天", function (done) { |
||||
var dateCombo = BI.Test.createWidget({ |
||||
type: "bi.dynamic_date_combo", |
||||
width: 220, |
||||
height: 30, |
||||
value: { |
||||
type: 1, |
||||
value: { |
||||
year: 2018, |
||||
month: 2, |
||||
day: 23 |
||||
} |
||||
} |
||||
}); |
||||
dateCombo.element.find(".bi-date-trigger .bi-basic-button").click(); |
||||
BI.nextTick(function () { |
||||
dateCombo.element.find(".bi-dynamic-date-popup .bi-text:contains(今天)").parent().click(); |
||||
var date = BI.getDate(); |
||||
expect(dateCombo.getValue()).to.deep.equal({ |
||||
type: 1, |
||||
value: { |
||||
year: date.getFullYear(), |
||||
month: date.getMonth() + 1, |
||||
day: date.getDate() |
||||
} |
||||
}); |
||||
dateCombo.destroy(); |
||||
done(); |
||||
}) |
||||
}); |
||||
|
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("点击确定", function (done) { |
||||
var dateCombo = BI.Test.createWidget({ |
||||
type: "bi.dynamic_date_combo", |
||||
width: 220, |
||||
height: 30, |
||||
value: { |
||||
type: 1, |
||||
value: { |
||||
year: 2018, |
||||
month: 2, |
||||
day: 23 |
||||
} |
||||
} |
||||
}); |
||||
dateCombo.element.find(".bi-date-trigger .bi-basic-button").click(); |
||||
BI.nextTick(function () { |
||||
dateCombo.element.find(".bi-dynamic-date-popup .bi-text:contains(确定)").parent().click(); |
||||
expect(dateCombo.getValue()).to.deep.equal({ |
||||
type: 1, |
||||
value: { |
||||
year: 2018, |
||||
month: 2, |
||||
day: 23 |
||||
} |
||||
}); |
||||
dateCombo.destroy(); |
||||
done(); |
||||
}) |
||||
}); |
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("测试动态默认值", function () { |
||||
var dateCombo = BI.Test.createWidget({ |
||||
type: "bi.dynamic_date_combo", |
||||
width: 220, |
||||
height: 30, |
||||
value: { |
||||
type: 2, |
||||
value: { |
||||
year: -1, |
||||
month: 1, |
||||
quarter: -1, |
||||
week: 1, |
||||
day: -1, |
||||
position: 2 |
||||
} |
||||
} |
||||
}); |
||||
expect(dateCombo.getValue()).to.deep.equal({ |
||||
type: 2, |
||||
value: { |
||||
year: -1, |
||||
month: 1, |
||||
quarter: -1, |
||||
week: 1, |
||||
day: -1, |
||||
position: 2 |
||||
} |
||||
}); |
||||
dateCombo.destroy(); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("测试工作日动态默认值", function () { |
||||
var dateCombo = BI.Test.createWidget({ |
||||
type: "bi.dynamic_date_combo", |
||||
width: 220, |
||||
height: 30, |
||||
value: { |
||||
type: 2, |
||||
value: { |
||||
workDay: -1 |
||||
} |
||||
} |
||||
}); |
||||
expect(dateCombo.getValue()).to.deep.equal({ |
||||
type: 2, |
||||
value: { |
||||
workDay: -1 |
||||
} |
||||
}); |
||||
dateCombo.destroy(); |
||||
}); |
||||
|
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("trigger的输入日期后confirm", function (done) { |
||||
var dateCombo = BI.Test.createWidget({ |
||||
type: "bi.dynamic_date_combo", |
||||
width: 220, |
||||
height: 30, |
||||
value: { |
||||
type: 1, |
||||
value: { |
||||
year: 2018, |
||||
month: 2, |
||||
day: 23 |
||||
} |
||||
} |
||||
}); |
||||
BI.nextTick(function () { |
||||
dateCombo.element.find(".bi-date-trigger .bi-basic-button").click(); |
||||
BI.nextTick(function () { |
||||
var input = dateCombo.element.find(".bi-date-trigger .bi-input"); |
||||
input.val("2017-1-1"); |
||||
BI.Test.triggerKeyDown(dateCombo.element.find(".bi-date-trigger .bi-input"), null, BI.KeyCode.ENTER, function () { |
||||
BI.delay(function () { |
||||
expect(dateCombo.element.find(".bi-date-trigger .bi-text-button").text()).to.equal("2017-01-01"); |
||||
dateCombo.destroy(); |
||||
done(); |
||||
}, 300); |
||||
}); |
||||
}); |
||||
}) |
||||
|
||||
}); |
||||
}); |
@ -0,0 +1,182 @@
|
||||
/** |
||||
* @author windy |
||||
* @version 2.0 |
||||
* Created by windy on 2019/9/9 |
||||
*/ |
||||
|
||||
/** |
||||
* @author windy |
||||
* @version 2.0 |
||||
* Created by windy on 2019/9/6 |
||||
*/ |
||||
|
||||
describe("searchEditor", function () { |
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("defaultValue", function (done) { |
||||
var editor = BI.Test.createWidget({ |
||||
type: "bi.search_editor", |
||||
width: 300, |
||||
value: "12345", |
||||
watermark: "添加合法性判断", |
||||
errorText: "长度必须大于4", |
||||
validationChecker: function () { |
||||
return this.getValue().length > 4; |
||||
} |
||||
}); |
||||
expect(editor.element.find(".bi-water-mark").text()).to.equal("添加合法性判断"); |
||||
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.search_editor", |
||||
width: 300, |
||||
value: "12345", |
||||
watermark: "添加合法性判断", |
||||
errorText: "长度必须大于4", |
||||
validationChecker: function () { |
||||
return this.getValue().length > 4; |
||||
} |
||||
}); |
||||
BI.nextTick(function () { |
||||
editor.element.find(".close-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.search_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.search_editor", |
||||
width: 300, |
||||
value: "12346", |
||||
watermark: "添加合法性判断", |
||||
errorText: "长度必须大于4", |
||||
validationChecker: function () { |
||||
return this.getValue().length > 4; |
||||
} |
||||
}); |
||||
expect(editor.getValue()).to.equal("12346"); |
||||
editor.destroy(); |
||||
}); |
||||
|
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("defaultValue1", function (done) { |
||||
var editor = BI.Test.createWidget({ |
||||
type: "bi.small_search_editor", |
||||
width: 300, |
||||
value: "12345", |
||||
watermark: "添加合法性判断", |
||||
errorText: "长度必须大于4", |
||||
validationChecker: function () { |
||||
return this.getValue().length > 4; |
||||
} |
||||
}); |
||||
expect(editor.element.find(".bi-water-mark").text()).to.equal("添加合法性判断"); |
||||
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("clear1", function (done) { |
||||
var editor = BI.Test.createWidget({ |
||||
type: "bi.small_search_editor", |
||||
width: 300, |
||||
value: "12345", |
||||
watermark: "添加合法性判断", |
||||
errorText: "长度必须大于4", |
||||
validationChecker: function () { |
||||
return this.getValue().length > 4; |
||||
} |
||||
}); |
||||
BI.nextTick(function () { |
||||
editor.element.find(".close-font").click(); |
||||
expect(editor.element.find(".bi-input").val()).to.equal(""); |
||||
editor.destroy(); |
||||
done(); |
||||
}); |
||||
}); |
||||
|
||||
/** |
||||
* test_author_windy |
||||
*/ |
||||
it("setValue1", function () { |
||||
var editor = BI.Test.createWidget({ |
||||
type: "bi.small_search_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("getValue1", function () { |
||||
var editor = BI.Test.createWidget({ |
||||
type: "bi.small_search_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,5 @@
|
||||
/** |
||||
* @author windy |
||||
* @version 2.0 |
||||
* Created by windy on 2019/9/9 |
||||
*/ |
Loading…
Reference in new issue