Browse Source

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

* commit '5d53c42f268c6c23b83f74fdaa0ff780ca84c8d0':
  REPORT-29006 fix: 默认值问题
  BI-61182 test: 修复改了text空格显示后的报错单测
es6
windy 5 years ago
parent
commit
d8f0caf2be
  1. 2
      src/base/single/__test__/text.test.js
  2. 4
      src/base/tree/ztree/list/listtreeview.js
  3. 49
      src/case/loader/__test__/loader.lazy.test.js
  4. 3
      src/case/loader/loader.lazy.js
  5. 2
      src/core/__test__/alias.test.js
  6. 6
      src/widget/datetime/__test__/datetime.test.js
  7. 4
      src/widget/dynamicdatetime/__test__/dynamicdatetime.test.js
  8. 2
      src/widget/timeinterval/__test__/timeinterval.test.js

2
src/base/single/__test__/text.test.js

@ -117,7 +117,7 @@ describe("TextTest", function () {
type: "bi.text", type: "bi.text",
text: "我是要标红的 A", text: "我是要标红的 A",
}); });
expect(text.element.text()).to.equal("我是要标红的 A"); expect(text.element.text()).to.equal("我是要标红的 A");
text.destroy(); text.destroy();
}); });

4
src/base/tree/ztree/list/listtreeview.js

@ -12,7 +12,9 @@ BI.ListTreeView = BI.inherit(BI.TreeView, {
}, },
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.ListTreeView.superclass._defaultConfig.apply(this, arguments), {}); return BI.extend(BI.ListTreeView.superclass._defaultConfig.apply(this, arguments), {
value: {}
});
}, },
_init: function () { _init: function () {
BI.ListTreeView.superclass._init.apply(this, arguments); BI.ListTreeView.superclass._init.apply(this, arguments);

49
src/case/loader/__test__/loader.lazy.test.js

@ -0,0 +1,49 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2020/4/3
*/
describe("lazy_loader", function () {
/**
* test_author_windy
**/
it("setValue", function () {
var items = BI.map(BI.range(0, 100), function (idx, v) {
return {
type: "bi.single_select_item",
text: v,
value: v
}
});
var widget = BI.Test.createWidget({
type: "bi.lazy_loader",
el: {
layouts: [{
type: "bi.left",
hgap: 5
}]
}
});
widget.populate(items);
expect(widget.getAllButtons().length).to.equal(100);
widget.addItems([{
type: "bi.single_select_item",
text: 102,
value: 102
}, {
type: "bi.single_select_item",
text: 103,
value: 103
}]);
expect(widget.getAllLeaves().length).to.equal(102);
widget.setValue(102);
expect(widget.getValue()[0]).to.equal(102);
expect(widget.getSelectedButtons().length).to.equal(1);
widget.setNotSelectedValue(102);
expect(widget.getNotSelectedValue()[0]).to.equal(102);
expect(widget.getNotSelectedButtons().length).to.equal(1);
widget.destroy();
});
});

3
src/case/loader/loader.lazy.js

@ -8,7 +8,8 @@ BI.LazyLoader = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.LazyLoader.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.LazyLoader.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-lazy-loader", baseCls: "bi-lazy-loader",
el: {} el: {},
items: []
}); });
}, },

2
src/core/__test__/alias.test.js

@ -18,7 +18,7 @@ describe("aliasFunctionTest", function () {
var targetString = "<a>1 2&</a>"; var targetString = "<a>1 2&</a>";
var encodeString = BI.htmlEncode(targetString); var encodeString = BI.htmlEncode(targetString);
expect(encodeString).to.equal("&lt;a&gt;1&nbsp;2&amp;&lt;/a&gt;"); expect(encodeString).to.equal("&lt;a&gt;1 2&amp;&lt;/a&gt;");
expect(BI.htmlDecode(encodeString)).to.equal(targetString); expect(BI.htmlDecode(encodeString)).to.equal(targetString);
}); });

6
src/widget/datetime/__test__/datetime.test.js

