fix(tests): initialize ProcessingIssuesHandler in test server setup
The setupTestServer() helper in test_helpers_test.go was not creating a ProcessingIssuesHandler and not passing one to the router config, causing a nil pointer dereference when any processing issues route was hit during tests. Add handler creation and wire it into routerConfig to match how cmd/server/main.go does it.
This commit is contained in:
@@ -463,6 +463,7 @@ func setupTestServer(t *testing.T) *TestServerSetup {
|
|||||||
analyticsHandler := handlers.NewAnalyticsHandler(queries)
|
analyticsHandler := handlers.NewAnalyticsHandler(queries)
|
||||||
queueHandler := handlers.NewQueueHandler(queries, queueProcessor)
|
queueHandler := handlers.NewQueueHandler(queries, queueProcessor)
|
||||||
systemSettingsHandler := handlers.NewSystemSettingsHandler(queries)
|
systemSettingsHandler := handlers.NewSystemSettingsHandler(queries)
|
||||||
|
processingIssuesHandler := handlers.NewProcessingIssuesHandler(queries)
|
||||||
|
|
||||||
// Create refactored handlers (matching main.go)
|
// Create refactored handlers (matching main.go)
|
||||||
libraryService := services.NewLibraryService(queries)
|
libraryService := services.NewLibraryService(queries)
|
||||||
@@ -518,6 +519,7 @@ func setupTestServer(t *testing.T) *TestServerSetup {
|
|||||||
AnalyticsHandler: analyticsHandler,
|
AnalyticsHandler: analyticsHandler,
|
||||||
QueueHandler: queueHandler,
|
QueueHandler: queueHandler,
|
||||||
SystemSettingsHandler: systemSettingsHandler,
|
SystemSettingsHandler: systemSettingsHandler,
|
||||||
|
ProcessingIssuesHandler: processingIssuesHandler,
|
||||||
CollectionHandler: collectionHandler,
|
CollectionHandler: collectionHandler,
|
||||||
FiltersHandler: filtersHandler,
|
FiltersHandler: filtersHandler,
|
||||||
DashboardHandler: dashboardHandler,
|
DashboardHandler: dashboardHandler,
|
||||||
|
|||||||
Reference in New Issue
Block a user