42 lines
891 B
Go
42 lines
891 B
Go
package app
|
|
|
|
import (
|
|
"io"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestPortalTemplateExecutes(t *testing.T) {
|
|
t.Parallel()
|
|
templates, err := parseTemplates()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
err = templates.ExecuteTemplate(io.Discard, "portal.html", pageData{
|
|
Title: "Test",
|
|
Technician: &technician{DisplayName: "Technician"},
|
|
Packages: []packageRecord{{
|
|
ID: 1,
|
|
Slug: "sentinelone-linux",
|
|
DisplayName: "SentinelOne Linux Agent",
|
|
PackageVersion: "26.1.1.31",
|
|
Enabled: true,
|
|
}},
|
|
Actions: []actionRecord{{
|
|
Slug: "install-rmm",
|
|
DisplayName: "Install RMM",
|
|
Enabled: true,
|
|
}},
|
|
Authorizations: []authorizationRecord{{
|
|
ID: 1,
|
|
CreatedBy: "taiadmin",
|
|
ExpiresAt: time.Now().Add(time.Hour),
|
|
Packages: "SentinelOne Linux Agent",
|
|
Actions: "Install RMM",
|
|
}},
|
|
})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|