diff --git a/test/helpers/remove-pr-from-merge-queue.test.ts b/test/helpers/remove-pr-from-merge-queue.test.ts index f4ff9cbc..977329f7 100644 --- a/test/helpers/remove-pr-from-merge-queue.test.ts +++ b/test/helpers/remove-pr-from-merge-queue.test.ts @@ -57,16 +57,12 @@ describe('removePrFromMergeQueue', () => { beforeEach(() => { (octokit.repos.listCommitStatusesForRef as unknown as Mocktokit).mockImplementation(async () => ({ data: [ - { - created_at: '2022-01-01T10:00:00Z', - state: 'success' - }, { created_at: '2022-01-01T08:59:00Z', state: 'failure' }, { - created_at: '2022-01-01T10:00:00Z', + created_at: '2022-01-01T08:00:00Z', state: 'success' } ] @@ -136,47 +132,6 @@ describe('removePrFromMergeQueue', () => { }); }); - describe('should not remove pr case with no failure status', () => { - beforeEach(async () => { - (octokit.repos.listCommitStatusesForRef as unknown as Mocktokit).mockImplementation(async () => ({ - data: [ - { - created_at: '2022-01-01T10:00:00Z', - state: 'success' - }, - { - created_at: '2022-01-01T09:01:00Z', - state: 'pending' - }, - { - created_at: '2022-01-01T10:00:00Z', - state: 'success' - } - ] - })); - await removePrFromMergeQueue({ seconds }); - }); - - it('should call pulls.list with correct params', () => { - expect(octokit.pulls.list).toHaveBeenCalledWith({ - state: 'open', - per_page: 100, - ...context.repo - }); - }); - - it('should call listCommitStatusesForRef with correct params', () => { - expect(octokit.repos.listCommitStatusesForRef).toHaveBeenCalledWith({ - ref: 'correct sha', - ...context.repo - }); - }); - - it('should not call removeLabelIfExists', () => { - expect(removeLabelIfExists).not.toHaveBeenCalled(); - }); - }); - describe('should remove stray PRs in the queue', () => { beforeEach(async () => { (octokit.pulls.list as unknown as Mocktokit).mockImplementation(async () => ({