Browse Source
* commit 'b444a56848de9d68c2a2c7eabc877bffb1d54baa': REPORT-21493 && REPORT-21002 && BI-51100 单测 && 视觉修改es6
guy
5 years ago
22 changed files with 890 additions and 53 deletions
@ -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(); |
||||||
|
}); |
||||||
|
}); |
||||||
|
}); |
||||||
|
}); |
Loading…
Reference in new issue