Skip to content

refactor(dashboard): add error boundary component test for DashboardError #391

@JhaSourav07

Description

@JhaSourav07

🧩 Background

app/(root)/dashboard/error.tsx has logic to detect rate limit and not-found error types from the message string. This parsing has no tests.

🎯 Objective

Create app/(root)/dashboard/error.test.tsx verifying that the correct headline and emoji render for each error type.

📁 Files to touch

  • app/(root)/dashboard/error.test.tsx (new)

🛠️ Implementation steps

  • Render with error.message = 'API limit reached' → assert emoji appears.
  • Render with error.message = 'User not found' → assert 🕵️‍♂️ emoji appears.
  • Render with a generic error → assert ⚠️ emoji.

✅ Definition of done

  • 3 test cases.
  • vitest run passes.

Metadata

Metadata

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions