Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions __tests__/bundle/bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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([])
Expand Down
Loading