Improve collaboration request details response
هذا الالتزام موجود في:
@@ -3046,7 +3046,10 @@
|
||||
"pm.test('Status is 200 or 201', function () { pm.expect([200, 201]).to.include(pm.response.code); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('request');",
|
||||
"pm.expect(json.request).to.have.property('requester');",
|
||||
"pm.expect(json.request).to.have.property('targetUser');",
|
||||
"pm.environment.set('collaborationRequestId', json.request._id || json.request.id);",
|
||||
"pm.environment.set('requestId', json.request._id || json.request.id);",
|
||||
"pm.test('Rich collaboration fields are accepted', function () {",
|
||||
" pm.expect(json.request).to.have.property('collaborationType');",
|
||||
" pm.expect(json.request).to.have.property('message');",
|
||||
@@ -3104,7 +3107,10 @@
|
||||
"pm.test('Status is 200 or 201', function () { pm.expect([200, 201]).to.include(pm.response.code); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('request');",
|
||||
"pm.expect(json.request).to.have.property('requester');",
|
||||
"pm.expect(json.request).to.have.property('targetUser');",
|
||||
"pm.environment.set('collaborationRequestId', json.request._id || json.request.id);",
|
||||
"pm.environment.set('requestId', json.request._id || json.request.id);",
|
||||
"pm.test('General collaboration request has no post', function () {",
|
||||
" pm.expect(json.request.postId === null || typeof json.request.postId === 'undefined').to.equal(true);",
|
||||
" pm.expect(json.request).to.have.property('status', 'pending');",
|
||||
@@ -3138,6 +3144,7 @@
|
||||
"pm.expect(json).to.have.property('pagination');",
|
||||
"if (json.items.length) {",
|
||||
" pm.environment.set('collaborationRequestId', json.items[0]._id || json.items[0].id);",
|
||||
" pm.environment.set('requestId', json.items[0]._id || json.items[0].id);",
|
||||
" pm.expect(json.items[0]).to.have.property('status');",
|
||||
" pm.expect(json.items[0]).to.have.property('collaborationType');",
|
||||
"}"
|
||||
@@ -3170,10 +3177,15 @@
|
||||
"pm.expect(json).to.have.property('pagination');",
|
||||
"if (json.items.length) {",
|
||||
" pm.environment.set('collaborationRequestId', json.items[0]._id || json.items[0].id);",
|
||||
" pm.environment.set('requestId', json.items[0]._id || json.items[0].id);",
|
||||
" pm.expect(json.items[0]).to.have.property('status');",
|
||||
" pm.expect(json.items[0]).to.have.property('requesterId');",
|
||||
" pm.expect(json.items[0]).to.have.property('targetUserId');",
|
||||
" pm.expect(json.items[0]).to.have.property('postId');",
|
||||
" pm.expect(json.items[0]).to.have.property('requester');",
|
||||
" pm.expect(json.items[0]).to.have.property('targetUser');",
|
||||
" pm.expect(json.items[0].requester).to.have.property('username');",
|
||||
" pm.expect(json.items[0].targetUser).to.have.property('username');",
|
||||
"}"
|
||||
]
|
||||
}
|
||||
@@ -3204,10 +3216,15 @@
|
||||
"pm.expect(json).to.have.property('pagination');",
|
||||
"if (json.items.length) {",
|
||||
" pm.environment.set('collaborationRequestId', json.items[0]._id || json.items[0].id);",
|
||||
" pm.environment.set('requestId', json.items[0]._id || json.items[0].id);",
|
||||
" pm.expect(json.items[0]).to.have.property('status');",
|
||||
" pm.expect(json.items[0]).to.have.property('requesterId');",
|
||||
" pm.expect(json.items[0]).to.have.property('targetUserId');",
|
||||
" pm.expect(json.items[0]).to.have.property('postId');",
|
||||
" pm.expect(json.items[0]).to.have.property('requester');",
|
||||
" pm.expect(json.items[0]).to.have.property('targetUser');",
|
||||
" pm.expect(json.items[0].requester).to.have.property('username');",
|
||||
" pm.expect(json.items[0].targetUser).to.have.property('username');",
|
||||
"}"
|
||||
]
|
||||
}
|
||||
@@ -3235,6 +3252,8 @@
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('request');",
|
||||
"pm.expect(json.request).to.have.property('requester');",
|
||||
"pm.expect(json.request).to.have.property('targetUser');",
|
||||
"pm.expect(json.request).to.have.property('status');",
|
||||
"pm.expect(json.request).to.have.property('requesterId');",
|
||||
"pm.expect(json.request).to.have.property('targetUserId');",
|
||||
@@ -3265,7 +3284,10 @@
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('approved', true);",
|
||||
"pm.expect(json).to.have.property('request');"
|
||||
"pm.expect(json.request).to.have.property('status', 'approved');",
|
||||
"pm.expect(json).to.have.property('request');",
|
||||
"pm.expect(json.request).to.have.property('requester');",
|
||||
"pm.expect(json.request).to.have.property('targetUser');"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -3292,7 +3314,10 @@
|
||||
"pm.test('Status is 200', function () { pm.response.to.have.status(200); });",
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('rejected', true);",
|
||||
"pm.expect(json).to.have.property('request');"
|
||||
"pm.expect(json.request).to.have.property('status', 'rejected');",
|
||||
"pm.expect(json).to.have.property('request');",
|
||||
"pm.expect(json.request).to.have.property('requester');",
|
||||
"pm.expect(json.request).to.have.property('targetUser');"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -3320,6 +3345,8 @@
|
||||
"const json = pm.response.json();",
|
||||
"pm.expect(json).to.have.property('cancelled', true);",
|
||||
"pm.expect(json).to.have.property('request');",
|
||||
"pm.expect(json.request).to.have.property('requester');",
|
||||
"pm.expect(json.request).to.have.property('targetUser');",
|
||||
"pm.expect(json.request).to.have.property('status', 'cancelled');"
|
||||
]
|
||||
}
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم