Skip to content

Commit

Permalink
main merge
Browse files Browse the repository at this point in the history
  • Loading branch information
vsingal-p committed Apr 2, 2024
2 parents 8981037 + 5c5ee61 commit 56a1883
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/helpers/approvals-satisfied.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,25 @@ describe('approvalsSatisfied', () => {
expect(result).toBe(true);
});

it('should return true when passing teams override and collective required approvals are met across multiple teams', async () => {
mockPagination({
data: [
{
state: 'APPROVED',
user: { login: 'user1' }
},
{
state: 'APPROVED',
user: { login: 'user2' }
}
]
});
const result = await approvalsSatisfied({ teams: 'team1\nteam2', pull_number: '12345', number_of_reviewers: '2' });
expect(octokit.pulls.listReviews).toHaveBeenCalledWith({ pull_number: 12345, repo: 'repo', owner: 'owner', page: 1, per_page: 100 });
expect(getRequiredCodeOwnersEntries).not.toHaveBeenCalled();
expect(result).toBe(true);
});

it('should return false when passing users override and required approvals are not met', async () => {
mockPagination({
data: [
Expand Down

0 comments on commit 56a1883

Please sign in to comment.