martin-markovic / learn-connect

Multi-feature platform designed to enhance the online learning experience.
MIT License
0 stars 0 forks source link

Implement Integration Tests for AuthService and QuizService #18

Closed martin-markovic closed 1 month ago

martin-markovic commented 1 month ago

Summary

This pull request adds comprehensive integration tests for the authService and quizService functions. The tests cover user registration, login, logout, and CRUD operations for quizzes, ensuring that the API endpoints and services function correctly and handle data appropriately.

Changes

  1. Integration Tests for AuthService

    • Implemented integration tests for registerUser, loginUser, and logoutUser functions.
    • Set up and tore down test user data with API calls in the before code block.
    • Ensured localStorage is cleared and managed between tests in the after code block.
  2. Integration Tests for QuizService

    • Implemented integration tests for createQuiz, getQuizzes, getQuizById, updateQuiz, and deleteQuiz functions.
    • Used nock to mock API requests and validate responses.
    • Added checks for expected successful data creation, retrieval, updating, and deletion.

Testing

Additional Information