test: update kobo and media test signatures
- Remove handler parameter from test function calls - Update test signatures to match new setupTestServer return values - Fix compilation errors after test helper refactoring - Maintain test functionality for kobo and media endpoints
This commit is contained in:
@@ -17,7 +17,7 @@ func TestKoboInitialization(t *testing.T) {
|
||||
t.Skip("Skipping integration test in short mode")
|
||||
}
|
||||
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer closeTestServer(t, ts, db)
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
@@ -42,7 +42,7 @@ func TestKoboLibrarySync(t *testing.T) {
|
||||
t.Skip("Skipping integration test in short mode")
|
||||
}
|
||||
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer closeTestServer(t, ts, db)
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
@@ -66,7 +66,7 @@ func TestKoboMarkupSync(t *testing.T) {
|
||||
t.Skip("Skipping integration test in short mode")
|
||||
}
|
||||
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer closeTestServer(t, ts, db)
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
@@ -122,7 +122,7 @@ func TestKoboBookmarkSync(t *testing.T) {
|
||||
t.Skip("Skipping integration test in short mode")
|
||||
}
|
||||
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer closeTestServer(t, ts, db)
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
@@ -163,7 +163,7 @@ func TestKoboAnalyticsGettests(t *testing.T) {
|
||||
t.Skip("Skipping integration test in short mode")
|
||||
}
|
||||
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer closeTestServer(t, ts, db)
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
// TestMediaBulkOperations tests bulk media operations
|
||||
func TestMediaBulkOperations(t *testing.T) {
|
||||
t.Run("BulkDeleteBooks_WithoutAuth", func(t *testing.T) {
|
||||
ts, _, _, _ := setupTestServer(t)
|
||||
ts, _, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
req := map[string]interface{}{
|
||||
@@ -34,7 +34,7 @@ func TestMediaBulkOperations(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("BulkDeleteBooks_EmptyBookIDs", func(t *testing.T) {
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
@@ -57,7 +57,7 @@ func TestMediaBulkOperations(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("BulkDeleteBooks_InvalidBookIDs", func(t *testing.T) {
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
@@ -88,7 +88,7 @@ func TestMediaBulkOperations(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("BulkDeleteBooks_WithValidBooks", func(t *testing.T) {
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
@@ -123,7 +123,7 @@ func TestMediaBulkOperations(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("BulkDeleteBooks_InvalidRequestBody", func(t *testing.T) {
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
@@ -142,7 +142,7 @@ func TestMediaBulkOperations(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("BulkUpdateBooks_WithoutAuth", func(t *testing.T) {
|
||||
ts, _, _, _ := setupTestServer(t)
|
||||
ts, _, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
req := map[string]interface{}{
|
||||
@@ -165,7 +165,7 @@ func TestMediaBulkOperations(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("BulkUpdateBooks_EmptyBookIDs", func(t *testing.T) {
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
@@ -191,7 +191,7 @@ func TestMediaBulkOperations(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("BulkUpdateBooks_InvalidBookIDs", func(t *testing.T) {
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
@@ -225,7 +225,7 @@ func TestMediaBulkOperations(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("BulkUpdateBooks_UpdateTags", func(t *testing.T) {
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
@@ -262,7 +262,7 @@ func TestMediaBulkOperations(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("BulkUpdateBooks_UpdateReadingStatus", func(t *testing.T) {
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
@@ -296,7 +296,7 @@ func TestMediaBulkOperations(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("BulkUpdateBooks_UpdateMultipleFields", func(t *testing.T) {
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
@@ -332,7 +332,7 @@ func TestMediaBulkOperations(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("BulkUpdateBooks_InvalidRequestBody", func(t *testing.T) {
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
|
||||
@@ -42,7 +42,7 @@ func createTestLibrary(t *testing.T, ts *httptest.Server, token, name string) st
|
||||
|
||||
// TestMediaItemISBNNormalization tests ISBN normalization with media-items endpoint
|
||||
func TestMediaItemISBNNormalization(t *testing.T) {
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
// Create an ebook library first
|
||||
@@ -131,7 +131,7 @@ func TestMediaItemISBNNormalization(t *testing.T) {
|
||||
|
||||
// TestMediaItemISBNEdgeCases tests ISBN edge cases
|
||||
func TestMediaItemISBNEdgeCases(t *testing.T) {
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
@@ -216,7 +216,7 @@ func TestMediaItemISBNEdgeCases(t *testing.T) {
|
||||
|
||||
// TestMediaItemsPagination tests pagination with media-items endpoint
|
||||
func TestMediaItemsPagination(t *testing.T) {
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
@@ -323,7 +323,7 @@ func TestMediaItemsPagination(t *testing.T) {
|
||||
|
||||
// TestMediaItemLibraryRequirement tests that media items require a library
|
||||
func TestMediaItemLibraryRequirement(t *testing.T) {
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
@@ -386,7 +386,7 @@ func TestMediaItemLibraryRequirement(t *testing.T) {
|
||||
|
||||
// TestUpdateMediaItemISBN tests updating media-item ISBN
|
||||
func TestUpdateMediaItemISBN(t *testing.T) {
|
||||
ts, db, _, _ := setupTestServer(t)
|
||||
ts, db, _ := setupTestServer(t)
|
||||
defer ts.Close()
|
||||
|
||||
token := loginTestUser(t, ts, db)
|
||||
|
||||
Reference in New Issue
Block a user