Files
plumber/internal/store/email_test.go
codegirl007 418ef93da5 Add polished answer notifications (#1)
Sends a branded Resend email when a question receives its first answer, records accepted and failed sends, and adds collapsed answer editing with cancel behavior.

Co-authored-by: codegirl-007 <s.raide@gmail.com>
2026-08-27 06:55:24 +00:00

22 lines
548 B
Go

package store
import "testing"
func TestValidateEmail(t *testing.T) {
cases := []struct {
in, want, err string
}{
{"", "", "Email is required."},
{" Alice@Example.COM ", "alice@example.com", ""},
{"not-an-email", "", "Enter a valid email address."},
{"a@b", "", "Enter a valid email address."},
{"ok@example.com", "ok@example.com", ""},
}
for _, tc := range cases {
got, msg := ValidateEmail(tc.in)
if got != tc.want || msg != tc.err {
t.Fatalf("%q: got (%q, %q) want (%q, %q)", tc.in, got, msg, tc.want, tc.err)
}
}
}