Skip to content

Commit 31b1198

Browse files
committed
tests: also test /add release note
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 9c3b9c8 commit 31b1198

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

__tests__/index.test.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,3 +294,32 @@ The [x86_64](dispatched-workflow-build-and-deploy.yml) and the [i686](dispatched
294294
expect(dispatchedWorkflows).toHaveLength(2)
295295
expect(dispatchedWorkflows.map(e => e.payload.inputs.architecture)).toEqual(['i686', 'x86_64'])
296296
})
297+
298+
testIssueComment('/add release note', {
299+
issue: {
300+
number: 4281,
301+
labels: [{ name: 'component-update' }],
302+
title: '[New gnutls version] GnuTLS 3.8.0',
303+
body: `Released a bug-fix and enhancement release on the 3.8.x branch.[GnuTLS 3.8.0](https://lists.gnupg.org/pipermail/gnutls-help/2023-February/004816.html)
304+
305+
Added the security advisory.[GNUTLS-SA-2020-07-14](security-new.html#GNUTLS-SA-2020-07-14)
306+
307+
http://www.gnutls.org/news.html#2023-02-10`
308+
}
309+
}, async (context) => {
310+
expect(await index(context, context.req)).toBeUndefined()
311+
expect(context.res).toEqual({
312+
body: `I edited the comment: appended-comment-body-existing comment body
313+
314+
The workflow run [was started](dispatched-workflow-add-release-note.yml)`,
315+
headers: undefined,
316+
status: undefined
317+
})
318+
expect(mockGetInstallationAccessToken).toHaveBeenCalledTimes(1)
319+
expect(mockGitHubApiRequestAsApp).not.toHaveBeenCalled()
320+
expect(dispatchedWorkflows).toHaveLength(1)
321+
expect(dispatchedWorkflows[0].payload.inputs).toEqual({
322+
message: 'Comes with [GNU TLS v3.8.0](https://lists.gnupg.org/pipermail/gnutls-help/2023-February/004816.html).',
323+
type: 'feature'
324+
})
325+
})

0 commit comments

Comments
 (0)