From caa09c9b2f0dc257a045d53295325b7a5895397f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=BAcio=20BJ?= Date: Wed, 30 Jul 2025 15:21:42 -0300 Subject: [PATCH 1/5] feature/BA-2628-add-aria-label-and-alt-text-to-profile-images-and-inputs-for-tests-component-identification --- .../modules/profiles/web/ProfileSettingsComponent/index.tsx | 5 +++++ .../components/web/avatars/AvatarWithPlaceholder/index.tsx | 3 ++- .../components/web/avatars/CircledAvatar/index.tsx | 2 ++ .../components/web/buttons/FileUploadButton/index.tsx | 5 +++-- .../components/web/buttons/FileUploadButton/types.ts | 6 ++++-- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/packages/components/modules/profiles/web/ProfileSettingsComponent/index.tsx b/packages/components/modules/profiles/web/ProfileSettingsComponent/index.tsx index fef795a0..f5c14341 100644 --- a/packages/components/modules/profiles/web/ProfileSettingsComponent/index.tsx +++ b/packages/components/modules/profiles/web/ProfileSettingsComponent/index.tsx @@ -150,6 +150,7 @@ const ProfileSettingsComponent: FC = ({ profile: width={144} height={144} hasError={!!getFieldState('image').error} + alt='Avatar image' /> {getFieldState('image').error && (
@@ -165,6 +166,7 @@ const ProfileSettingsComponent: FC = ({ profile: accept={DEFAULT_IMAGE_FORMATS} maxSize={DEFAULT_IMAGE_MAX_SIZE} label={hasUploadedImage ? 'Change Image' : 'Upload Image'} + aria-label='Avatar image' /> {watchImage && ( = ({ profile: loading={isMutationInFlight} disabled={isMutationInFlight} onClick={() => handleRemoveImage(PROFILE_FORM_VALUE.image)} + aria-label='Remove avatar button' > Remove @@ -243,6 +246,7 @@ const ProfileSettingsComponent: FC = ({ profile: maxSize={DEFAULT_BANNER_IMAGE_MAX_SIZE} label={hasUploadedBannerImage ? 'Change Banner' : 'Upload Banner'} sx={{ maxWidth: 'fit-content', justifySelf: 'end' }} + aria-label='Banner image' /> {watchBannerImage && ( = ({ profile: loading={isMutationInFlight} disabled={isMutationInFlight} sx={{ maxWidth: 'fit-content' }} + aria-label='Remove banner button' > Remove diff --git a/packages/design-system/components/web/avatars/AvatarWithPlaceholder/index.tsx b/packages/design-system/components/web/avatars/AvatarWithPlaceholder/index.tsx index 24dc1936..afd61818 100644 --- a/packages/design-system/components/web/avatars/AvatarWithPlaceholder/index.tsx +++ b/packages/design-system/components/web/avatars/AvatarWithPlaceholder/index.tsx @@ -8,9 +8,10 @@ const AvatarWithPlaceholder: FC = ({ width = 40, height = 40, children, + alt, ...props }) => ( - + {children || ( )} diff --git a/packages/design-system/components/web/avatars/CircledAvatar/index.tsx b/packages/design-system/components/web/avatars/CircledAvatar/index.tsx index 3f793f07..977a9d42 100644 --- a/packages/design-system/components/web/avatars/CircledAvatar/index.tsx +++ b/packages/design-system/components/web/avatars/CircledAvatar/index.tsx @@ -11,6 +11,7 @@ const CircledAvatar: FC = ({ height = 40, hasError, children, + alt, ...props }) => ( @@ -18,6 +19,7 @@ const CircledAvatar: FC = ({ width={width} height={height} sx={({ palette }) => ({ border: `solid 8px ${palette.background.default}` })} + alt={alt} {...props} > {children} diff --git a/packages/design-system/components/web/buttons/FileUploadButton/index.tsx b/packages/design-system/components/web/buttons/FileUploadButton/index.tsx index 136d3405..be4cdbd4 100644 --- a/packages/design-system/components/web/buttons/FileUploadButton/index.tsx +++ b/packages/design-system/components/web/buttons/FileUploadButton/index.tsx @@ -12,8 +12,9 @@ import { FileUploadButtonProps } from './types' const FileUploadButton: FC = (props) => { const fileRef = useRef(undefined) const { sendToast } = useNotification() - const { accept, maxSize, ...fileUploadProps } = props + const { accept, maxSize, 'aria-label': ariaLabel, ...fileUploadProps } = props const { control, label, name, setFile } = fileUploadProps + return ( <>