Skip to content

Commit

Permalink
Replace dash with underscore to match with enum values #2917
Browse files Browse the repository at this point in the history
(cherry picked from commit b73c5e0)
  • Loading branch information
ilushaaa committed Mar 15, 2024
1 parent bf4c990 commit aeead3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ protected VaadinIcon getVaadinIcon(String iconString) {
if (!parts[0].equals("vaadin")) {
return null;
}
return VaadinIcon.valueOf(parts[1].toUpperCase());
return VaadinIcon.valueOf(parts[1].toUpperCase().replace('-', '_'));
} else {
return VaadinIcon.valueOf(iconString);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ListMenuTest extends FlowuiTestSpecification {
description="Description">
<item view="ListMenuTestView"
title="List menu test view"
icon="ABACUS"
icon="vaadin:academy-cap"
description="Description"
shortcutCombination="O"/>
<item bean="TestMenuItemBean"
Expand Down Expand Up @@ -91,9 +91,9 @@ class ListMenuTest extends FlowuiTestSpecification {
def menuItem = listMenu.getMenuItem("ListMenuTestView")
menuItem != null
menuItem.title == "List menu test view"
menuItem.icon == VaadinIcon.ABACUS
menuItem.icon == VaadinIcon.ACADEMY_CAP
(menuItem.prefixComponent as Icon).element.getAttribute("icon") ==
VaadinIcon.ABACUS.create().element.getAttribute("icon")
VaadinIcon.ACADEMY_CAP.create().element.getAttribute("icon")
menuItem.description == "Description"
menuItem.shortcutCombination.key.keys.get(0) == "KeyO"

Expand Down

0 comments on commit aeead3d

Please sign in to comment.