diff --git a/pkg/email/model.go b/pkg/email/model.go index 0e9181ec..680e693d 100644 --- a/pkg/email/model.go +++ b/pkg/email/model.go @@ -9,7 +9,6 @@ type Report struct { Message string Format string ClusterName string - TitlePrefix string } type Reporter interface { diff --git a/pkg/email/summary/reporter_test.go b/pkg/email/summary/reporter_test.go index 539d2657..2646a8cb 100644 --- a/pkg/email/summary/reporter_test.go +++ b/pkg/email/summary/reporter_test.go @@ -5,6 +5,7 @@ import ( "fmt" "os" "testing" + "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,8 +51,9 @@ func Test_CreateReport(t *testing.T) { if report.ClusterName != "Cluster" { t.Fatal("expected clustername to be set") } - if report.TitlePrefix != "Report" { - t.Fatal("expected titleprefix to be set") + expected := "Report (summary) on Cluster from " + time.Now().Format("2006-01-02") + if report.Title != expected { + t.Fatalf("expected title to be '%s', got %s", expected, report.Title) } if report.Format != "html" { t.Fatal("expected format to be set") diff --git a/pkg/email/violations/reporter_test.go b/pkg/email/violations/reporter_test.go index c881c0ba..22c1333f 100644 --- a/pkg/email/violations/reporter_test.go +++ b/pkg/email/violations/reporter_test.go @@ -5,6 +5,7 @@ import ( "fmt" "os" "testing" + "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,8 +51,9 @@ func Test_CreateReport(t *testing.T) { if report.ClusterName != "Cluster" { t.Fatal("expected clustername to be set") } - if report.TitlePrefix != "Report" { - t.Fatal("expected titleprefix to be") + expected := "Report (violations) on Cluster from " + time.Now().Format("2006-01-02") + if report.Title != expected { + t.Fatalf("expected titleprefix to be '%s', got '%s'", expected, report.Title) } if report.Format != "html" { t.Fatal("expected format to be set")