diff --git a/plugins/org/src/components/Cards/User/UserProfileCard/UserProfileCard.test.tsx b/plugins/org/src/components/Cards/User/UserProfileCard/UserProfileCard.test.tsx index acbd13703b..f339a5828c 100644 --- a/plugins/org/src/components/Cards/User/UserProfileCard/UserProfileCard.test.tsx +++ b/plugins/org/src/components/Cards/User/UserProfileCard/UserProfileCard.test.tsx @@ -75,7 +75,7 @@ describe('UserSummary Test', () => { }); describe('Edit Button', () => { - it('Should default to disabled', async () => { + it('Should not be present by default', async () => { const userEntity: UserEntity = { apiVersion: 'backstage.io/v1alpha1', kind: 'User', @@ -111,10 +111,10 @@ describe('Edit Button', () => { ), ); - expect(rendered.getByRole('button')).toBeDisabled(); + expect(rendered.queryByTitle('Edit Metadata')).not.toBeInTheDocument(); }); - it('Should be enabled when edit URL annotation is present', async () => { + it('Should be visible when edit URL annotation is present', async () => { const annotations: Record = { 'backstage.io/edit-url': 'https://example.com/user.yaml', }; @@ -153,6 +153,6 @@ describe('Edit Button', () => { }, ), ); - expect(rendered.getByRole('button')).toBeEnabled(); + expect(rendered.getByRole('button')).toBeInTheDocument(); }); }); diff --git a/plugins/org/src/components/Cards/User/UserProfileCard/UserProfileCard.tsx b/plugins/org/src/components/Cards/User/UserProfileCard/UserProfileCard.tsx index 39565d99d5..dd75578687 100644 --- a/plugins/org/src/components/Cards/User/UserProfileCard/UserProfileCard.tsx +++ b/plugins/org/src/components/Cards/User/UserProfileCard/UserProfileCard.tsx @@ -75,27 +75,25 @@ export const UserProfileCard = (props: { variant?: InfoCardVariants }) => { kind: 'Group', }); - const infoCardAction = entityMetadataEditUrl ? ( - - - - ) : ( - - - - ); - return ( } subheader={description} variant={props.variant} - action={infoCardAction} + action={ + <> + {entityMetadataEditUrl && ( + + + + )} + + } >