fix: update test files for token handling and response parsing
- Update callers of createTestMediaItemID to not pass token - Fix loginAdminUser to delete/recreate admin user for consistent state - Fix TestListAllQueueItems_Admin to parse response as map with 'items' key - Remove unused token variables from tests - Update device_test.go with admin password hash constant
This commit is contained in:
@@ -28,7 +28,7 @@ func TestCollectionsBulkOperations(t *testing.T) {
|
||||
}
|
||||
|
||||
t.Run("BulkAddBooks_WithoutAuth", func(t *testing.T) {
|
||||
bookID := createTestMediaItemID(t, setup.Server, token)
|
||||
bookID := createTestMediaItemID(t, setup.Server)
|
||||
|
||||
req := BulkAddBooksRequest{
|
||||
Operations: []BulkAddOperation{
|
||||
@@ -68,7 +68,7 @@ func TestCollectionsBulkOperations(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("BulkAddBooks_InvalidCollectionID", func(t *testing.T) {
|
||||
bookID := createTestMediaItemID(t, setup.Server, token)
|
||||
bookID := createTestMediaItemID(t, setup.Server)
|
||||
|
||||
req := BulkAddBooksRequest{
|
||||
Operations: []BulkAddOperation{
|
||||
@@ -179,7 +179,7 @@ func TestCollectionsBulkOperations(t *testing.T) {
|
||||
collectionID := collectionResult["id"].(string)
|
||||
|
||||
// Create a book
|
||||
bookID := createTestMediaItemID(t, setup.Server, token)
|
||||
bookID := createTestMediaItemID(t, setup.Server)
|
||||
|
||||
// Add book to collection
|
||||
addReq := map[string]interface{}{
|
||||
@@ -236,9 +236,9 @@ func TestCollectionsBulkOperations(t *testing.T) {
|
||||
collectionID := collectionResult["id"].(string)
|
||||
|
||||
// Create multiple books
|
||||
bookID1 := createTestMediaItemID(t, setup.Server, token)
|
||||
bookID2 := createTestMediaItemID(t, setup.Server, token)
|
||||
bookID3 := createTestMediaItemID(t, setup.Server, token)
|
||||
bookID1 := createTestMediaItemID(t, setup.Server)
|
||||
bookID2 := createTestMediaItemID(t, setup.Server)
|
||||
bookID3 := createTestMediaItemID(t, setup.Server)
|
||||
|
||||
// Add all books to collection
|
||||
addReq := map[string]interface{}{
|
||||
@@ -307,8 +307,8 @@ func TestCollectionsBulkOperations(t *testing.T) {
|
||||
collectionID2 := collectionResult2["id"].(string)
|
||||
|
||||
// Create books
|
||||
bookID1 := createTestMediaItemID(t, setup.Server, token)
|
||||
bookID2 := createTestMediaItemID(t, setup.Server, token)
|
||||
bookID1 := createTestMediaItemID(t, setup.Server)
|
||||
bookID2 := createTestMediaItemID(t, setup.Server)
|
||||
|
||||
// Add books to multiple collections
|
||||
addReq := map[string]interface{}{
|
||||
@@ -363,7 +363,7 @@ func TestCollectionsBulkOperations(t *testing.T) {
|
||||
collectionID := collectionResult["id"].(string)
|
||||
|
||||
// Create a book
|
||||
bookID := createTestMediaItemID(t, setup.Server, token)
|
||||
bookID := createTestMediaItemID(t, setup.Server)
|
||||
|
||||
// Add book to collection
|
||||
addReq := map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user