Initial commit of Descrybe v2 without local scratch artifacts.

Drop one-shot tmp/axe scripts and agent i18n scratch so the Gitea tree is deployable.
This commit is contained in:
2026-08-09 22:47:43 +02:00
commit 8580c996c3
1285 changed files with 325780 additions and 0 deletions
@@ -0,0 +1,31 @@
package httpapi
import "testing"
func TestInviteMailResult(t *testing.T) {
t.Parallel()
cases := []struct {
name string
smtpEnabled bool
sendOK bool
wantMailSent bool
wantToken bool
}{
{name: "smtp_ok", smtpEnabled: true, sendOK: true, wantMailSent: true, wantToken: false},
{name: "smtp_send_fail", smtpEnabled: true, sendOK: false, wantMailSent: false, wantToken: true},
{name: "noop_mailer_send_ok", smtpEnabled: false, sendOK: true, wantMailSent: false, wantToken: true},
{name: "disabled_no_send", smtpEnabled: false, sendOK: false, wantMailSent: false, wantToken: true},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
mailSent, includeToken := inviteMailResult(tc.smtpEnabled, tc.sendOK)
if mailSent != tc.wantMailSent {
t.Fatalf("mailSent=%v want %v", mailSent, tc.wantMailSent)
}
if includeToken != tc.wantToken {
t.Fatalf("includeToken=%v want %v", includeToken, tc.wantToken)
}
})
}
}