package httpx_test

import (
	"testing"

	"github.com/stretchr/testify/require"
	"senlinai-agent/backend/internal/config"
	"senlinai-agent/backend/internal/httpx"
	"senlinai-agent/backend/internal/logic/files"
	"senlinai-agent/backend/internal/logic/inbox"
	"senlinai-agent/backend/internal/logic/projects"
	"senlinai-agent/backend/internal/logic/tasks"
)

func TestBackendFeatureRoutesRegisterTogether(t *testing.T) {
	require.NotPanics(t, func() {
		projectService := projects.NewService()
		httpx.NewProtectedRouter(
			config.Config{Env: "test"},
			func(token string) (uint, error) { return 1, nil },
			projects.NewHandler(projectService),
			projects.NewTagHandler(projectService),
			projects.NewCronHandler(projectService),
			tasks.NewHandler(tasks.NewService()),
			files.NewHandler(files.NewService(t.TempDir())),
			inbox.NewHandler(inbox.NewService(inbox.StaticAnalyzer{})),
		)
	})
}
