web-planer icon indicating copy to clipboard operation
web-planer copied to clipboard

Feat/vitest testing library msw

Open D0dii opened this issue 5 months ago • 1 comments

Adding tests setup

  • vitest
  • react-testing-library
  • msw

[!IMPORTANT] Introduces Vitest, React Testing Library, and MSW for testing with new test files, mock handlers, and configuration updates.

  • Testing Setup:
    • Introduces vitest, react-testing-library, and msw for testing.
    • Adds vitest.config.mts for Vitest configuration with jsdom environment and setup files.
  • Tests:
    • Adds plans-edit.test.tsx to test error handling in CreateNewPlanPage.
    • Adds plans.test.tsx to test error handling in PlanItem.
  • Mocks:
    • Adds handlers.ts and server.ts for MSW mock server setup.
    • Mock handlers simulate API errors for departments, registrations, and course loading.
  • Scripts:
    • Updates package.json scripts to include vitest commands for testing.
  • Misc:
    • Adds error toast in app-sidebar.tsx for registration fetch failures.
    • Adds setup.ts for test environment setup with global mocks and server lifecycle management.

This description was created by Ellipsis for 463a6dd97ce70c6114bac29e05f4609298163c73. You can customize this summary. It will automatically update as commits are pushed.

D0dii avatar Jul 24 '25 19:07 D0dii

I know it isn't the prettiest code but for now I'm tired and don't have energy for it

D0dii avatar Jul 29 '25 20:07 D0dii