Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
danadajian committed Jan 3, 2024
1 parent 1d12eb9 commit e8fcefd
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions test/helpers/manage-merge-queue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,17 @@ describe('manageMergeQueue', () => {

describe('pr ready for merge case queued #1', () => {
const queuedPrs = [{ labels: [{ name: READY_FOR_MERGE_PR_LABEL }] }];
const pullRequest = {
merged: false,
head: { sha: 'sha' },
labels: [{ name: READY_FOR_MERGE_PR_LABEL }]
};
beforeEach(async () => {
(octokit.pulls.list as unknown as Mocktokit).mockImplementation(async ({ page }) => ({
data: page === 1 ? queuedPrs : []
}));
(octokit.pulls.get as unknown as Mocktokit).mockImplementation(async () => ({
data: {
merged: false,
head: { sha: 'sha' },
labels: [{ name: READY_FOR_MERGE_PR_LABEL }]
}
data: pullRequest
}));
await manageMergeQueue();
});
Expand All @@ -181,11 +182,7 @@ describe('manageMergeQueue', () => {
});

it('should update PR with default branch', () => {
expect(updatePrWithDefaultBranch).toHaveBeenCalledWith({
merged: false,
head: { sha: 'sha' },
labels: [{ name: READY_FOR_MERGE_PR_LABEL }]
});
expect(updatePrWithDefaultBranch).toHaveBeenCalledWith(pullRequest);
});

it('should enable auto-merge', () => {
Expand Down

0 comments on commit e8fcefd

Please sign in to comment.