From 64e5374082f06a92b69aa25de2fa6ceab05d5572 Mon Sep 17 00:00:00 2001 From: Federico Bernal <64086728+FedericoBernal@users.noreply.github.com> Date: Thu, 9 Dec 2021 17:00:43 -0300 Subject: [PATCH 1/4] Fix shortcut announce --- packages/sdk/ui-react/src/widget/menu/menuItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk/ui-react/src/widget/menu/menuItem.tsx b/packages/sdk/ui-react/src/widget/menu/menuItem.tsx index 2cd3ad4fa..7a5c007e5 100644 --- a/packages/sdk/ui-react/src/widget/menu/menuItem.tsx +++ b/packages/sdk/ui-react/src/widget/menu/menuItem.tsx @@ -64,7 +64,7 @@ export class MenuItemComp extends React.Component Date: Fri, 10 Dec 2021 12:10:14 -0300 Subject: [PATCH 2/4] Validate subtext --- .../sdk/ui-react/src/widget/menu/menuItem.tsx | 48 +++++++++++++------ 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/packages/sdk/ui-react/src/widget/menu/menuItem.tsx b/packages/sdk/ui-react/src/widget/menu/menuItem.tsx index 7a5c007e5..12a6a62da 100644 --- a/packages/sdk/ui-react/src/widget/menu/menuItem.tsx +++ b/packages/sdk/ui-react/src/widget/menu/menuItem.tsx @@ -62,21 +62,39 @@ export class MenuItemComp extends React.Component; default: - return ( -
  • - {checked && } - {label} - {subtext && {subtext}} -
  • - ); + if (subtext == undefined) { + return ( +
  • + {checked && } + {label} + {subtext && {subtext}} +
  • + ); + } else { + return ( +
  • + {checked && } + {label} + {subtext && {subtext}} +
  • + ); + } } } From 17353d5f8e95c69d1772cca64ff67b2519f6d6e7 Mon Sep 17 00:00:00 2001 From: Federico Bernal <64086728+FedericoBernal@users.noreply.github.com> Date: Fri, 10 Dec 2021 12:25:08 -0300 Subject: [PATCH 3/4] fix subtext validation --- .../sdk/ui-react/src/widget/menu/menuItem.tsx | 50 +++++++------------ 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/packages/sdk/ui-react/src/widget/menu/menuItem.tsx b/packages/sdk/ui-react/src/widget/menu/menuItem.tsx index 12a6a62da..eb9f11f76 100644 --- a/packages/sdk/ui-react/src/widget/menu/menuItem.tsx +++ b/packages/sdk/ui-react/src/widget/menu/menuItem.tsx @@ -62,39 +62,23 @@ export class MenuItemComp extends React.Component; default: - if (subtext == undefined) { - return ( -
  • - {checked && } - {label} - {subtext && {subtext}} -
  • - ); - } else { - return ( -
  • - {checked && } - {label} - {subtext && {subtext}} -
  • - ); - } + return ( +
  • + {checked && } + {label} + {subtext && {subtext}} +
  • + ); } } From c2fa58731db20dd58183a5d1b0824bdb77417aaf Mon Sep 17 00:00:00 2001 From: Federico Bernal <64086728+FedericoBernal@users.noreply.github.com> Date: Fri, 10 Dec 2021 12:37:43 -0300 Subject: [PATCH 4/4] Fix failing test --- packages/sdk/ui-react/src/widget/menu/menuItem.spec.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk/ui-react/src/widget/menu/menuItem.spec.tsx b/packages/sdk/ui-react/src/widget/menu/menuItem.spec.tsx index ceddd8b45..2986f90db 100644 --- a/packages/sdk/ui-react/src/widget/menu/menuItem.spec.tsx +++ b/packages/sdk/ui-react/src/widget/menu/menuItem.spec.tsx @@ -54,7 +54,7 @@ describe('', () => { expect(instance).toBeTruthy(); expect(wrapper.html().includes('Fullscreen')).toBe(true); expect(wrapper.html().includes('F11')).toBe(true); - expect(outerLiElement.getAttribute('aria-label')).toBe('Fullscreen checked'); + expect(outerLiElement.getAttribute('aria-label')).toBe('FullscreenF11 checked'); }); it('should render a disabled menu item without any errors', () => {