This commit is contained in:
2026-08-24 04:03:44 +02:00
parent 8a690a0464
commit 7bafd7a322
9 changed files with 391 additions and 53 deletions
@@ -0,0 +1,29 @@
package auth
import "testing"
func TestDefaultOwnedCompanyName(t *testing.T) {
t.Parallel()
cases := []struct {
email, name, want string
}{
{email: "ada@example.com", name: "Ada", want: "Ada's workspace"},
{email: "ada@example.com", name: " ", want: "ada's workspace"},
{email: "ada@example.com", name: "", want: "ada's workspace"},
{email: "", name: "", want: "My workspace"},
{email: "nolsocal", name: "", want: "nolsocal's workspace"},
}
for _, tc := range cases {
got := defaultOwnedCompanyName(tc.email, tc.name)
if got != tc.want {
t.Fatalf("defaultOwnedCompanyName(%q, %q)=%q want %q", tc.email, tc.name, got, tc.want)
}
}
}
func TestInvitePasswordModeConstants(t *testing.T) {
t.Parallel()
if InvitePasswordSet != "set" || InvitePasswordVerify != "verify" || InvitePasswordRecover != "recover" {
t.Fatal("invite password mode constants drifted")
}
}