refactor(tests): update test helpers and all test file references

- Rename createTestEbookID to createTestMediaItemID in test_helpers.go
- Update test helper comments and variable names (ebookReq -> mediaItemReq, etc.)
- Update all test file references:
  - analytics_test.go
  - book_matching_test.go
  - collections_bulk_test.go
  - kobo_test.go
  - media_bulk_test.go
  - opds_test.go
- Rename ebookID variable to mediaItemID in kobo_test.go
- Update test data to use 'Test Media Item' instead of 'Test Ebook'
This commit is contained in:
2026-02-08 14:32:37 -05:00
parent a9e0b33002
commit 38acc46988
7 changed files with 45 additions and 45 deletions
+6 -6
View File
@@ -166,7 +166,7 @@ func TestOPDSEndpoints(t *testing.T) {
token := loginTestUser(t, ts, db)
deviceID := uuid.New()
bookID := createTestEbookID(t, ts, token)
bookID := createTestMediaItemID(t, ts, token)
httpReq, _ := http.NewRequest("GET", ts.URL+"/opds/devices/"+deviceID.String()+"/download/"+bookID, nil)
httpReq.Header.Set("Authorization", "Bearer "+token)
@@ -217,7 +217,7 @@ func TestOPDSEndpoints(t *testing.T) {
token := loginTestUser(t, ts, db)
deviceID := uuid.New()
bookID := createTestEbookID(t, ts, token)
bookID := createTestMediaItemID(t, ts, token)
httpReq, _ := http.NewRequest("GET", ts.URL+"/opds/devices/"+deviceID.String()+"/cover/"+bookID, nil)
httpReq.Header.Set("Authorization", "Bearer "+token)
@@ -252,7 +252,7 @@ func TestOPDSEndpoints(t *testing.T) {
token := loginTestUser(t, ts, db)
deviceID := uuid.New()
bookID := createTestEbookID(t, ts, token)
bookID := createTestMediaItemID(t, ts, token)
httpReq, _ := http.NewRequest("GET", ts.URL+"/opds/devices/"+deviceID.String()+"/formats/"+bookID, nil)
httpReq.Header.Set("Authorization", "Bearer "+token)
@@ -275,7 +275,7 @@ func TestOPDSConversion(t *testing.T) {
token := loginTestUser(t, ts, db)
deviceID := uuid.New()
bookID := createTestEbookID(t, ts, token)
bookID := createTestMediaItemID(t, ts, token)
// Request KEPUB format
httpReq, _ := http.NewRequest("GET", ts.URL+"/opds/devices/"+deviceID.String()+"/download/"+bookID+"?format=kepub", nil)
@@ -297,7 +297,7 @@ func TestOPDSConversion(t *testing.T) {
token := loginTestUser(t, ts, db)
deviceID := uuid.New()
bookID := createTestEbookID(t, ts, token)
bookID := createTestMediaItemID(t, ts, token)
// Request default format (no format parameter)
httpReq, _ := http.NewRequest("GET", ts.URL+"/opds/devices/"+deviceID.String()+"/download/"+bookID, nil)
@@ -318,7 +318,7 @@ func TestOPDSConversion(t *testing.T) {
token := loginTestUser(t, ts, db)
deviceID := uuid.New()
bookID := createTestEbookID(t, ts, token)
bookID := createTestMediaItemID(t, ts, token)
// Request unsupported format
httpReq, _ := http.NewRequest("GET", ts.URL+"/opds/devices/"+deviceID.String()+"/download/"+bookID+"?format=pdf", nil)