This commit is contained in:
2026-07-28 21:01:58 -05:00
parent 510d5490f9
commit f56ac6a2c4
7 changed files with 219 additions and 13 deletions
+6 -1
View File
@@ -79,9 +79,14 @@ func TestPackageAndAuditTemplatesExecute(t *testing.T) {
SourceIP: "203.0.113.10",
CreatedAt: time.Now(),
}}
if err := templates.ExecuteTemplate(io.Discard, "audit.html", data); err != nil {
var auditOutput bytes.Buffer
if err := templates.ExecuteTemplate(&auditOutput, "audit.html", data); err != nil {
t.Fatal(err)
}
if !strings.Contains(auditOutput.String(), "Failed code attempts") ||
!strings.Contains(auditOutput.String(), "audit_event=code_exchange_failed") {
t.Fatal("audit page does not include the failed-code-attempt shortcut")
}
}
func TestFleetTemplateExecutes(t *testing.T) {