Шапка: служебные разделы в меню пользователя, статус НРД и время друг над другом
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4YVo4UMopqT5DzicqpPjL
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user