Browse Source

Merge pull request #1040 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit 'b0a618065cbe5854959afadc049b22194bef5150':
  REPORT-19984 fix: timecombo加高亮边框
  BI-48725 test: 新增测试
es6
guy 5 years ago
parent
commit
014d8de2ae
  1. 8
      dist/2.0/fineui.ie.js
  2. 8
      dist/2.0/fineui.js
  3. 8
      dist/bundle.ie.js
  4. 8
      dist/bundle.js
  5. 6
      dist/case.js
  6. 8
      dist/fineui.ie.js
  7. 8
      dist/fineui.js
  8. 89
      dist/fineui_without_jquery_polyfill.js
  9. 2
      dist/widget.js
  10. 9
      karma.conf.js
  11. 30
      src/base/__test__/a.test.js
  12. 73
      src/base/__test__/text.test.js
  13. 2
      src/widget/time/time.combo.js

8
dist/2.0/fineui.ie.js vendored

@ -61581,8 +61581,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
setTextCls: function(cls) { setTextCls: function(cls) {
var o = this.options; var o = this.options;
this.text.element.removeClass(o.textCls).addClass(cls); var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
}, },
setText: function (text) { setText: function (text) {
@ -61722,8 +61723,9 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
setTextCls: function(cls) { setTextCls: function(cls) {
var o = this.options; var o = this.options;
this.text.element.removeClass(o.textCls).addClass(cls); var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
}, },
setText: function (text) { setText: function (text) {
@ -83291,7 +83293,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
border: 1 border: 1
}, },
props: { props: {
baseCls: "bi-time-combo bi-border bi-border-radius", baseCls: "bi-time-combo bi-border bi-border-radius bi-focus-shadow",
width: 78, width: 78,
height: 22, height: 22,
format: "", format: "",

8
dist/2.0/fineui.js vendored

@ -61985,8 +61985,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
setTextCls: function(cls) { setTextCls: function(cls) {
var o = this.options; var o = this.options;
this.text.element.removeClass(o.textCls).addClass(cls); var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
}, },
setText: function (text) { setText: function (text) {
@ -62126,8 +62127,9 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
setTextCls: function(cls) { setTextCls: function(cls) {
var o = this.options; var o = this.options;
this.text.element.removeClass(o.textCls).addClass(cls); var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
}, },
setText: function (text) { setText: function (text) {
@ -83695,7 +83697,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
border: 1 border: 1
}, },
props: { props: {
baseCls: "bi-time-combo bi-border bi-border-radius", baseCls: "bi-time-combo bi-border bi-border-radius bi-focus-shadow",
width: 78, width: 78,
height: 22, height: 22,
format: "", format: "",

8
dist/bundle.ie.js vendored

@ -61581,8 +61581,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
setTextCls: function(cls) { setTextCls: function(cls) {
var o = this.options; var o = this.options;
this.text.element.removeClass(o.textCls).addClass(cls); var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
}, },
setText: function (text) { setText: function (text) {
@ -61722,8 +61723,9 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
setTextCls: function(cls) { setTextCls: function(cls) {
var o = this.options; var o = this.options;
this.text.element.removeClass(o.textCls).addClass(cls); var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
}, },
setText: function (text) { setText: function (text) {
@ -83291,7 +83293,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
border: 1 border: 1
}, },
props: { props: {
baseCls: "bi-time-combo bi-border bi-border-radius", baseCls: "bi-time-combo bi-border bi-border-radius bi-focus-shadow",
width: 78, width: 78,
height: 22, height: 22,
format: "", format: "",

8
dist/bundle.js vendored

@ -61985,8 +61985,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
setTextCls: function(cls) { setTextCls: function(cls) {
var o = this.options; var o = this.options;
this.text.element.removeClass(o.textCls).addClass(cls); var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
}, },
setText: function (text) { setText: function (text) {
@ -62126,8 +62127,9 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
setTextCls: function(cls) { setTextCls: function(cls) {
var o = this.options; var o = this.options;
this.text.element.removeClass(o.textCls).addClass(cls); var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
}, },
setText: function (text) { setText: function (text) {
@ -83695,7 +83697,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
border: 1 border: 1
}, },
props: { props: {
baseCls: "bi-time-combo bi-border bi-border-radius", baseCls: "bi-time-combo bi-border bi-border-radius bi-focus-shadow",
width: 78, width: 78,
height: 22, height: 22,
format: "", format: "",

6
dist/case.js vendored

@ -9561,8 +9561,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
setTextCls: function(cls) { setTextCls: function(cls) {
var o = this.options; var o = this.options;
this.text.element.removeClass(o.textCls).addClass(cls); var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
}, },
setText: function (text) { setText: function (text) {
@ -9702,8 +9703,9 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
setTextCls: function(cls) { setTextCls: function(cls) {
var o = this.options; var o = this.options;
this.text.element.removeClass(o.textCls).addClass(cls); var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
}, },
setText: function (text) { setText: function (text) {

8
dist/fineui.ie.js vendored

@ -61826,8 +61826,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
setTextCls: function(cls) { setTextCls: function(cls) {
var o = this.options; var o = this.options;
this.text.element.removeClass(o.textCls).addClass(cls); var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
}, },
setText: function (text) { setText: function (text) {
@ -61967,8 +61968,9 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
setTextCls: function(cls) { setTextCls: function(cls) {
var o = this.options; var o = this.options;
this.text.element.removeClass(o.textCls).addClass(cls); var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
}, },
setText: function (text) { setText: function (text) {
@ -83536,7 +83538,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
border: 1 border: 1
}, },
props: { props: {
baseCls: "bi-time-combo bi-border bi-border-radius", baseCls: "bi-time-combo bi-border bi-border-radius bi-focus-shadow",
width: 78, width: 78,
height: 22, height: 22,
format: "", format: "",

8
dist/fineui.js vendored

@ -62230,8 +62230,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
setTextCls: function(cls) { setTextCls: function(cls) {
var o = this.options; var o = this.options;
this.text.element.removeClass(o.textCls).addClass(cls); var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
}, },
setText: function (text) { setText: function (text) {
@ -62371,8 +62372,9 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
setTextCls: function(cls) { setTextCls: function(cls) {
var o = this.options; var o = this.options;
this.text.element.removeClass(o.textCls).addClass(cls); var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
}, },
setText: function (text) { setText: function (text) {
@ -83940,7 +83942,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
border: 1 border: 1
}, },
props: { props: {
baseCls: "bi-time-combo bi-border bi-border-radius", baseCls: "bi-time-combo bi-border bi-border-radius bi-focus-shadow",
width: 78, width: 78,
height: 22, height: 22,
format: "", format: "",

89
dist/fineui_without_jquery_polyfill.js vendored

@ -28559,6 +28559,36 @@ BI.ButtonTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.button_tree", BI.ButtonTree);/** BI.shortcut("bi.button_tree", BI.ButtonTree);/**
* Created by windy on 2018/01/23. * Created by windy on 2018/01/23.
*/ */
describe("ALinkTest", function () {
/**
* test_author_windy
*/
it("A初始化测试", function () {
var a = BI.Test.createWidget({
type: "bi.a",
text: "CCC"
});
expect(a.element.is('a')).to.equal(true);
});
/**
* test_author_windy
*/
it("A的el测试", function () {
var a = BI.Test.createWidget({
type: "bi.a",
text: "DDD",
el: {
type: "bi.label"
}
});
expect(a.element.is('a') && a.element.hasClass("bi-label")).to.equal(true);
});
});
/**
* Created by windy on 2018/01/23.
*/
describe("ButtonTest", function () { describe("ButtonTest", function () {
/** /**
@ -28763,11 +28793,10 @@ describe("TextTest", function () {
it("setValue", function () { it("setValue", function () {
var text = BI.Test.createWidget({ var text = BI.Test.createWidget({
type: "bi.text", type: "bi.text",
text: "我是要标红的A", value: "AAA",
keyword: "A"
}); });
text.unRedMark(); text.setValue("value");
expect(text.element.children(".bi-keyword-red-mark").length).to.equal(0); expect(text.element.text()).to.equal("value");
text.destroy(); text.destroy();
}); });
@ -28778,10 +28807,10 @@ describe("TextTest", function () {
var text = BI.Test.createWidget({ var text = BI.Test.createWidget({
type: "bi.text", type: "bi.text",
text: "我是要标红的A", text: "我是要标红的A",
keyword: "A" vgap: 10,
hgap: 10
}); });
text.unRedMark(); expect(text.element.css("padding")).to.equal("10px");
expect(text.element.children(".bi-keyword-red-mark").length).to.equal(0);
text.destroy(); text.destroy();
}); });
@ -28792,12 +28821,44 @@ describe("TextTest", function () {
var text = BI.Test.createWidget({ var text = BI.Test.createWidget({
type: "bi.text", type: "bi.text",
text: "我是要标红的 A", text: "我是要标红的 A",
keyword: "A"
}); });
text.unRedMark(); expect(text.element.text()).to.equal("我是要标红的 A");
expect(text.element.children(".bi-keyword-red-mark").length).to.equal(0); text.destroy();
});
/**
* test_author_windy
*/
it("lineHeight和height", function () {
var text = BI.Test.createWidget({
type: "bi.text",
text: "我是A",
lineHeight: 12,
height: 24
});
expect(text.element.css("height")).to.equal("24px");
expect(text.element.css("line-height")).to.equal("12px");
text.destroy(); text.destroy();
}); });
/**
* test_author_windy
*/
it("handler", function (done) {
var text = BI.Test.createWidget({
type: "bi.text",
text: "我是A",
handler: function () {
text.setText("handler");
}
});
BI.nextTick(function () {
text.text.element.click();
expect(text.text.element.text()).to.equal("handler");
text.destroy();
done();
});
});
}); });
BI.prepares.push(function () { BI.prepares.push(function () {
BI.Resizers = new BI.ResizeController(); BI.Resizers = new BI.ResizeController();
@ -44775,8 +44836,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
setTextCls: function(cls) { setTextCls: function(cls) {
var o = this.options; var o = this.options;
this.text.element.removeClass(o.textCls).addClass(cls); var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
}, },
setText: function (text) { setText: function (text) {
@ -44916,8 +44978,9 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
setTextCls: function(cls) { setTextCls: function(cls) {
var o = this.options; var o = this.options;
this.text.element.removeClass(o.textCls).addClass(cls); var oldCls = o.textCls;
o.textCls = cls; o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
}, },
setText: function (text) { setText: function (text) {
@ -66485,7 +66548,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
border: 1 border: 1
}, },
props: { props: {
baseCls: "bi-time-combo bi-border bi-border-radius", baseCls: "bi-time-combo bi-border bi-border-radius bi-focus-shadow",
width: 78, width: 78,
height: 22, height: 22,
format: "", format: "",

2
dist/widget.js vendored

@ -21363,7 +21363,7 @@ BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);!(function () {
border: 1 border: 1
}, },
props: { props: {
baseCls: "bi-time-combo bi-border bi-border-radius", baseCls: "bi-time-combo bi-border bi-border-radius bi-focus-shadow",
width: 78, width: 78,
height: 22, height: 22,
format: "", format: "",

9
karma.conf.js

@ -17,6 +17,7 @@ module.exports = function (config) {
"src/css/core/**/*.css", "src/css/core/**/*.css",
"src/css/theme/**/*.css", "src/css/theme/**/*.css",
"src/css/base/**/*.css", "src/css/base/**/*.css",
"src/css/widget/**/*.css",
"src/core/foundation.js", "src/core/foundation.js",
"src/core/lodash.js", "src/core/lodash.js",
"src/core/base.js", "src/core/base.js",
@ -47,6 +48,9 @@ module.exports = function (config) {
"src/base/tree/ztree/list/listasynctree.js", "src/base/tree/ztree/list/listasynctree.js",
"src/base/tree/ztree/list/listparttree.js", "src/base/tree/ztree/list/listparttree.js",
"src/base/**/*.js", "src/base/**/*.js",
"src/case/**/*.js",
"src/widget/**/*.js",
"src/component/**/*.js",
"src/**/*.test.js", "src/**/*.test.js",
"test/**/*.js" "test/**/*.js"
], ],
@ -58,7 +62,10 @@ module.exports = function (config) {
"src/core/alias.js": "coverage", "src/core/alias.js": "coverage",
"src/core/base.js": "coverage", "src/core/base.js": "coverage",
"src/core/func/date.js": "coverage", "src/core/func/date.js": "coverage",
"src/base/**/!(*.test).js": "coverage" "src/base/**/!(*.test).js": "coverage",
"src/case/**/!(*.test).js": "coverage",
"src/widget/**/!(*.test).js": "coverage",
"src/component/**/!(*.test).js": "coverage"
}, },

30
src/base/__test__/a.test.js

@ -0,0 +1,30 @@
/**
* Created by windy on 2018/01/23.
*/
describe("ALinkTest", function () {
/**
* test_author_windy
*/
it("A初始化测试", function () {
var a = BI.Test.createWidget({
type: "bi.a",
text: "CCC"
});
expect(a.element.is('a')).to.equal(true);
});
/**
* test_author_windy
*/
it("A的el测试", function () {
var a = BI.Test.createWidget({
type: "bi.a",
text: "DDD",
el: {
type: "bi.label"
}
});
expect(a.element.is('a') && a.element.hasClass("bi-label")).to.equal(true);
});
});

73
src/base/__test__/text.test.js

@ -81,4 +81,77 @@ describe("TextTest", function () {
expect(text.element.children(".bi-keyword-red-mark").length).to.equal(0); expect(text.element.children(".bi-keyword-red-mark").length).to.equal(0);
text.destroy(); text.destroy();
}); });
/**
* test_author_windy
*/
it("setValue", function () {
var text = BI.Test.createWidget({
type: "bi.text",
value: "AAA",
});
text.setValue("value");
expect(text.element.text()).to.equal("value");
text.destroy();
});
/**
* test_author_windy
*/
it("gap测试", function () {
var text = BI.Test.createWidget({
type: "bi.text",
text: "我是要标红的A",
vgap: 10,
hgap: 10
});
expect(text.element.css("padding")).to.equal("10px");
text.destroy();
});
/**
* test_author_windy
*/
it("空格测试", function () {
var text = BI.Test.createWidget({
type: "bi.text",
text: "我是要标红的 A",
});
expect(text.element.text()).to.equal("我是要标红的 A");
text.destroy();
});
/**
* test_author_windy
*/
it("lineHeight和height", function () {
var text = BI.Test.createWidget({
type: "bi.text",
text: "我是A",
lineHeight: 12,
height: 24
});
expect(text.element.css("height")).to.equal("24px");
expect(text.element.css("line-height")).to.equal("12px");
text.destroy();
});
/**
* test_author_windy
*/
it("handler", function (done) {
var text = BI.Test.createWidget({
type: "bi.text",
text: "我是A",
handler: function () {
text.setText("handler");
}
});
BI.nextTick(function () {
text.text.element.click();
expect(text.text.element.text()).to.equal("handler");
text.destroy();
done();
});
});
}); });

2
src/widget/time/time.combo.js

@ -13,7 +13,7 @@
border: 1 border: 1
}, },
props: { props: {
baseCls: "bi-time-combo bi-border bi-border-radius", baseCls: "bi-time-combo bi-border bi-border-radius bi-focus-shadow",
width: 78, width: 78,
height: 22, height: 22,
format: "", format: "",

Loading…
Cancel
Save