Add Go rewrite with Postgres 17 and Dokploy Docker Compose
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"amnezia-share/internal/config"
|
||||
)
|
||||
|
||||
// TestLoadTemplatesParses is a smoke test that ensures every template file
|
||||
// under web/templates parses cleanly (balanced defines, known functions,
|
||||
// valid Go template syntax). It does not require a database connection.
|
||||
func TestLoadTemplatesParses(t *testing.T) {
|
||||
cfg := config.Config{WebDir: "../../web"}
|
||||
tmpl, err := loadTemplates(cfg)
|
||||
if err != nil {
|
||||
t.Fatalf("loadTemplates: %v", err)
|
||||
}
|
||||
names := []string{
|
||||
"page_install",
|
||||
"page_login",
|
||||
"page_cabinet_auth",
|
||||
"page_cabinet",
|
||||
"page_share",
|
||||
"page_faq",
|
||||
"page_rules",
|
||||
"page_status",
|
||||
"page_admin_index",
|
||||
"page_admin_links",
|
||||
"page_admin_renewal",
|
||||
"page_admin_configs",
|
||||
"page_admin_servers",
|
||||
"page_admin_settings",
|
||||
}
|
||||
for _, n := range names {
|
||||
if tmpl.Lookup(n) == nil {
|
||||
t.Errorf("template %q not found after parsing", n)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user