diff --git a/app/(root)/dashboard/error.empty-fallback.test.tsx b/app/(root)/dashboard/error.empty-fallback.test.tsx index 16ea3629c..f09dd3a62 100644 --- a/app/(root)/dashboard/error.empty-fallback.test.tsx +++ b/app/(root)/dashboard/error.empty-fallback.test.tsx @@ -1,8 +1,9 @@ // app/(root)/dashboard/error.empty-fallback.test.tsx -import { describe, expect, it, vi } from 'vitest'; -import { render, screen } from '@testing-library/react'; import '@testing-library/jest-dom/vitest'; +import { render, screen } from '@testing-library/react'; +import { describe, it, expect, vi } from 'vitest'; +import DashboardError from './error'; vi.mock('next/link', () => ({ default: ({ @@ -13,8 +14,6 @@ vi.mock('next/link', () => ({ ), })); -import DashboardError from './error'; - describe('Dashboard Error Page - Empty & Missing Input Fallbacks', () => { it('renders successfully when error is null', () => { expect(() => @@ -70,6 +69,14 @@ describe('Dashboard Error Page - Empty & Missing Input Fallbacks', () => { ).toBeInTheDocument(); }); + it('renders without errors when the optional digest field is absent', () => { + const error = new Error('Unexpected failure') as Error & { digest?: string }; + + expect(() => render()).not.toThrow(); + + expect(screen.getByText('⚠️')).toBeInTheDocument(); + }); + it('renders interactive elements correctly in fallback state', () => { render();