From badce5560676aa92a09c0547421770e2eb8db58d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BF=94?= Date: Fri, 6 Mar 2026 17:49:27 +0800 Subject: [PATCH] feat: add data-testid and data-type support to Toast component --- src/components/ui/toast.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/ui/toast.tsx b/src/components/ui/toast.tsx index 9e76566..88fa7dc 100644 --- a/src/components/ui/toast.tsx +++ b/src/components/ui/toast.tsx @@ -8,13 +8,15 @@ interface ToastProps { type?: 'success' | 'error' | 'info'; duration?: number; onClose: () => void; + 'data-testid'?: string; } export function Toast({ message, type = 'success', duration = 3000, - onClose + onClose, + 'data-testid': dataTestId }: ToastProps) { const [isVisible, setIsVisible] = useState(true); @@ -41,6 +43,8 @@ export function Toast({ return (