(t *testing.T)
| 40 | } |
| 41 | |
| 42 | func TestSendPasswordResetEmail(t *testing.T) { |
| 43 | emailBackend := testutils.MockEmailbackendImplementation{} |
| 44 | a := NewTest() |
| 45 | a.EmailBackend = &emailBackend |
| 46 | a.BaseURL = "http://example.com" |
| 47 | |
| 48 | if err := a.SendPasswordResetEmail("alice@example.com", "mockTokenValue"); err != nil { |
| 49 | t.Fatal(err, "failed to perform") |
| 50 | } |
| 51 | |
| 52 | assert.Equalf(t, len(emailBackend.Emails), 1, "email queue count mismatch") |
| 53 | assert.Equal(t, emailBackend.Emails[0].From, "noreply@example.com", "email sender mismatch") |
| 54 | assert.DeepEqual(t, emailBackend.Emails[0].To, []string{"alice@example.com"}, "email sender mismatch") |
| 55 | |
| 56 | } |
| 57 | |
| 58 | func TestGetSenderEmail(t *testing.T) { |
| 59 | testCases := []struct { |
nothing calls this directly
no test coverage detected