Files
member-console/internal/provisioning/display_name_test.go
T
cgalo5758 88db730fcc Add dual licensing and SPDX headers
Introduce a commercial license option alongside AGPL-3.0-only, require a
CLA for contributors, and document the terms in COMMERCIAL.md and
NOTICE. Add a script to stamp SPDX headers on Go files and apply it
across the tree.
2026-09-06 02:29:42 -05:00

22 lines
610 B
Go

// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
// SPDX-FileCopyrightText: 2025-2026 Christian Galo
package provisioning
import "testing"
func TestDisplayNameFromClaims(t *testing.T) {
cases := []struct{ name, preferred, want string }{
{"Alice Admin", "alice", "Alice Admin"},
{"", "alice", "alice"},
{" ", "alice", "alice"},
{"", "", ""},
{" Bob ", "", "Bob"},
}
for _, tc := range cases {
if got := DisplayNameFromClaims(tc.name, tc.preferred); got != tc.want {
t.Errorf("DisplayNameFromClaims(%q, %q) = %q, want %q", tc.name, tc.preferred, got, tc.want)
}
}
}