Skip to content

Commit b528ec5

Browse files
committed
fix tests
1 parent ac50fe0 commit b528ec5

File tree

9 files changed

+25
-26
lines changed

9 files changed

+25
-26
lines changed

src/containers/shared/components/Transaction/EscrowCreate/TableDetail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const TableDetail = (props: any) => {
1515
{amount && (
1616
<div>
1717
<span className="label">{t('amount')}</span>
18-
<Amount value={amount} data-testid="amount" />
18+
<Amount value={amount} />
1919
</div>
2020
)}
2121
{destination && (

src/containers/shared/components/Transaction/OracleDelete/Simple.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const Simple: TransactionSimpleComponent = ({
88
const { t } = useTranslation()
99
const { OracleDocumentID } = data.instructions
1010
return (
11-
<SimpleRow label={t('oracle_document_id')} data-test="oracle-document-id">
11+
<SimpleRow label={t('oracle_document_id')} data-testid="oracle-document-id">
1212
{OracleDocumentID}
1313
</SimpleRow>
1414
)

src/containers/shared/components/Transaction/OracleSet/Simple.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,26 @@ export const Simple: TransactionSimpleComponent = ({
2222
} = data.instructions
2323
return (
2424
<>
25-
<SimpleRow label={t('oracle_document_id')} data-test="oracle-document-id">
25+
<SimpleRow
26+
label={t('oracle_document_id')}
27+
data-testid="oracle-document-id"
28+
>
2629
{oracleDocumentID}
2730
</SimpleRow>
2831

2932
{provider && (
30-
<SimpleRow label={t('provider')} data-test="provider">
33+
<SimpleRow label={t('provider')} data-testid="provider">
3134
{provider}
3235
</SimpleRow>
3336
)}
3437

3538
{uri && (
36-
<SimpleRow label={t('uri')} data-test="uri">
39+
<SimpleRow label={t('uri')} data-testid="uri">
3740
{uri}
3841
</SimpleRow>
3942
)}
4043

41-
<SimpleRow label={t('last_update_time')} data-test="last-update-time">
44+
<SimpleRow label={t('last_update_time')} data-testid="last-update-time">
4245
{localizeDate(
4346
new Date(lastUpdateTime * MILLIS_PER_SECOND),
4447
language,
@@ -47,14 +50,14 @@ export const Simple: TransactionSimpleComponent = ({
4750
</SimpleRow>
4851

4952
{assetClass && (
50-
<SimpleRow label={t('asset_class')} data-test="asset-class">
53+
<SimpleRow label={t('asset_class')} data-testid="asset-class">
5154
{assetClass}
5255
</SimpleRow>
5356
)}
5457

55-
<SimpleRow label={t('trading_pairs')} data-test="trading-pairs">
58+
<SimpleRow label={t('trading_pairs')} data-testid="trading-pairs">
5659
{priceDataSeries.map((priceDataObj) => (
57-
<div className="amount list" data-test="amount">
60+
<div className="amount list" data-testid="amount">
5861
{priceDataObj.assetPrice ?? t('deleted')}
5962
<div className="one-line">
6063
<Currency currency={priceDataObj.baseAsset} />/

src/containers/shared/components/Transaction/PaymentChannelClaim/TableDetail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const TableDetail = ({
5151
</div>
5252
)}
5353
{channelAmount && !claimed && (
54-
<div data-testid="amount">
54+
<div data-testid="channel-amount">
5555
<span className="label">{t('channel_amount')}</span>
5656
<Amount value={channelAmount} />
5757
</div>

src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('PaymentChannelClaim: TableDetail', () => {
2121
expect(wrapper.find('[data-testid="claimed"]')).toHaveText(
2222
'claimed\uE9000.01 XRP (\uE90020.34284 XRP of \uE90070.00 XRP remaining)',
2323
)
24-
expect(wrapper.find('[data-testid="amount"]')).not.toExist()
24+
expect(wrapper.find('[data-testid="channel-amount"]')).not.toExist()
2525
expect(wrapper.find('[data-testid="renew"]')).not.toExist()
2626
expect(wrapper.find('[data-testid="close-request"]')).not.toExist()
2727
expect(wrapper.find('[data-testid="closed"]')).not.toExist()
@@ -37,7 +37,7 @@ describe('PaymentChannelClaim: TableDetail', () => {
3737
'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN',
3838
)
3939
expect(wrapper.find('[data-testid="claimed"]')).not.toExist()
40-
expect(wrapper.find('[data-testid="amount"]')).toHaveText(
40+
expect(wrapper.find('[data-testid="channel-amount"]')).toHaveText(
4141
'channel amount\uE90010.00 XRP',
4242
)
4343
expect(wrapper.find('[data-testid="renew"]')).not.toExist()
@@ -59,7 +59,7 @@ describe('PaymentChannelClaim: TableDetail', () => {
5959
'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN',
6060
)
6161
expect(wrapper.find('[data-testid="claimed"]')).not.toExist()
62-
expect(wrapper.find('[data-testid="amount"]')).toHaveText(
62+
expect(wrapper.find('[data-testid="channel-amount"]')).toHaveText(
6363
'channel amount\uE90010.00 XRP',
6464
)
6565
expect(wrapper.find('[data-testid="renew"]')).not.toExist()
@@ -81,7 +81,7 @@ describe('PaymentChannelClaim: TableDetail', () => {
8181
expect(wrapper.find('[data-testid="claimed"]')).toHaveText(
8282
'claimed\uE9001.00 XRP (\uE90099.00 XRP of \uE900100.00 XRP remaining)',
8383
)
84-
expect(wrapper.find('[data-testid="amount"]')).not.toExist()
84+
expect(wrapper.find('[data-testid="channel-amount"]')).not.toExist()
8585
expect(wrapper.find('[data-testid="renew"]')).not.toExist()
8686
expect(wrapper.find('[data-testid="close-request"]')).not.toExist()
8787
expect(wrapper.find('[data-testid="closed"]')).not.toExist()

src/containers/shared/components/Transaction/PaymentChannelCreate/TableDetail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const TableDetail = ({
2020
<span className="label">{t('destination')}</span>
2121
<Account account={destination} />
2222
</div>
23-
<div data-testid="amount">
23+
<div>
2424
<span className="label">{t('channel_amount')}</span>
2525
<Amount value={amount} />
2626
</div>

src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ describe('PaymentChannelCreate: TableDetail', () => {
1717
expect(wrapper.find('[data-testid="destination"]')).toHaveText(
1818
'destinationrUXYat4hW2M87gHoqKK7fC4cqrT9C6V7d7',
1919
)
20-
expect(wrapper.find('[data-testid="amount"]')).toHaveText(
21-
'channel amount\uE9001.00 XRP',
22-
)
20+
expect(wrapper.find('[data-testid="amount"]')).toHaveText('\uE9001.00 XRP')
2321
wrapper.unmount()
2422
})
2523

@@ -31,9 +29,7 @@ describe('PaymentChannelCreate: TableDetail', () => {
3129
expect(wrapper.find('[data-testid="destination"]')).toHaveText(
3230
'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN',
3331
)
34-
expect(wrapper.find('[data-testid="amount"]')).toHaveText(
35-
'channel amount\uE90010.00 XRP',
36-
)
32+
expect(wrapper.find('[data-testid="amount"]')).toHaveText('\uE90010.00 XRP')
3733
wrapper.unmount()
3834
})
3935

@@ -46,7 +42,7 @@ describe('PaymentChannelCreate: TableDetail', () => {
4642
'destinationrf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn:20170428',
4743
)
4844
expect(wrapper.find('[data-testid="amount"]')).toHaveText(
49-
'channel amount\uE900100.00 XRP',
45+
'\uE900100.00 XRP',
5046
)
5147
wrapper.unmount()
5248
})

src/containers/shared/components/Transaction/PaymentChannelFund/Simple.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const Simple = ({
2626
</SimpleRow>
2727
)}
2828
{channelAmount && (
29-
<SimpleRow label={t('channel_amount')} data-testid="amount">
29+
<SimpleRow label={t('channel_amount')} data-testid="channel-amount">
3030
<Amount value={channelAmount} />
3131
</SimpleRow>
3232
)}

src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ describe('PaymentChannelFund: Simple', () => {
1717
const wrapper = createWrapper(mockPaymentChannelFund)
1818
expectSimpleRowLabel(wrapper, 'increase', 'channel amount increase')
1919
expectSimpleRowText(wrapper, 'increase', '+\uE9001.00 XRP')
20-
expectSimpleRowLabel(wrapper, 'amount', 'channel amount')
21-
expectSimpleRowText(wrapper, 'amount', '\uE90075.00 XRP')
20+
expectSimpleRowLabel(wrapper, 'channel-amount', 'channel amount')
21+
expectSimpleRowText(wrapper, 'channel-amount', '\uE90075.00 XRP')
2222
expectSimpleRowLabel(wrapper, 'total', 'total claimed')
2323
expectSimpleRowText(wrapper, 'total', '\uE90061.859345 XRP')
2424
expectSimpleRowLabel(wrapper, 'source', 'source')
@@ -46,7 +46,7 @@ describe('PaymentChannelFund: Simple', () => {
4646
const wrapper = createWrapper(mockPaymentChannelFundFailed)
4747
expectSimpleRowLabel(wrapper, 'increase', 'channel amount increase')
4848
expectSimpleRowText(wrapper, 'increase', '+\uE90020.00 XRP')
49-
expectSimpleRowNotToExist(wrapper, 'amount')
49+
expectSimpleRowNotToExist(wrapper, 'channel-amount')
5050
expectSimpleRowNotToExist(wrapper, 'total')
5151
expectSimpleRowNotToExist(wrapper, 'source')
5252
expectSimpleRowNotToExist(wrapper, 'destination')

0 commit comments

Comments
 (0)