From 6cfd4bdfd3ce1690d2c82028e9b282b13c60e224 Mon Sep 17 00:00:00 2001 From: quality Date: Thu, 1 Oct 2026 11:51:48 -0400 Subject: [PATCH] test(bundle): drive the status event's success path through dist/index.js as a row of the head-sha lookup case Signed-off-by: quality --- __tests__/bundle/bundle.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/__tests__/bundle/bundle.test.ts b/__tests__/bundle/bundle.test.ts index 3145a4ef..eb3730b8 100644 --- a/__tests__/bundle/bundle.test.ts +++ b/__tests__/bundle/bundle.test.ts @@ -1410,7 +1410,11 @@ describe('dist/index.js', () => { expectRequests(configReads(), [pullRead, ownersProbe, bindingRead, queueRead, merge]) }) - it('check_suite completed without pull_requests: finds the pr by head sha', async () => { + // a check_suite without pull_requests and a legacy commit status name only the commit: both find the pr by its head sha + it.each([ + ['check_suite', checkSuiteCompletedEvent], + ['status', { sha: checkSuiteCompletedEvent.check_suite.head_sha, state: 'success', context: 'ci/lint', repository: checkSuiteCompletedEvent.repository }], + ])('%s with only a head sha: finds the pr by that sha', async (eventName, payload) => { const sha = checkSuiteCompletedEvent.check_suite.head_sha gh.commitStatuses(repo, sha, bound) gh.route('GET', new RegExp(`^${repo}/pulls\\?`), (req) => { @@ -1420,7 +1424,7 @@ describe('dist/index.js', () => { gh.route('GET', `${repo}/pulls/1`, { status: 200, body: { ...mergeablePr('clean'), head: { sha } } }) gh.route('PUT', `${repo}/pulls/1/merge`, { status: 200, body: { merged: true } }) - const result = await runBundle({ eventName: 'check_suite', payload: checkSuiteCompletedEvent, inputs: token, apiUrl: gh.url }) + const result = await runBundle({ eventName, payload, inputs: token, apiUrl: gh.url }) expect(result.status, result.stdout).toBe(0) expect(result.errors).toEqual([])