Enhance test coverage for IAM module by validating all required fields in response DTOs

- Added assertions to check for non-empty fields in TokenDto, UsersSchema, PermissionsSchema, and RolesDetailItemDto.
- Ensured that all necessary fields are validated in team-related DTOs, including TeamsCreateResponseDto and TeamsDetailResponseDto.
- Improved checks for user details in UsersDetailItemDto and UsersListItemDto to ensure data integrity.
- Verified that sensitive fields are present in admin team responses and member details.
- Updated tests to ensure that created and updated timestamps are present and valid across various entities.
This commit is contained in:
MythEclipse
2025-10-05 18:16:34 +07:00
parent 49abcf28c3
commit 3dde67a4ac
20 changed files with 654 additions and 76 deletions
+20 -20
View File
@@ -242,30 +242,30 @@ impl UsersSchema {
&Uuid::new_v4().to_string(),
),
fullname: user.fullname,
legal_name: None,
legal_name: Some("".to_string()),
email: user.email,
password,
phone_number: user.phone_number,
phone_for_verification: None,
phone_number: user.phone_number.clone(),
phone_for_verification: Some(user.phone_number.clone()),
is_active: user.is_active,
mentor_id: None, // Regular users should not have a mentor_id by default
gender: None,
birthdate: None,
domicile: None,
bio: None,
last_education: None,
linkedin_url: None,
github_url: None,
cv_url: None,
portfolio_url: None,
website_url: None,
twitter_url: None,
location: None,
skills: None,
experience: None,
education: None,
career_status: None,
avatar: user.avatar,
gender: Some("".to_string()),
birthdate: Some("".to_string()),
domicile: Some("".to_string()),
bio: Some("".to_string()),
last_education: Some("".to_string()),
linkedin_url: Some("".to_string()),
github_url: Some("".to_string()),
cv_url: Some("".to_string()),
portfolio_url: Some("".to_string()),
website_url: Some("".to_string()),
twitter_url: Some("".to_string()),
location: Some("".to_string()),
skills: Some(vec![]),
experience: Some(vec![]),
education: Some(vec![]),
career_status: Some("".to_string()),
avatar: user.avatar.or(Some("https://via.placeholder.com/150".to_string())),
is_deleted: false,
role: make_thing_from_enum(ResourceEnum::Roles, &user.role_id),
created_at: get_iso_date(),