ultisuite-backend/internal/api/mail/handlers_account_test_route_test.go
2026-05-24 00:03:36 +02:00

25 lines
525 B
Go

package mail
import (
"net/http"
"testing"
"github.com/go-chi/chi/v5"
)
func TestStoredAccountTestRouteRegistered(t *testing.T) {
t.Parallel()
h := NewHandlerWithService(&fakeMailService{})
var found bool
_ = chi.Walk(h.Routes(), func(method, route string, _ http.Handler, _ ...func(http.Handler) http.Handler) error {
if method == http.MethodPost && route == "/accounts/{accountID}/test" {
found = true
}
return nil
})
if !found {
t.Fatal("POST /accounts/{accountID}/test route not registered")
}
}