Шапка: служебные разделы в меню пользователя, статус НРД и время друг над другом

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4YVo4UMopqT5DzicqpPjL
This commit is contained in:
zuevav
2026-09-18 11:20:51 +03:00
parent b4b4788035
commit 5bafd60df6
2 changed files with 59 additions and 10 deletions
+27
View File
@@ -0,0 +1,27 @@
package lkgateway
import (
"html/template"
"net/http/httptest"
"os"
"testing"
)
// Снимок шапки для визуальной проверки: страница пишется в файл, если задан BJ_SHOT_OUT.
func TestTopbarShot(t *testing.T) {
out := os.Getenv("BJ_SHOT_OUT")
if out == "" {
t.Skip("BJ_SHOT_OUT не задан")
}
a, err := newAdmin()
if err != nil {
t.Fatal(err)
}
rec := httptest.NewRecorder()
p := nowPage("Настройка", "setup")
p.NPR = true
render(rec, a.modulePage, modulePageData{page: p, Content: template.HTML(`<div style="padding:40px" class="muted">содержимое страницы</div>`)})
if err := os.WriteFile(out, rec.Body.Bytes(), 0o644); err != nil {
t.Fatal(err)
}
}