package team import "testing" func TestBuildTeamPasswordResetLink(t *testing.T) { got := buildTeamPasswordResetLink("https://admin.example.com/reset-password", "a@b.com", "123456") want := "https://admin.example.com/reset-password?email=a%40b.com&otp=123456" if got != want { t.Fatalf("got %q want %q", got, want) } } func TestPasswordResetBaseURLFallback(t *testing.T) { s := &Service{inviteBaseURL: "https://admin.example.com/accept-invite"} got := s.passwordResetBaseURL() want := "https://admin.example.com/reset-password" if got != want { t.Fatalf("got %q want %q", got, want) } s.passwordResetURL = "https://admin.example.com/forgot-password" got = s.passwordResetBaseURL() want = "https://admin.example.com/forgot-password" if got != want { t.Fatalf("explicit URL: got %q want %q", got, want) } }