Skip to content

Commit

Permalink
feat: masks a link if present
Browse files Browse the repository at this point in the history
  • Loading branch information
FritzHoing committed Sep 16, 2024
1 parent df11cc5 commit 987cc3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/DisplayField/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,11 @@ describe('<DisplayField />', () => {

for (const linkValue of linkValues) {
render(<DisplayField value={linkValue} />);
const link = screen.getByText(linkValue);
const link = screen.getByText('Link');
expect(link).toBeVisible();
expect(link).toBeInstanceOf(HTMLAnchorElement);
expect(link).toHaveAttribute('href', linkValue);
expect(link).toBe('A');
}

const noneLinkValues = [
Expand Down
2 changes: 1 addition & 1 deletion src/components/DisplayField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export const DisplayField: React.FC<DisplayFieldProps> = ({
target="_blank"
rel='noreferrer'
>
{value?.toString()}
Link
</a>
);
}
Expand Down

0 comments on commit 987cc3b

Please sign in to comment.