diff --git a/src/containers/shared/components/Account.tsx b/src/containers/shared/components/Account.tsx
index d3ef1063a..a7e90874c 100644
--- a/src/containers/shared/components/Account.tsx
+++ b/src/containers/shared/components/Account.tsx
@@ -15,16 +15,21 @@ export const Account = (props: AccountProps) => {
return (
<>
{link ? (
-
+
{parts[0]}
) : (
-
+
{parts[0]}
)}
{computedTag && (
-
+
:{computedTag}
)}
diff --git a/src/containers/shared/components/test/Account.test.tsx b/src/containers/shared/components/test/Account.test.tsx
index 73b618e8d..77061b532 100644
--- a/src/containers/shared/components/test/Account.test.tsx
+++ b/src/containers/shared/components/test/Account.test.tsx
@@ -6,97 +6,93 @@ import { cleanup, render, screen } from '@testing-library/react'
import i18n from '../../../../i18nTestConfig'
import { Account } from '../Account'
-const createWrapper = (component: JSX.Element) => (
-
- {component}
-
-)
+const createWrapper = (component: JSX.Element) =>
+ render(
+
+ {component}
+ ,
+ )
describe('Account', () => {
afterEach(cleanup)
it('should render with a link', () => {
const account = 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt'
- render(createWrapper())
- const link = screen.getByRole('link')
+ createWrapper()
+ const link = screen.getByTestId('account')
expect(link).toHaveClass('account')
expect(link).toHaveTextContent(account)
expect(link).toHaveAttribute('href', `/accounts/${account}`)
expect(link).toHaveAttribute('title', account)
expect(screen.queryByTestId('dt')).toBeNull()
- screen.debug()
})
- // it('should render without a link', () => {
- // const wrapper = createWrapper(
- // ,
- // )
- // const address = wrapper.find('.account').hostNodes()
- // expect(address).toHaveText('rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
- // expect(address).not.toHaveTagName('a')
- // expect(address).toHaveProp('title', 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
- // expect(wrapper.find('.dt')).not.toExist()
- // wrapper.unmount()
- // })
+ it('should render without a link', () => {
+ createWrapper(
+ ,
+ )
+ const link = screen.getByTestId('account')
+ expect(link).toHaveTextContent('rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
+ expect(link).not.toHaveAttribute('href')
+ expect(link).toHaveAttribute('title', 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
+ expect(screen.queryByTestId('dt')).toBeNull()
+ })
- // it('should render with a destination tag', () => {
- // const wrapper = createWrapper(
- // ,
- // )
- // const anchor = wrapper.find('a')
- // expect(anchor).toHaveClassName('account')
- // expect(anchor).toHaveText('rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
- // expect(anchor).toHaveProp(
- // 'href',
- // '/accounts/rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt',
- // )
- // expect(anchor).toHaveProp('title', 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
- // expect(wrapper.find('.dt')).toHaveText(':381702')
- // wrapper.unmount()
- // })
+ it('should render with a destination tag', () => {
+ createWrapper(
+ ,
+ )
+ const link = screen.getByTestId('account')
+ expect(link).toHaveClass('account')
+ expect(link).toHaveTextContent('rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
+ expect(link).toHaveAttribute(
+ 'href',
+ '/accounts/rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt',
+ )
+ expect(link).toHaveAttribute('title', 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
+ expect(screen.queryByTestId('dt')).toHaveTextContent(':381702')
+ })
- // it('should render with a destination tag and no link', () => {
- // const wrapper = createWrapper(
- // ,
- // )
- // const address = wrapper.find('.account')
- // expect(address).toHaveText('rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
- // expect(address).not.toHaveTagName('a')
- // expect(address).toHaveProp('title', 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
- // expect(wrapper.find('.dt')).toHaveText(':381702')
- // wrapper.unmount()
- // })
+ it('should render with a destination tag and no link', () => {
+ createWrapper(
+ ,
+ )
+ const link = screen.getByTestId('account')
+ expect(link).toHaveClass('account')
+ expect(link).toHaveTextContent('rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
+ expect(link).not.toHaveAttribute('href')
+ expect(link).toHaveAttribute('title', 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
+ expect(screen.queryByTestId('dt')).toHaveTextContent(':381702')
+ })
- // it('should render with a destination tag supplied separately', () => {
- // const wrapper = createWrapper(
- // ,
- // )
- // const anchor = wrapper.find('a')
- // expect(anchor).toHaveClassName('account')
- // expect(anchor).toHaveText('rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
- // expect(anchor).toHaveProp(
- // 'href',
- // '/accounts/rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt',
- // )
- // expect(anchor).toHaveProp('title', 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
- // expect(wrapper.find('.dt')).toHaveText(':123')
- // wrapper.unmount()
- // })
+ it('should render with a destination tag supplied separately', () => {
+ createWrapper(
+ ,
+ )
+ const link = screen.getByTestId('account')
+ expect(link).toHaveClass('account')
+ expect(link).toHaveTextContent('rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
+ expect(link).toHaveAttribute(
+ 'href',
+ '/accounts/rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt',
+ )
+ expect(link).toHaveAttribute('title', 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
+ expect(screen.queryByTestId('dt')).toHaveTextContent(':123')
+ })
- // it('should render with a destination tag supplied separately and no link', () => {
- // const wrapper = createWrapper(
- // ,
- // )
- // const address = wrapper.find('.account')
- // expect(address).toHaveText('rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
- // expect(address).not.toHaveTagName('a')
- // expect(address).toHaveProp('title', 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
- // expect(wrapper.find('.dt')).toHaveText(':123')
- // wrapper.unmount()
- // })
+ it('should render with a destination tag supplied separately and no link', () => {
+ createWrapper(
+ ,
+ )
+ const link = screen.getByTestId('account')
+ expect(link).toHaveTextContent('rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
+ expect(link).not.toHaveAttribute('href')
+ expect(link).toHaveAttribute('title', 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt')
+ expect(screen.queryByTestId('dt')).toHaveTextContent(':123')
+ })
})