Commit bdcb3c23 authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Add accessible names to profile and notebook dialogs

parent 3e8d9d68
...@@ -7,6 +7,7 @@ type DialogProps = { ...@@ -7,6 +7,7 @@ type DialogProps = {
children: ComponentChildren; children: ComponentChildren;
onClose: () => void; onClose: () => void;
'data-testid'?: string; 'data-testid'?: string;
'aria-label'?: string;
}; };
function NativeDialog({ function NativeDialog({
...@@ -14,6 +15,7 @@ function NativeDialog({ ...@@ -14,6 +15,7 @@ function NativeDialog({
onClose, onClose,
children, children,
'data-testid': testId, 'data-testid': testId,
'aria-label': label,
}: DialogProps) { }: DialogProps) {
const dialogRef = useRef<HTMLDialogElement | null>(null); const dialogRef = useRef<HTMLDialogElement | null>(null);
...@@ -39,6 +41,7 @@ function NativeDialog({ ...@@ -39,6 +41,7 @@ function NativeDialog({
ref={dialogRef} ref={dialogRef}
className="relative w-full h-full backdrop:bg-black/50" className="relative w-full h-full backdrop:bg-black/50"
data-testid={testId} data-testid={testId}
aria-label={label}
> >
{children} {children}
</dialog> </dialog>
......
...@@ -112,10 +112,11 @@ export default function NotebookModal({ ...@@ -112,10 +112,11 @@ export default function NotebookModal({
closed={isHidden} closed={isHidden}
onClose={onClose} onClose={onClose}
data-testid="notebook-outer" data-testid="notebook-outer"
aria-label="Hypothesis notebook"
> >
<div className="absolute right-0 m-3"> <div className="absolute right-0 m-3">
<IconButton <IconButton
title="Close the Notebook" title="Close notebook"
onClick={onClose} onClick={onClose}
variant="dark" variant="dark"
classes={classnames( classes={classnames(
......
...@@ -42,6 +42,7 @@ export default function ProfileModal({ eventBus, config }: ProfileModalProps) { ...@@ -42,6 +42,7 @@ export default function ProfileModal({ eventBus, config }: ProfileModalProps) {
closed={isHidden} closed={isHidden}
onClose={onClose} onClose={onClose}
data-testid="profile-outer" data-testid="profile-outer"
aria-label="Hypothesis profile"
> >
<div className="absolute right-0 m-3"> <div className="absolute right-0 m-3">
<IconButton <IconButton
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment