Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtechjelinek committed Aug 4, 2023
1 parent 488eb41 commit 60e6fa4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
15 changes: 5 additions & 10 deletions actions/src/issues/checkIssueLabels.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ const checkLabels = async () => {
const handleGoodFirstIssueLabel = async (octokit, user) => {
const issueNumber = context.payload.issue.number;
// Comment on the issue and ping the onboarding team lead.
var commentBody = 'Hi @' + user + ', only certain users are allowed to add good first issue labels. Looping in @oppia/oppia-good-first-issue-labelers to add the label.';
var commentBody = (
'Hi @' + user + ', only certain users are allowed to add good ' +
'first issue labels. Looping in @oppia/oppia-good-first-issue-labelers ' +
'to add the label.'
);
await octokit.issues.createComment(
{
body: commentBody,
Expand All @@ -67,15 +71,6 @@ const handleGoodFirstIssueLabel = async (octokit, user) => {
owner: context.repo.owner,
repo: context.repo.repo
});

// Assign issue to Team Lead.
core.info(`Assigning to ${whitelist.teamLeads.onboardingTeam}.`);
await octokit.issues.addAssignees({
issue_number: issueNumber,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: [whitelist.teamLeads.onboardingTeam],
});
};

/**
Expand Down
10 changes: 0 additions & 10 deletions spec/checkIssueLabelsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,6 @@ describe('Check Issue Labels Module', () => {
repo: payload.repository.name,
});
});

it('should assign team lead', () => {
expect(octokit.issues.addAssignees).toHaveBeenCalled();
expect(octokit.issues.addAssignees).toHaveBeenCalledWith({
issue_number: payload.issue.number,
assignees: [whitelist.teamLeads.onboardingTeam],
owner: payload.repository.owner.login,
repo: payload.repository.name,
});
});
});

describe('check for good first issue by whitelisted user', () => {
Expand Down
1 change: 1 addition & 0 deletions userWhitelist.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
],
"codeOwnerFileReviewer":"DubeySandeep",
"teamLeads": {
"onboardingTeam": "DubeySandeep",
"releaseTeam": "vojtechjelinek",
"welfareTeam": "DubeySandeep"
},
Expand Down

0 comments on commit 60e6fa4

Please sign in to comment.