5bafd60df6
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4YVo4UMopqT5DzicqpPjL
28 lines
763 B
Go
28 lines
763 B
Go
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)
|
|
}
|
|
}
|