fix: Update test files to match refactored method signatures
Update test files to work with recent backend refactoring changes.
Test changes in internal/services/dashboard_service_test.go:
- Fix method name casing for FilterHiddenCollections
- Change from filterHiddenCollections (lowercase 'f')
- Change to FilterHiddenCollections (uppercase 'F')
- Matches exported method signature in DashboardService
- Line 57: Update test call to use correct exported method
Test changes in internal/handlers/dashboard_test.go:
- Update getViewAllURL test to match simplified function signature
- Remove queryType parameter from test call
- Function now only takes collectionName parameter
- Aligns with refactoring to use /collections/{id} routing
- Line 178: Update test call to use new signature
These fixes ensure tests compile and run correctly after the
collection detail page refactoring where:
1. getViewAllURL() was simplified to return /collections/{id}
2. System collections now use the same routing as user collections
This commit is contained in:
@@ -175,7 +175,7 @@ func TestGetViewAllURL_SystemCollections(t *testing.T) {
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result := getViewAllURL(tt.collectionName, tt.queryType)
|
||||
result := getViewAllURL(tt.collectionName)
|
||||
assert.Equal(t, tt.expected, result, "getViewAllURL mismatch")
|
||||
})
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ func TestDashboardService_FilterHiddenCollections(t *testing.T) {
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result := service.filterHiddenCollections(sections, tt.hidden)
|
||||
result := service.FilterHiddenCollections(sections, tt.hidden)
|
||||
|
||||
assert.Equal(t, tt.expectedCount, len(result), "expected %d sections", tt.expectedCount)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user