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
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.
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
Verified the correct functionality of registerUser, loginUser, and logoutUser by setting up and tearing down test user data, and ensuring localStorage is managed appropriately.
Confirmed that CRUD operations for quizzes are correctly implemented and validated using nock to mock API requests.
Checked that the integration tests cover the expected behavior for successful data creation, retrieval, updating, and deletion.
Additional Information
These changes ensure the reliability and robustness of the authService and quizService functions by providing comprehensive integration test coverage.
The use of nock for mocking API requests ensures that tests can simulate real-world scenarios accurately.
Summary
This pull request adds comprehensive integration tests for the
authService
andquizService
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
Integration Tests for AuthService
registerUser
,loginUser
, andlogoutUser
functions.before
code block.localStorage
is cleared and managed between tests in theafter
code block.Integration Tests for QuizService
createQuiz
,getQuizzes
,getQuizById
,updateQuiz
, anddeleteQuiz
functions.nock
to mock API requests and validate responses.Testing
registerUser
,loginUser
, andlogoutUser
by setting up and tearing down test user data, and ensuringlocalStorage
is managed appropriately.nock
to mock API requests.Additional Information
authService
andquizService
functions by providing comprehensive integration test coverage.nock
for mocking API requests ensures that tests can simulate real-world scenarios accurately.