@ -28,7 +28,7 @@ describe("DateTime", function () {
second: 12 second: 12
} }
}); });
expect(dateCombo.element.find(".bi-date-time-trigger .bi-label").text()).to.equal("2018-02-23 12:12:12"); expect(dateCombo.element.find(".bi-date-time-trigger .bi-label").text()).to.equal("2018-02-23 12:12:12");
dateCombo.destroy(); dateCombo.destroy();
}); });
@ -51,7 +51,7 @@ describe("DateTime", function () {
BI.nextTick(function () { BI.nextTick(function () {
dateCombo.element.find(".bi-calendar:visible .bi-list-item-select :contains(16)").parent().click(); dateCombo.element.find(".bi-calendar:visible .bi-list-item-select :contains(16)").parent().click();
dateCombo.element.find(".bi-date-time-popup .bi-text:contains(确定)").parent().click(); dateCombo.element.find(".bi-date-time-popup .bi-text:contains(确定)").parent().click();
expect(dateCombo.element.find(".bi-date-time-trigger .bi-label").text()).to.equal("2018-02-16 12:12:12"); expect(dateCombo.element.find(".bi-date-time-trigger .bi-label").text()).to.equal("2018-02-16 12:12:12");
dateCombo.destroy(); dateCombo.destroy();
done(); done();
}) })
@ -77,7 +77,7 @@ describe("DateTime", function () {
BI.nextTick(function () { BI.nextTick(function () {
dateCombo.element.find(".bi-calendar:visible .bi-list-item-select :contains(16)").parent().click(); dateCombo.element.find(".bi-calendar:visible .bi-list-item-select :contains(16)").parent().click();
dateCombo.element.find(".bi-date-time-popup .bi-text:contains(取消)").parent().click(); dateCombo.element.find(".bi-date-time-popup .bi-text:contains(取消)").parent().click();
expect(dateCombo.element.find(".bi-date-time-trigger .bi-label").text()).to.equal("2018-02-23 12:12:12"); expect(dateCombo.element.find(".bi-date-time-trigger .bi-label").text()).to.equal("2018-02-23 12:12:12");
dateCombo.destroy(); dateCombo.destroy();
done(); done();
}) })

4
src/widget/dynamicdatetime/__test__/dynamicdatetime.test.js

@ -32,7 +32,7 @@ describe("DateTimeCombo", function () {
} }
}); });
BI.nextTick(function () { BI.nextTick(function () {
expect(dateCombo.element.find(".bi-date-time-trigger .bi-label").text()).to.equal("2018-02-23 12:12:12"); expect(dateCombo.element.find(".bi-date-time-trigger .bi-label").text()).to.equal("2018-02-23 12:12:12");
dateCombo.destroy(); dateCombo.destroy();
done(); done();
}) })
@ -318,7 +318,7 @@ describe("DateTimeCombo", function () {
input.val("2017-1-1"); input.val("2017-1-1");
BI.Test.triggerKeyDown(dateCombo.element.find(".bi-date-time-trigger .bi-input"), null, BI.KeyCode.ENTER, function () { BI.Test.triggerKeyDown(dateCombo.element.find(".bi-date-time-trigger .bi-input"), null, BI.KeyCode.ENTER, function () {
BI.delay(function () { BI.delay(function () {
expect(dateCombo.element.find(".bi-date-time-trigger .bi-text-button").text()).to.equal("2017-01-01 00:00:00"); expect(dateCombo.element.find(".bi-date-time-trigger .bi-text-button").text()).to.equal("2017-01-01 00:00:00");
dateCombo.destroy(); dateCombo.destroy();
done(); done();
}, 300); }, 300);

2
src/widget/timeinterval/__test__/timeinterval.test.js

@ -61,7 +61,7 @@ describe("DateInterval", function () {
} }
}, },
}); });
expect(dateInterval.element.find(".bi-date-time-trigger .bi-label").text()).to.equal("2018-01-12 10:10:102019-01-01 00:00:00"); expect(dateInterval.element.find(".bi-date-time-trigger .bi-label").text()).to.equal("2018-01-12 10:10:102019-01-01 00:00:00");
dateInterval.destroy(); dateInterval.destroy();
}); });

Loading…
Cancel
Save