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 = {
children: ComponentChildren;
onClose: () => void;
'data-testid'?: string;
'aria-label'?: string;
};
function NativeDialog({
......@@ -14,6 +15,7 @@ function NativeDialog({
onClose,
children,
'data-testid': testId,
'aria-label': label,
}: DialogProps) {
const dialogRef = useRef<HTMLDialogElement | null>(null);
......@@ -39,6 +41,7 @@ function NativeDialog({
ref={dialogRef}
className="relative w-full h-full backdrop:bg-black/50"
data-testid={testId}
aria-label={label}
>
{children}
</dialog>
......
......@@ -112,10 +112,11 @@ export default function NotebookModal({
closed={isHidden}
onClose={onClose}
data-testid="notebook-outer"
aria-label="Hypothesis notebook"
>
<div className="absolute right-0 m-3">
<IconButton
title="Close the Notebook"
title="Close notebook"
onClick={onClose}
variant="dark"
classes={classnames(
......
......@@ -42,6 +42,7 @@ export default function ProfileModal({ eventBus, config }: ProfileModalProps) {
closed={isHidden}
onClose={onClose}
data-testid="profile-outer"
aria-label="Hypothesis profile"
>
<div className="absolute right-0 m-3">
<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