diff --git a/messenger/template/debug_test.go b/messenger/template/debug_test.go index 960ec501..e4fb387c 100644 --- a/messenger/template/debug_test.go +++ b/messenger/template/debug_test.go @@ -16,7 +16,7 @@ func TestDebugTemplateLoading(t *testing.T) { // Test direct template loading t.Log("Testing direct template loading...") - + // Try to load a specific template file using application.App content, err := application.App.Read("messengers/templates/en/invite_member.mail.html") if err != nil { @@ -25,7 +25,7 @@ func TestDebugTemplateLoading(t *testing.T) { t.Logf("Template file content length: %d", len(content)) t.Logf("First 200 chars: %s", content[:min(200, len(content))]) } - + // Test template parsing subject, body, html, err := parseTemplateContent(string(content), types.TemplateTypeMail) if err != nil { diff --git a/messenger/template/load_test.go b/messenger/template/load_test.go index 4c680895..3846fd92 100644 --- a/messenger/template/load_test.go +++ b/messenger/template/load_test.go @@ -16,18 +16,18 @@ func TestLoadTemplate(t *testing.T) { // Test loading a specific template file := "messengers/templates/en/invite_member.mail.html" templateID := share.ID("messengers/templates", file) - + t.Logf("Testing loadTemplate with file: %s, templateID: %s", file, templateID) - + template, err := loadTemplate(file, templateID) if err != nil { t.Fatalf("Failed to load template: %v", err) } - + if template == nil { t.Fatal("Template is nil") } - + t.Logf("Loaded template: ID=%s, Type=%s, Language=%s", template.ID, template.Type, template.Language) t.Logf("Subject: %s", template.Subject) t.Logf("Body length: %d", len(template.Body)) diff --git a/messenger/template/walk_test.go b/messenger/template/walk_test.go index 94c0363b..a5886ae3 100644 --- a/messenger/template/walk_test.go +++ b/messenger/template/walk_test.go @@ -15,7 +15,7 @@ func TestWalkTemplates(t *testing.T) { // Test Walk function directly t.Log("Testing Walk function directly...") - + // Check if templates directory exists exists, err := application.App.Exists("messengers/templates") if err != nil { @@ -25,13 +25,13 @@ func TestWalkTemplates(t *testing.T) { t.Log("Templates directory not found") return } - + t.Log("Templates directory exists") - + // Test Walk with different extensions exts := []string{"*.mail.html", "*.sms.txt", "*.whatsapp.html"} t.Logf("Testing Walk with extensions: %v", exts) - + fileCount := 0 err = application.App.Walk("messengers/templates", func(root, file string, isdir bool) error { t.Logf("Walk callback: root=%s, file=%s, isdir=%v", root, file, isdir) @@ -40,10 +40,10 @@ func TestWalkTemplates(t *testing.T) { } return nil }, exts...) - + if err != nil { t.Fatalf("Walk failed: %v", err) } - + t.Logf("Walk completed, found %d files", fileCount) }