RezinaLMS-BackEnd/internal/domain/user_auth_status_test.go
Yared Yemane dd802aca37 Block deactivated and suspended learners from all auth paths.
Enforce account status on email, phone OTP, social login, token refresh, and authenticated learner requests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 03:03:39 -07:00

23 lines
508 B
Go

package domain
import "testing"
func TestValidateUserCanAuthenticate(t *testing.T) {
cases := []struct {
status UserStatus
want error
}{
{UserStatusActive, nil},
{UserStatusPending, ErrUserNotVerified},
{UserStatusSuspended, ErrUserAccountLocked},
{UserStatusDeactivated, ErrUserAccountLocked},
}
for _, tc := range cases {
got := ValidateUserCanAuthenticate(tc.status)
if got != tc.want {
t.Fatalf("ValidateUserCanAuthenticate(%q)=%v, want %v", tc.status, got, tc.want)
}
}
}