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:
@@ -451,6 +451,14 @@ func TestRegenerateDeviceToken_Forbidden(t *testing.T) {
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
|
||||
// Clean up the second user after the test
|
||||
defer func() {
|
||||
user2, err := setup.DB.GetUserByEmail(ctx, "differentuser@example.com")
|
||||
if err == nil {
|
||||
setup.DB.DeleteUser(ctx, user2.ID)
|
||||
}
|
||||
}()
|
||||
|
||||
// Login as user 2
|
||||
loginRequest := map[string]interface{}{
|
||||
"login": "differentuser@example.com",
|
||||
|
||||
Reference in New Issue
Block a user