Skip to content

Commit

Permalink
[FIX] m.MenuItem: Visible and enabled properties work correctly
Browse files Browse the repository at this point in the history
Fixes #1088
BCP: 1680193329

Change-Id: Ibb44c51d91c8b559b30d341cefa1979872455b5d
CR-Id: 012006153200001417122016
  • Loading branch information
Alexander Ivanov committed Aug 12, 2016
1 parent 8e4d177 commit 6355c1a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sap.m/src/sap/m/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ sap.ui.define(['jquery.sap.global', './library', 'sap/ui/core/Control', './Butto
icon: oItem.getIcon(),
text: oItem.getText(),
startsSection: oItem.getStartsSection(),
tooltip: oItem.getTooltip()
tooltip: oItem.getTooltip(),
visible: oItem.getVisible(),
enabled: oItem.getEnabled()
});
};

Expand Down
22 changes: 22 additions & 0 deletions src/sap.m/test/sap/m/qunit/Menu.qunit.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,31 @@
test("tooltip", function() {
this.sut.openBy();
var oItemFridge = this.sut._getMenu().getItems()[0];

//Assert
equals(oItemFridge.getTooltip(), "it's cold in here", "item has a tooltip");
});

test("visible", function() {
//Act
this.sut.getItems()[0].setVisible(false);
this.sut.openBy();
var oItemFridge = this.sut._getMenu().getItems()[0];

//Assert
equals(oItemFridge.getVisible(), false, "menu item is not visible");
});

test("enabled", function() {
//Act
this.sut.getItems()[0].setEnabled(false);
this.sut.openBy();
var oItemFridge = this.sut._getMenu().getItems()[0];

//Assert
equals(oItemFridge.getEnabled(), false, "menu item is not enabled");
});

test('Opening/closing/reopening', function () {
//Assert
strictEqual(this.sut._getVisualParent(), null, 'The menu is not initially rendered');
Expand Down

0 comments on commit 6355c1a

Please sign in to comment.