Skip to content

Commit

Permalink
Merge "[FIX] sap.m.DateTimePicker: Now in IE the hour slider is initi…
Browse files Browse the repository at this point in the history
…ally opened" into rel-1.65
  • Loading branch information
DMihaylova authored and Gerrit Code Review committed Jun 28, 2019
2 parents edb381b + 5bd6512 commit 8e3ac7b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/sap.m/src/sap/m/TimePickerSliders.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ sap.ui.define([

this.$().on('selectstart', fnFalse);

if (!Device.browser.msie && this._getShouldOpenSliderAfterRendering()) {
if (this._getShouldOpenSliderAfterRendering()) {
/* This method is called here prematurely to ensure slider loading on time.
* Make sure _the browser native focus_ is not actually set on the early call (the "true" param)
* because that fires events and results in unexpected behaviors */
Expand Down
8 changes: 6 additions & 2 deletions src/sap.m/test/sap/m/qunit/DateTimePicker.qunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,22 @@ sap.ui.define([
QUnit.test("Time sliders are updated right after popup is open", function(assert) {
var done = assert.async();
//Prepare
var oDTP = new DateTimePicker().placeAt("uiArea1");
var oDTP = new DateTimePicker().placeAt("uiArea1"),
oTPS,
oSpyUpdateSlidersFn;
sap.ui.getCore().applyChanges();

oDTP._createPopup();
oDTP._createPopupContent();
var oSpyUpdateSlidersFn = sinon.spy(oDTP._oPopup.getContent()[0].getTimeSliders(), "_updateSlidersValues");
oTPS = oDTP._oPopup.getContent()[0].getTimeSliders();
oSpyUpdateSlidersFn = sinon.spy(oTPS, "_updateSlidersValues");

//Act
oDTP._openPopup();
setTimeout(function() {
//Assert
assert.equal(oSpyUpdateSlidersFn.callCount, 1, "Once picker is opened, function updateSlidersValues should be called");
assert.ok(oTPS._getFirstSlider().getIsExpanded(), "Once picker is opened, the first slider is expanded");

//Cleanup
oSpyUpdateSlidersFn.restore();
Expand Down
5 changes: 1 addition & 4 deletions src/sap.m/test/sap/m/qunit/TimePickerSliders.qunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,12 @@ sap.ui.define([
});

QUnit.test("Call to collapseAll should close all sliders", function (assert) {
var aSliders = [];
aSliders = this.oTPS.getAggregation("_columns");
var aSliders = this.oTPS.getAggregation("_columns");
aSliders[0].setIsExpanded(true);

this.oTPS.collapseAll();
sap.ui.getCore().applyChanges();

aSliders = this.oTPS.getAggregation("_columns");

aSliders.forEach(function (oSlider, index) {
assert.equal(oSlider.getIsExpanded(), false, "slider " + index + " is not expanded");
});
Expand Down

0 comments on commit 8e3ac7b

Please sign in to comment.