Skip to content

Commit

Permalink
Chore : test.js 친구 신청 수락하는 케이스만 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
this-is-spear committed Jan 18, 2024
1 parent 990b1fa commit b2cad94
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,29 +127,15 @@ export default function () {
return;
}

// B는 A의 친구 신청을 수락하거나 거절. 수락하는 확률을 더 높여야 함.
let acceptRequest = Math.random() > 0.2;
if (acceptRequest) {
let approveRequestResponse = http.post(`${BASE_URL}/members/friends/${requestId}/approval`, null, {
headers: {
Authorization: `Basic ${encoding.b64encode(toUserAuth)}`,
}
});
check(approveRequestResponse, {
'approveRequestResponse status is 200': (r) => r.status === 200,
});
} else {
let rejectRequestResponse = http.post(`${BASE_URL}/members/friends/${requestId}/rejected`, null, {
headers: {
Authorization: `Basic ${encoding.b64encode(toUserAuth)}`,
}
});

check(rejectRequestResponse, {
'rejectRequestResponse status is 200': (r) => r.status === 200,
});
return;
}
// B는 A의 친구 신청을 수락
let approveRequestResponse = http.post(`${BASE_URL}/members/friends/${requestId}/approval`, null, {
headers: {
Authorization: `Basic ${encoding.b64encode(toUserAuth)}`,
}
});
check(approveRequestResponse, {
'approveRequestResponse status is 200': (r) => r.status === 200,
});
}

// A는 자신의 계좌를 확인하고 임의로 선택
Expand Down

0 comments on commit b2cad94

Please sign in to comment.