Skip to content

Commit

Permalink
fix(mrc): icon actionmenu compact ellipsisvertical (#14176)
Browse files Browse the repository at this point in the history
Fixed a bug that prevented to set custom icon
ref: 14172

Signed-off-by: Tristan WAGNER <[email protected]>
  • Loading branch information
tristanwagner authored Nov 20, 2024
1 parent 6bc40ca commit 7a3f02a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ export const ActionMenu: React.FC<ActionMenuProps> = ({
onClick={() => setIsTrigger(true)}
{...(!isCompact && { label: t('common_actions') })}
icon={
icon ?? isCompact
? ODS_ICON_NAME.ellipsisHorizontal
: ODS_ICON_NAME.chevronDown
icon ||
(isCompact
? ODS_ICON_NAME.ellipsisVertical
: ODS_ICON_NAME.chevronDown)
}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ describe('ActionMenu', () => {
const actionMenuIcon = screen.getByTestId(
'navigation-action-trigger-action',
);
expect(actionMenuIcon.getAttribute('icon')).toBe('ellipsis-horizontal');
expect(actionMenuIcon.getAttribute('icon')).toBe('ellipsis-vertical');
});

it('renders compact menu with custom icon menu correctly', async () => {
await setupSpecTest({
icon: ODS_ICON_NAME.ellipsisVertical,
icon: ODS_ICON_NAME.ellipsisHorizontal,
});
const actionMenuIcon = screen.getByTestId(
'navigation-action-trigger-action',
Expand Down

0 comments on commit 7a3f02a

Please sign in to comment.