Browse Source

BI-51100 单测

master
windy 5 years ago
parent
commit
7cd74b998d
  1. 10
      demo/js/widget/singletree/demo.multilayer_single_tree_combo.js
  2. 2
      dist/2.0/fineui.ie.js
  3. 2
      dist/2.0/fineui.js
  4. 2
      dist/bundle.ie.js
  5. 2
      dist/bundle.js
  6. 10
      dist/demo.js
  7. 2
      dist/fineui.ie.js
  8. 2
      dist/fineui.js
  9. 2
      dist/fineui_without_jquery_polyfill.js
  10. 2
      dist/widget.js
  11. 111
      src/widget/dynamicdate/__test__/dynamicdate.combo.test.js

10
demo/js/widget/singletree/demo.multilayer_single_tree_combo.js

@ -16,8 +16,16 @@ Demo.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.tree = _ref;
},
allowEdit: true,
text: "默认值",
items: items,
itemsCreator: function() {
return {
items: [{
value: 1
}],
hasNext: false
}
},
width: 300
}, {
type: "bi.button",

2
dist/2.0/fineui.ie.js vendored

@ -66206,7 +66206,7 @@ BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);BI.DynamicDat
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],

2
dist/2.0/fineui.js vendored

@ -66610,7 +66610,7 @@ BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);BI.DynamicDat
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],

2
dist/bundle.ie.js vendored

@ -66206,7 +66206,7 @@ BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);BI.DynamicDat
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],

2
dist/bundle.js vendored

@ -66610,7 +66610,7 @@ BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);BI.DynamicDat
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],

10
dist/demo.js vendored

@ -10586,8 +10586,16 @@ Demo.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
ref: function (_ref) {
self.tree = _ref;
},
allowEdit: true,
text: "默认值",
items: items,
itemsCreator: function() {
return {
items: [{
value: 1
}],
hasNext: false
}
},
width: 300
}, {
type: "bi.button",

2
dist/fineui.ie.js vendored

@ -66451,7 +66451,7 @@ BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);BI.DynamicDat
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],

2
dist/fineui.js vendored

@ -66855,7 +66855,7 @@ BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);BI.DynamicDat
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],

2
dist/fineui_without_jquery_polyfill.js vendored

@ -49154,7 +49154,7 @@ BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);BI.DynamicDat
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],

2
dist/widget.js vendored

@ -4264,7 +4264,7 @@ BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);BI.DynamicDat
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getLastChangedValue(), BI.DynamicDateTimeSelect.MINUTE);
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],

111
src/widget/dynamicdate/__test__/dynamicdate.combo.test.js

@ -89,20 +89,117 @@ describe("DateCombo", function () {
var dateCombo = BI.Test.createWidget({
type: "bi.dynamic_date_combo",
width: 220,
height: 30
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 () {
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-popup-view").css("display")).to.equal("none");
dateCombo.destroy();
done();
}, 300);
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.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();
})
});

Loading…
Cancel
Save