修改邀请好友的测试
This commit is contained in:
@@ -139,7 +139,7 @@ export class FriendHandler {
|
|||||||
str = getResStr(STATUS.FRIEND_YOURSELF); continue;
|
str = getResStr(STATUS.FRIEND_YOURSELF); continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let incResult = await RoleModel.increaseFriendApplyCnt(hisRoleId, 1, 50);
|
let incResult = await RoleModel.increaseFriendApplyCnt(hisRoleId, 1, FRIEND.FRIEND_MANAGE_APPLICATION);
|
||||||
if(!incResult) {
|
if(!incResult) {
|
||||||
str = getResStr(STATUS.FRIEND_HIS_APPLY_MAX); continue;
|
str = getResStr(STATUS.FRIEND_HIS_APPLY_MAX); continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,39 @@ describe('好友测试测试', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('清空申请', function(done) {
|
||||||
|
pinusClientT.request('role.friendHandler.getApplyList', {}, (res) => {
|
||||||
|
|
||||||
|
checkSuccessResponse(res);
|
||||||
|
expect(res.data.list).to.be.a('array');
|
||||||
|
res.data.list.forEach(cur => {
|
||||||
|
checkFriendApplyParams(cur);
|
||||||
|
});
|
||||||
|
|
||||||
|
const applyCodes = res.data.list.map(apply => {
|
||||||
|
return apply.applyCode;
|
||||||
|
});
|
||||||
|
pinusClientT.request('role.friendHandler.handleApply', { applyCodeList: applyCodes, isPass: false }, (res) => {
|
||||||
|
checkSuccessResponse(res);
|
||||||
|
expect(res.data.isSuccess).to.be.a('boolean');
|
||||||
|
expect(res.data.msg).to.be.a('string');
|
||||||
|
|
||||||
|
expect(res.data.applyCodeList).to.be.a('array');
|
||||||
|
res.data.applyCodeList.forEach(cur => {
|
||||||
|
expect(cur).to.be.a('string');
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(res.data.list).to.be.a('array');
|
||||||
|
res.data.list.forEach(cur => {
|
||||||
|
checkFriendListParam(cur);
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(res.data.friendCnt).to.be.a('number');
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('申请好友', function(done) {
|
it('申请好友', function(done) {
|
||||||
pinusClient.request('role.friendHandler.applyFriend', { roleIds: [roleInfoT.roleId] } , (res) => {
|
pinusClient.request('role.friendHandler.applyFriend', { roleIds: [roleInfoT.roleId] } , (res) => {
|
||||||
checkSuccessResponse(res);
|
checkSuccessResponse(res);
|
||||||
|
|||||||
Reference in New Issue
Block a user