From 7515edff7eca43b5ca38a5935ff1d0d1fa2b1a35 Mon Sep 17 00:00:00 2001 From: Adam Letizia Date: Thu, 11 May 2023 16:01:55 -0500 Subject: [PATCH] chore: add hostname test update dev entity annotations Signed-off-by: Adam Letizia --- plugins/github-actions/dev/index.tsx | 2 ++ .../components/Cards/RecentWorkflowRunsCard.test.tsx | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/github-actions/dev/index.tsx b/plugins/github-actions/dev/index.tsx index 93e6ee4f74..153478ddbc 100644 --- a/plugins/github-actions/dev/index.tsx +++ b/plugins/github-actions/dev/index.tsx @@ -33,6 +33,8 @@ const mockEntity: Entity = { description: 'backstage.io', annotations: { 'github.com/project-slug': 'backstage/backstage', + 'backstage.io/source-location': + 'url:https://ghes.acme.co/backstage/backstage/tree/master/', }, }, spec: { diff --git a/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.test.tsx b/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.test.tsx index f55cad8424..dcafc3b6f2 100644 --- a/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.test.tsx +++ b/plugins/github-actions/src/components/Cards/RecentWorkflowRunsCard.test.tsx @@ -48,6 +48,8 @@ describe('', () => { name: 'software', annotations: { 'github.com/project-slug': 'theorg/the-service', + 'backstage.io/source-location': + 'url:https://ghes.acme.co/theorg/the-service/tree/main/', }, }, spec: { @@ -119,10 +121,14 @@ describe('', () => { ); }); - it('uses the github repo and owner from the entity annotation', async () => { + it('uses the github hostname, repo and owner from the entity annotations', async () => { renderSubject(); expect(useWorkflowRuns).toHaveBeenCalledWith( - expect.objectContaining({ owner: 'theorg', repo: 'the-service' }), + expect.objectContaining({ + hostname: 'ghes.acme.co', + owner: 'theorg', + repo: 'the-service', + }), ); });