-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7472ae5
commit efbbce0
Showing
6 changed files
with
91 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
.../shared/components/Transaction/CredentialAccept/test/CredentialAcceptTableDetail.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { createTableDetailWrapperFactory } from '../../test' | ||
import { TableDetail } from '../TableDetail' | ||
import mockCredentialAccept from './mock_data/CredentialAccept.json' | ||
|
||
const createWrapper = createTableDetailWrapperFactory(TableDetail) | ||
|
||
describe('CredentialAcceptTableDetail', () => { | ||
it('renders CredentialAccept without crashing', () => { | ||
const wrapper = createWrapper(mockCredentialAccept) | ||
|
||
expect(wrapper.find('[data-test="account"]')).toHaveText( | ||
` rLbgNAngLq3HABBXK4uPGCHrqeZwgaYi7q `, | ||
) | ||
expect(wrapper.find('[data-test="amount"]')).toHaveText(`997.50 XRP`) | ||
expect(wrapper.find('[data-test="condition"]')).toHaveText( | ||
` A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120 `, | ||
) | ||
expect(wrapper.find('[data-test="finish_after"]')).toHaveText( | ||
`March 1, 2020 at 9:01:00 AM UTC`, | ||
) | ||
expect(wrapper.find('[data-test="cancel_after"]')).toHaveText( | ||
`March 1, 2020 at 8:54:20 AM UTC`, | ||
) | ||
|
||
wrapper.unmount() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/containers/shared/components/Transaction/PermissionedDomainDelete/TableDetail.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useTranslation } from 'react-i18next' | ||
import { type PermissionedDomainDelete } from 'xrpl' | ||
import { TransactionTableDetailProps } from '../types' | ||
|
||
export const TableDetail = ({ | ||
instructions, | ||
}: TransactionTableDetailProps<PermissionedDomainDelete>) => { | ||
const { t } = useTranslation() | ||
const { Account, DomainID } = instructions | ||
return ( | ||
<div className="permissionedDomainDelete"> | ||
{Account && ( | ||
<div className="account"> | ||
<span className="label">{t('account')}: </span> | ||
<span className="case-sensitive">{Account}</span> | ||
</div> | ||
)} | ||
{DomainID && ( | ||
<div className="domainId"> | ||
<span className="label">{t('domain_id')}: </span> | ||
<span className="case-sensitive">{DomainID}</span> | ||
</div> | ||
)} | ||
</div> | ||
) | ||
} |
32 changes: 32 additions & 0 deletions
32
src/containers/shared/components/Transaction/PermissionedDomainSet/TableDetail.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { useTranslation } from 'react-i18next' | ||
import { type PermissionedDomainSet } from 'xrpl' | ||
import { TransactionTableDetailProps } from '../types' | ||
|
||
export const TableDetail = ({ | ||
instructions, | ||
}: TransactionTableDetailProps<PermissionedDomainSet>) => { | ||
const { t } = useTranslation() | ||
const { Account, DomainID, AcceptedCredentials } = instructions | ||
return ( | ||
<div className="permissionedDomainSet"> | ||
{Account && ( | ||
<div className="account"> | ||
<span className="label">{t('account')}: </span> | ||
<span className="case-sensitive">{Account}</span> | ||
</div> | ||
)} | ||
{DomainID && ( | ||
<div className="domainId"> | ||
<span className="label">{t('domain_id')}: </span> | ||
<span className="case-sensitive">{DomainID}</span> | ||
</div> | ||
)} | ||
{AcceptedCredentials && ( | ||
<div className="acceptedCredentials"> | ||
<span className="label">{t('accepted_credentials')}: </span> | ||
<span className="case-sensitive">{AcceptedCredentials}</span> | ||
</div> | ||
)} | ||
</div> | ||
) | ||
} |