Настройки: ключ кабинета показывается целиком — закрытый контур, нужен при переустановке кабинета

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
zuevav
2026-09-18 09:42:58 +03:00
parent 222d48e740
commit f51414269d
4 changed files with 10 additions and 21 deletions
+3 -6
View File
@@ -19,7 +19,7 @@ func TestSetupPageLKUsersAndLink(t *testing.T) {
rec := httptest.NewRecorder()
render(rec, a.setup, SetupData{
page: nowPage("Настройка", "setup"), Settings: s,
LKKeyMask: maskSecret(s.LK.APIKey), LKAgent: lkAgentStatus(s),
LKKeyMask: lkKeyForPage(s.LK.APIKey), LKAgent: lkAgentStatus(s),
LKUsers: []LKUser{
{ID: 1, Login: "manager", Contract: "ADMIN", FullName: "Сотрудник", Active: true, IsAdmin: true},
{ID: 2, Login: "br859", Contract: "БР-859", Active: false},
@@ -35,10 +35,7 @@ func TestSetupPageLKUsersAndLink(t *testing.T) {
t.Errorf("в странице нет %q", want)
}
}
if strings.Contains(body, s.LK.APIKey) {
t.Error("ключ кабинета показан целиком без создания")
}
if !strings.Contains(body, "lk-0123") {
t.Error("маска ключа не показана")
if !strings.Contains(body, s.LK.APIKey) {
t.Error("ключ кабинета должен быть показан целиком: понадобится при переустановке")
}
}