Add delete account feature to mobile app

- DELETE /api/auth/account/ API call in AuthApi + APILayer
- authProvider field on User model for email vs social auth detection
- DeleteAccountDialog with password (email) or "type DELETE" (social) confirmation
- Red "Delete Account" card on ProfileScreen
- Navigation wired in App.kt (clears data, returns to login)
- 10 i18n strings in strings.xml
- ViewModel unit tests for delete account state
This commit is contained in:
Trey T
2026-03-26 10:41:17 -05:00
parent 2e5dbaea50
commit af45588503
9 changed files with 352 additions and 0 deletions

View File

@@ -56,4 +56,27 @@ class AuthViewModelTest {
// Then
assertIs<ApiResult.Idle>(viewModel.registerState.value)
}
// MARK: - Delete Account Tests
@Test
fun testInitialDeleteAccountState() {
// Given
val viewModel = AuthViewModel()
// Then
assertIs<ApiResult.Idle>(viewModel.deleteAccountState.value)
}
@Test
fun testResetDeleteAccountState() {
// Given
val viewModel = AuthViewModel()
// When
viewModel.resetDeleteAccountState()
// Then
assertIs<ApiResult.Idle>(viewModel.deleteAccountState.value)
}
}