This commit is contained in:
2026-10-01 16:42:39 +07:00
parent 5638349623
commit ee15d149bd
31 changed files with 37 additions and 88 deletions
@@ -47,7 +47,8 @@ func TestChangeUserPassword(t *testing.T) {
r.byID[u.ID] = u
r.users[u.Email] = u
}
// Nil JWT, token repository and mail sender ensure this operation does not use them.
// Пустые JWT, репозиторий токенов и отправитель писем подтверждают,
// что операция их не использует.
s := &UsersService{usersRepo: r}
err = s.ChangeUserPassword(context.Background(), tc.actor, tc.target, tc.password)
if !errors.Is(err, tc.want) {
@@ -89,7 +90,7 @@ func TestLoginAfterPasswordChangePreservesEmailCase(t *testing.T) {
if err := svc.ChangeUserPassword(ctx, 1, 2, "new password 123"); err != nil {
t.Fatal(err)
}
// This error can only occur after email lookup and bcrypt verification succeed.
// Эта ошибка возможна только после успешного поиска email и проверки bcrypt.
_, _, err := svc.Login(ctx, " User@Example.COM ", "new password 123")
if err == nil || err.Error() != "Не получилось получить доступ" {
t.Fatalf("lookup/password verification failed: %v", err)
@@ -40,7 +40,7 @@ func TestEmailThemeAndContent(t *testing.T) {
}
}
if n.Type == html.ElementNode && n.Data == "a" {
protected = true // The button has its own paired background and text colors.
protected = true // У кнопки собственные согласованные цвета фона и текста.
}
if paper && n.Type == html.TextNode && strings.TrimSpace(n.Data) != "" {
if !protected {