import { describe, expect, it } from 'vitest' import { getToastDismissDuration, type ToastItem } from './Toast' const toast = (item: Omit): ToastItem => ({ id: 'toast-1', ...item, }) describe('getToastDismissDuration', () => { it('uses custom duration when provided', () => { expect( getToastDismissDuration(toast({ type: 'success', title: '저장 완료', duration: 1000 })) ).toBe(1000) }) it('keeps error toasts sticky by default', () => { expect(getToastDismissDuration(toast({ type: 'error', title: '오류 발생' }))).toBeNull() }) it('disables auto-dismiss when duration is zero', () => { expect( getToastDismissDuration(toast({ type: 'warning', title: '수동 확인 필요', duration: 0 })) ).toBeNull() }) })