Fix Toast aria role

This commit is contained in:
Kalle
2026-09-09 20:40:28 +03:00
parent 62ef8afc7f
commit 621ad5e200
2 changed files with 2 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ describe("Toast", () => {
toastQueue.add({ message: "Dismiss me", variant: "info" }, { timeout: 0 });
const toast = screen.getByRole("alert").filter({ hasText: "Dismiss me" });
const toast = screen.getByRole("status").filter({ hasText: "Dismiss me" });
await expect.element(toast).toBeVisible();
await screen.getByLabelText("Close").first().click();

View File

@@ -99,7 +99,7 @@ export function SendouToastRegion() {
{toasts.map((toast) => (
<div
key={toast.key}
role="alert"
role={toast.content.variant === "error" ? "alert" : "status"}
style={{ viewTransitionName: toast.key }}
className={clsx(styles.toast, {
[styles.errorToast]: toast.content.variant === "error",