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>
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user