Files
zeekay 94407c2972 Initial commit: Rebranded status page (Gatus fork)
White-labelable status monitoring service with all Gatus branding
removed. Defaults to neutral "Status" text. Branding is driven
entirely by the ui section in config YAML.

- Pure Go build (CGO_ENABLED=0, modernc.org/sqlite)
- Multi-stage Dockerfile (node frontend + go backend + alpine runtime)
- K8s kustomize overlays for hanzo and lux deployments
- GitHub Actions CI for GHCR image push
- Pre-built Vue frontend with zero upstream branding
2026-02-25 19:36:13 -08:00

57 lines
1.2 KiB
Go

package key
import "testing"
func TestConvertGroupAndNameToKey(t *testing.T) {
type Scenario struct {
GroupName string
Name string
ExpectedOutput string
}
scenarios := []Scenario{
{
GroupName: "Core",
Name: "Front End",
ExpectedOutput: "core_front-end",
},
{
GroupName: "Load balancers",
Name: "us-west-2",
ExpectedOutput: "load-balancers_us-west-2",
},
{
GroupName: "a/b test",
Name: "a",
ExpectedOutput: "a-b-test_a",
},
{
GroupName: "",
Name: "name",
ExpectedOutput: "_name",
},
{
GroupName: "API (v1)",
Name: "endpoint",
ExpectedOutput: "api-(v1)_endpoint",
},
{
GroupName: "website (admin)",
Name: "test",
ExpectedOutput: "website-(admin)_test",
},
{
GroupName: "search",
Name: "query&filter",
ExpectedOutput: "search_query-filter",
},
}
for _, scenario := range scenarios {
t.Run(scenario.ExpectedOutput, func(t *testing.T) {
output := ConvertGroupAndNameToKey(scenario.GroupName, scenario.Name)
if output != scenario.ExpectedOutput {
t.Errorf("expected '%s', got '%s'", scenario.ExpectedOutput, output)
}
})
}
}