test: update collections bulk tests for 'added' field rename
Update test assertions in TestCollectionsBulkOperations to expect 'added' instead of 'success' in the response, matching the handler change made in the bulk operations rename. Fixes: - BulkAddBooks_InvalidCollectionID: assert 'added' field exists - BulkAddBooks_SingleOperation: assert 'added' field exists
This commit is contained in:
@@ -91,7 +91,7 @@ func TestCollectionsBulkOperations(t *testing.T) {
|
||||
|
||||
assert.Contains(t, result, "results")
|
||||
assert.Contains(t, result, "total")
|
||||
assert.Contains(t, result, "success")
|
||||
assert.Contains(t, result, "added")
|
||||
assert.Contains(t, result, "failed")
|
||||
|
||||
results := result["results"].([]interface{})
|
||||
@@ -209,7 +209,7 @@ func TestCollectionsBulkOperations(t *testing.T) {
|
||||
|
||||
assert.Contains(t, result, "results")
|
||||
assert.Contains(t, result, "total")
|
||||
assert.Contains(t, result, "success")
|
||||
assert.Contains(t, result, "added")
|
||||
assert.Contains(t, result, "failed")
|
||||
|
||||
results := result["results"].([]interface{})
|
||||
@@ -272,7 +272,7 @@ func TestCollectionsBulkOperations(t *testing.T) {
|
||||
json.NewDecoder(resp.Body).Decode(&result)
|
||||
|
||||
assert.Equal(t, 3.0, result["total"])
|
||||
assert.True(t, result["success"].(float64) > 0)
|
||||
assert.True(t, result["added"].(float64) > 0)
|
||||
})
|
||||
|
||||
t.Run("BulkAddBooks_MultipleCollections", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user