Skip to content

Commit 5635fce

Browse files
committed
tests: verify that /open pr mentions several workflow runs when needed
The `/open pr` command shall start several runs e.g. when building GNU TLS, which exists both in MSYS and in MINGW variants. Let's verify that. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 5ae167a commit 5635fce

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

__tests__/index.test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,4 +237,19 @@ The MINGW workflow run [was started](dispatched-workflow-open-pr.yml)`,
237237
expect(mockGitHubApiRequestAsApp).not.toHaveBeenCalled()
238238
expect(dispatchedWorkflows).toHaveLength(2)
239239
expect(dispatchedWorkflows.map(e => e.payload.inputs.package)).toEqual(['mingw-w64-gnutls', 'gnutls'])
240+
expect(mockGitHubApiRequest).toHaveBeenCalled()
241+
const msysComment = mockGitHubApiRequest.mock.calls[mockGitHubApiRequest.mock.calls.length - 6]
242+
expect(msysComment[3]).toEqual('/repos/git-for-windows/git/issues/comments/0')
243+
expect(msysComment[4]).toEqual({
244+
body: `existing comment body
245+
246+
The MSYS workflow run [was started](dispatched-workflow-open-pr.yml)`
247+
})
248+
const mingwComment = mockGitHubApiRequest.mock.calls[mockGitHubApiRequest.mock.calls.length - 1]
249+
expect(mingwComment[3]).toEqual('/repos/git-for-windows/git/issues/comments/0')
250+
expect(mingwComment[4]).toEqual({
251+
body: `existing comment body
252+
253+
The MINGW workflow run [was started](dispatched-workflow-open-pr.yml)`
254+
})
240255
})

0 commit comments

Comments
 (0)