package handler import ( "testing" "infinite-canvas/backend/internal/service" "github.com/gin-gonic/gin" ) func TestChunkedUploadRoutesAreRegistered(t *testing.T) { gin.SetMode(gin.TestMode) router := gin.New() group := router.Group("/api") RegisterChunkedUploadRoutes(group, &service.Service{}) wanted := map[string]bool{ "POST /api/resources/uploads": false, "PUT /api/resources/uploads/:id/chunks/:index": false, "POST /api/resources/uploads/:id/complete": false, } for _, route := range router.Routes() { key := route.Method + " " + route.Path if _, exists := wanted[key]; exists { wanted[key] = true } } for route, found := range wanted { if !found { t.Errorf("route %s is not registered", route) } } }