Skip to content

[Feature/Testing]: Implement Comprehensive Unit and End-to-End (E2E) Testing Suites #987

@ArshVermaGit

Description

@ArshVermaGit

Overview Although the repository contains the foundational scaffolding and configuration files for modern testing frameworks (playwright.config.ts for E2E tests and vitest.config.ts for Unit tests), the codebase critically lacks actual test implementation. There are currently no .test.ts or .spec.ts files verifying the core logic modules, meaning the application is being developed and deployed without any automated safety nets.

Impact & Current State For a complex, feature-rich application that handles real-time WebRTC rooms, live chat modules, complex gamification leaderboards, and mentorship matching, relying solely on manual testing is unsustainable. Without automated tests, every new pull request carries a high risk of introducing invisible regressions into existing features. Refactoring tightly-coupled components or updating database schemas becomes exceptionally dangerous, as developers have no programmatic way to verify that their changes haven't broken downstream functionality.

Proposed Solution This issue proposes a phased rollout of a comprehensive testing suite to establish a culture of test-driven reliability.

Core Unit Tests (Vitest): Begin by writing unit tests for pure utility functions in src/lib/ and custom data-fetching hooks in src/hooks/. Ensure complex business logic (like leaderboard sorting or auth validation) is verified in isolation.
Component Tests (Vitest + React Testing Library): Implement integration tests for critical, highly-interactive UI components (e.g., Chatbot.tsx, MentorForm.tsx) to verify rendering states and user event interactions.
End-to-End Tests (Playwright): Develop critical-path E2E tests mimicking real user flows, such as logging in, scheduling a session, creating a study room, or submitting a portfolio.
Backend/Edge Tests: Ensure any Supabase Edge Functions in supabase/functions/ have corresponding execution tests.
Impacted Folders (Coverage Needed):

src/components/
src/hooks/
src/pages/
src/lib/
supabase/functions/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions