forked from fanruan/fineui
Kobi
5 years ago
11 changed files with 713 additions and 5 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); |
||||
}); |
||||
}); |
||||
}); |
Loading…
Reference in new issue