Skip to content

Commit 9b0ce53

Browse files
authored
send test expectations after teammate accepts (#514)
1 parent c176f25 commit 9b0ce53

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

src/bot/__tests__/acceptReviewRequest.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ describe('acceptReviewRequest', () => {
4848
text: "_Don't have a HackerRank account? Ping <@requester123> and they'll make one for you._",
4949
},
5050
};
51+
const expectedTestInfoBlock = {
52+
type: 'section',
53+
text: {
54+
type: 'mrkdwn',
55+
text: '*Test Information:*\nThe test has 4 questions: 2 easy and 2 medium difficulty.\nSection 1 contains the easy questions, Section 2 contains the medium questions.\nCandidates should try to solve one problem from each section.\nThey have 70 minutes total to complete the test.',
56+
},
57+
};
5158

5259
async function callHandleAccept() {
5360
const action = buildMockActionParam();
@@ -138,6 +145,7 @@ describe('acceptReviewRequest', () => {
138145
expectedHackerRankUrlBlock,
139146
expectedHackerRankInstructionsBlock,
140147
expectedHackerRankAccountHelpBlock,
148+
expectedTestInfoBlock,
141149
);
142150
expect(reviewCloser.closeReviewIfComplete).toHaveBeenCalledWith(app, '123');
143151
});

src/bot/acceptReviewRequest.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ export const acceptReviewRequest = {
102102
`_Don't have a HackerRank account? Ping ${mention({ id: review.requestorId })} and they'll make one for you._`,
103103
),
104104
);
105+
blocks.push(
106+
textBlock(
107+
'*Test Information:*\nThe test has 4 questions: 2 easy and 2 medium difficulty.\nSection 1 contains the easy questions, Section 2 contains the medium questions.\nCandidates should try to solve one problem from each section.\nThey have 70 minutes total to complete the test.',
108+
),
109+
);
105110
await chatService.updateDirectMessage(client, user.id, messageTimestamp, blocks);
106111

107112
await userRepo.markNowAsLastReviewedDate(user.id);

src/services/__tests__/ChatService.test.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,7 @@ describe('ChatService', () => {
7676
7777
*Candidate Type: ${candidateTypeDisplay}*
7878
79-
*The review is needed by end of day Today*
80-
81-
*Test Information:*
82-
83-
The test has 4 questions: 2 easy and 2 medium difficulty.
84-
Section 1 contains the easy questions, Section 2 contains the medium questions.
85-
Candidates should try to solve one problem from each section.
86-
They have 70 minutes total to complete the test.`;
79+
*The review is needed by end of day Today*`;
8780
await chatService.sendRequestReviewMessage(
8881
client,
8982
reviewerId,

src/utils/RequestBuilder.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ export const requestBuilder = {
5656
ul(...languages),
5757
bold(`Candidate Type: ${candidateTypeDisplay}`),
5858
bold(`The review is needed by end of day ${deadlineDisplay}`),
59-
compose(
60-
bold('Test Information:'),
61-
'The test has 4 questions: 2 easy and 2 medium difficulty.\nSection 1 contains the easy questions, Section 2 contains the medium questions.\nCandidates should try to solve one problem from each section.\nThey have 70 minutes total to complete the test.',
62-
),
6359
),
6460
},
6561
};

0 commit comments

Comments
 (0)