Add tests for Modal (#2731)

* Add Modal tests.

* fix type

* apply review feedback

* lint

* remove act
This commit is contained in:
Will Hunt
2024-11-07 17:06:49 +00:00
committed by GitHub
parent 9bf40eda25
commit 938beccb6e
4 changed files with 158 additions and 4 deletions

View File

@@ -89,6 +89,7 @@ export const Modal: FC<Props> = ({
styles.drawer,
{ [styles.tabbed]: tabbed },
)}
role="dialog"
// Suppress the warning about there being no description; the modal
// has an accessible title
aria-describedby={undefined}
@@ -114,9 +115,14 @@ export const Modal: FC<Props> = ({
<DialogOverlay
className={classNames(overlayStyles.bg, overlayStyles.animate)}
/>
{/* Suppress the warning about there being no description; the modal
has an accessible title */}
<DialogContent asChild aria-describedby={undefined} {...rest}>
<DialogContent
asChild
// Suppress the warning about there being no description; the modal
// has an accessible title
aria-describedby={undefined}
role="dialog"
{...rest}
>
<Glass
className={classNames(
className,