From 6017734ec8e8e8a637222e17a490eb11ecc188ef Mon Sep 17 00:00:00 2001 From: Peter Macdonald Date: Thu, 25 Aug 2022 19:18:52 +0200 Subject: [PATCH] Added projectId test scenario under the outputs section Signed-off-by: Peter Macdonald --- .../src/scaffolder/actions/builtin/publish/gitlab.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlab.test.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlab.test.ts index 27261ecd49..dc1d26d416 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlab.test.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlab.test.ts @@ -313,11 +313,12 @@ describe('publish:gitlab', () => { }); }); - it('should call output with the remoteUrl and repoContentsUrl', async () => { + it('should call output with the remoteUrl and repoContentsUrl and projectId', async () => { mockGitlabClient.Users.current.mockResolvedValue({ id: 12345 }); mockGitlabClient.Namespaces.show.mockResolvedValue({ id: 1234 }); mockGitlabClient.Projects.create.mockResolvedValue({ http_url_to_repo: 'http://mockurl.git', + id: 1234, }); await action.handler(mockContext); @@ -330,6 +331,7 @@ describe('publish:gitlab', () => { 'repoContentsUrl', 'http://mockurl/-/blob/master', ); + expect(mockContext.output).toHaveBeenCalledWith('projectId', 1234); }); it('should call the correct Gitlab APIs when setUserAsOwner option is true and integration config has a token', async () => {