Add comprehensive tests for Gacha Credits, Auth, and User services

- Implement tests for GachaCreditsService including creation, retrieval, updating, and deletion of gacha credits.
- Add tests for AuthController covering user login, registration, email verification, and error handling for invalid credentials.
- Enhance AuthService tests to include login, registration, email verification, OTP resend, password reset, and token refresh functionalities.
- Create tests for UsersService to validate user creation, retrieval, updating, deletion, and fetching by email.
- Ensure all tests utilize a consistent setup and teardown process for database interactions.
This commit is contained in:
MythEclipse
2025-09-25 22:53:26 +07:00
parent 0e48b6755f
commit f3d88e2ac9
8 changed files with 1912 additions and 212 deletions
+12
View File
@@ -99,3 +99,15 @@ pub async fn setup() {
.unwrap();
seed_users_for_test(&app_state.surrealdb_ws).await.unwrap();
}
pub fn get_meta_request_dto(page: u64, per_page: u64) -> imphnen_entities::MetaRequestDto {
imphnen_entities::MetaRequestDto {
page: Some(page),
per_page: Some(per_page),
search: None,
sort_by: None,
order: None,
filter: None,
filter_by: None,
}
}