Skip to content

Commit

Permalink
add tests for avatarwithlink
Browse files Browse the repository at this point in the history
  • Loading branch information
storywithoutend committed Jun 19, 2023
1 parent 1f77a9c commit bdd9c06
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/components/@molecules/AvatarWithLink/AvatarWithLink.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { render, screen } from '@app/test-utils'

import { AvatarWithLink } from './AvatarWithLink'

describe('AvatarWithLink', () => {
it('should render', async () => {
render(<AvatarWithLink label="label" name="test.eth" />)
expect(screen.getByTestId('avatar-with-link')).toHaveAttribute('href', '/test.eth')
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const AvatarWithLink = ({ name, label }: Props) => {
const zorb = useZorb(name || '', 'name')
const profileURL = getDestination(`/profile/${name}`) as string
return (
<Container href={profileURL}>
<Container href={profileURL} data-testid="avatar-with-link">
<Avatar src={avatar || zorb} label={label} />
<Border />
<IconWrapper>
Expand Down
1 change: 0 additions & 1 deletion src/hooks/useProfileActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export const useProfileActions = ({
const actions: Action[] = []
if (!address || isLoading) return actions

console.log(isAvailablePrimaryName)
const transactionFlowItem = getPrimaryNameTransactionFlowItem?.callBack?.(name)
if (isAvailablePrimaryName && !!transactionFlowItem) {
const key = `setPrimaryName-${name}-${address}`
Expand Down

0 comments on commit bdd9c06

Please sign in to comment.