From d03a82dc204bb0273ea6cf66bebeed7b7d986097 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Tue, 29 Oct 2024 20:30:52 -0400 Subject: [PATCH 01/55] replace more --- .../components/Transaction/MPTokenAuthorize/Simple.tsx | 4 ++-- .../Transaction/MPTokenIssuanceCreate/Simple.tsx | 10 +++++----- .../Transaction/MPTokenIssuanceDestroy/Simple.tsx | 2 +- .../Transaction/MPTokenIssuanceSet/Simple.tsx | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/containers/shared/components/Transaction/MPTokenAuthorize/Simple.tsx b/src/containers/shared/components/Transaction/MPTokenAuthorize/Simple.tsx index 9823dfe4f..f046ba292 100644 --- a/src/containers/shared/components/Transaction/MPTokenAuthorize/Simple.tsx +++ b/src/containers/shared/components/Transaction/MPTokenAuthorize/Simple.tsx @@ -13,11 +13,11 @@ export const Simple: TransactionSimpleComponent = ({ return ( <> - + {MPTokenHolder && ( - + )} diff --git a/src/containers/shared/components/Transaction/MPTokenIssuanceCreate/Simple.tsx b/src/containers/shared/components/Transaction/MPTokenIssuanceCreate/Simple.tsx index 218ae93d2..28a9c62a6 100644 --- a/src/containers/shared/components/Transaction/MPTokenIssuanceCreate/Simple.tsx +++ b/src/containers/shared/components/Transaction/MPTokenIssuanceCreate/Simple.tsx @@ -24,7 +24,7 @@ export const Simple: TransactionSimpleComponent = ({ return ( <> {issuanceID && ( - + )} @@ -32,13 +32,13 @@ export const Simple: TransactionSimpleComponent = ({ {assetScale} )} {transferFee && ( - + {formattedFee} )} @@ -46,7 +46,7 @@ export const Simple: TransactionSimpleComponent = ({ {maxAmount} @@ -55,7 +55,7 @@ export const Simple: TransactionSimpleComponent = ({ {isValidJsonString(metadata) ? ( diff --git a/src/containers/shared/components/Transaction/MPTokenIssuanceDestroy/Simple.tsx b/src/containers/shared/components/Transaction/MPTokenIssuanceDestroy/Simple.tsx index 2b9bb6676..0b13f8eb8 100644 --- a/src/containers/shared/components/Transaction/MPTokenIssuanceDestroy/Simple.tsx +++ b/src/containers/shared/components/Transaction/MPTokenIssuanceDestroy/Simple.tsx @@ -11,7 +11,7 @@ export const Simple: TransactionSimpleComponent = ({ const { t } = useTranslation() return ( - + ) diff --git a/src/containers/shared/components/Transaction/MPTokenIssuanceSet/Simple.tsx b/src/containers/shared/components/Transaction/MPTokenIssuanceSet/Simple.tsx index 9f0b13ca8..a5b14e711 100644 --- a/src/containers/shared/components/Transaction/MPTokenIssuanceSet/Simple.tsx +++ b/src/containers/shared/components/Transaction/MPTokenIssuanceSet/Simple.tsx @@ -13,11 +13,11 @@ export const Simple: TransactionSimpleComponent = ({ return ( <> - + {MPTokenHolder && ( - + )} From 2e951b3b39ab3db16a942f189b7203c8b674ff90 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 9 May 2024 10:16:59 -0400 Subject: [PATCH 02/55] get started with transactions --- .vscode/settings.json | 1 + .../Transaction/AMMBid/test/AMMBid.test.tsx | 4 +-- .../AMMCreate/test/AMMCreate.test.tsx | 4 +-- .../test/AMMDeleteDescription.test.tsx | 4 +-- .../AMMDelete/test/AMMDeleteSimple.test.tsx | 4 +-- .../test/AMMDeleteTableDetail.test.tsx | 4 +-- .../AMMDeposit/test/AMMDeposit.test.tsx | 4 +-- .../Transaction/AMMVote/test/AMMVote.test.tsx | 4 +-- .../AMMWithdraw/test/AMMWithdraw.test.tsx | 4 +-- .../test/AccountDeleteSimple.test.tsx | 4 +-- .../test/AccountSetDescription.test.tsx | 4 +-- .../AccountSet/test/AccountSetSimple.test.tsx | 4 +-- .../test/AccountSetTableDetail.test.tsx | 4 +-- .../test/ClawbackDescription.test.tsx | 4 +-- .../Clawback/test/ClawbackSimple.test.tsx | 4 +-- .../test/ClawbackTableDetail.test.tsx | 4 +-- .../DIDDelete/test/DIDDeleteSimple.test.tsx | 4 +-- .../DIDSet/test/DIDSetSimple.test.tsx | 15 ++++++----- .../DIDSet/test/DIDSetTableDetail.test.tsx | 4 +-- .../test/DepositPreauthDescription.test.tsx | 4 +-- .../test/DepositPreauthSimple.test.tsx | 4 +-- .../test/EnableAmendmentSimple.test.tsx | 4 +-- .../test/EscrowCancelDescription.test.tsx | 4 +-- .../test/EscrowCancelSimple.test.tsx | 4 +-- .../test/EscrowCancelTableDetail.test.tsx | 4 +-- .../test/EscrowCreateDescription.test.tsx | 4 +-- .../test/EscrowCreateSimple.test.tsx | 4 +-- .../test/EscrowCreateTableDetail.test.tsx | 4 +-- .../test/EscrowFinishDescription.test.tsx | 4 +-- .../test/EscrowFinishSimple.test.tsx | 4 +-- .../test/EscrowFinishTableDetail.test.tsx | 4 +-- .../test/NFTokenAcceptOfferSimple.test.tsx | 4 +-- .../test/NFTokenBurnSimple.test.tsx | 4 +-- .../test/NFTokenCreateOfferSimple.test.tsx | 4 +-- .../test/OfferCreateDescription.test.tsx | 4 +-- .../test/OfferCreateSimple.test.tsx | 4 +-- .../test/OfferCreateTableDetail.test.tsx | 4 +-- .../test/OfferCreateDescription.test.tsx | 4 +-- .../test/OfferCreateSimple.test.tsx | 4 +-- .../test/OfferCreateTableDetail.test.tsx | 4 +-- .../Payment/test/PaymentDescription.test.tsx | 4 +-- .../Payment/test/PaymentSimple.test.tsx | 4 +-- .../Payment/test/PaymentTableDetail.test.tsx | 4 +-- .../PaymentChannelClaimDescription.test.tsx | 4 +-- .../test/PaymentChannelClaimSimple.test.tsx | 4 +-- .../PaymentChannelClaimTableDetail.test.tsx | 4 +-- .../PaymentChannelCreateDescription.test.tsx | 4 +-- .../test/PaymentChannelCreateSimple.test.tsx | 4 +-- .../PaymentChannelCreateTableDetail.test.tsx | 4 +-- .../PaymentChannelFundDescription.test.tsx | 4 +-- .../test/PaymentChannelFundSimple.test.tsx | 4 +-- .../SetFee/test/SetFeeDescription.test.tsx | 4 +-- .../SetFee/test/SetFeeSimple.test.tsx | 4 +-- .../SetHook/test/SetHookSimple.test.tsx | 4 +-- .../test/SetRegularKeyDescription.test.tsx | 4 +-- .../test/SetRegularKeySimple.test.tsx | 4 +-- .../test/SetRegularKeyTableDetail.test.tsx | 4 +-- .../test/SignerListSetDescription.test.tsx | 4 +-- .../test/SignerListSetSimple.test.tsx | 4 +-- .../test/SignerListSetTableDetail.test.tsx | 4 +-- .../components/Transaction/SimpleRow.tsx | 2 +- .../test/TicketCreateSimple.test.tsx | 4 +-- .../test/TicketCreateTableDetail.test.tsx | 4 +-- .../test/TrustSetDescription.test.tsx | 4 +-- .../TrustSet/test/TrustSetSimple.test.tsx | 4 +-- .../test/TrustSetTableDetail.test.tsx | 4 +-- .../UNLModify/test/UNLModifySimple.test.tsx | 4 +-- .../XChainAccountCreateCommitSimple.test.tsx | 4 +-- ...AddAccountCreateAttestationSimple.test.tsx | 4 +-- .../XChainAddClaimAttestationSimple.test.tsx | 4 +-- .../test/XChainClaimSimple.test.tsx | 4 +-- .../test/XChainCommitSimple.test.tsx | 4 +-- .../test/XChainCreateBridgeSimple.test.tsx | 4 +-- .../test/XChainCreateClaimIDSimple.test.tsx | 4 +-- .../test/XChainModifyBridgeSimple.test.tsx | 4 +-- .../Transaction/test/DefaultSimple.test.tsx | 2 +- ...perFactory.tsx => createRenderFactory.tsx} | 26 +++++++++---------- .../Transaction/test/expectations.ts | 25 +++++------------- .../components/Transaction/test/index.ts | 2 +- 79 files changed, 175 insertions(+), 186 deletions(-) rename src/containers/shared/components/Transaction/test/{createWrapperFactory.tsx => createRenderFactory.tsx} (76%) diff --git a/.vscode/settings.json b/.vscode/settings.json index 73e6a5b81..f54856a5b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -78,6 +78,7 @@ "paystrings", "stylelint", "svgr", + "testid", "topojson", "VITE", "xchain", diff --git a/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx b/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx index 3dd293355..e39aafc6b 100644 --- a/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx +++ b/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx @@ -1,9 +1,9 @@ import { Simple } from '../Simple' -import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test' +import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import bidMock from './mock_data/amm_bid.json' describe('AMM Bid Tests', () => { - const createWrapper = createSimpleWrapperFactory(Simple) + const createWrapper = createSimpleRenderFactory(Simple) it('renders from transaction', () => { const wrapper = createWrapper(bidMock) diff --git a/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx b/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx index 6e08063a6..20c1de190 100644 --- a/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx +++ b/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx @@ -1,9 +1,9 @@ import { Simple } from '../Simple' -import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test' +import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import createMock from './mock_data/amm_create.json' describe('AMM Create Tests', () => { - const createWrapper = createSimpleWrapperFactory(Simple) + const createWrapper = createSimpleRenderFactory(Simple) it('renders from transaction', () => { const wrapper = createWrapper(createMock) diff --git a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx index a3c04bebe..0fe55fd88 100644 --- a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx @@ -1,9 +1,9 @@ import i18n from '../../../../../../i18n/testConfigEnglish' import mockAMMDelete from './mock_data/AMMDelete.json' import { Description } from '../Description' -import { createDescriptionWrapperFactory } from '../../test' +import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionWrapperFactory(Description, i18n) +const createWrapper = createDescriptionRenderFactory(Description, i18n) describe('AMMDelete: Description', () => { it('renders description for AMMDelete transaction', () => { diff --git a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteSimple.test.tsx b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteSimple.test.tsx index b516be24a..c24f93611 100644 --- a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteSimple.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteSimple.test.tsx @@ -1,11 +1,11 @@ import i18n from '../../../../../../i18n/testConfigEnglish' import { expectSimpleRowText } from '../../test' -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockAMMDelete from './mock_data/AMMDelete.json' -const createWrapper = createSimpleWrapperFactory(Simple, i18n) +const createWrapper = createSimpleRenderFactory(Simple, i18n) describe('AMMDelete: Simple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx index 2d2b6ea70..62ad9ecc9 100644 --- a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx @@ -1,9 +1,9 @@ import { TableDetail } from '../TableDetail' import mockAMMDelete from './mock_data/AMMDelete.json' -import { createTableDetailWrapperFactory } from '../../test' +import { createTableDetailRenderFactory } from '../../test' import i18n from '../../../../../../i18n/testConfigEnglish' -const createWrapper = createTableDetailWrapperFactory(TableDetail, i18n) +const createWrapper = createTableDetailRenderFactory(TableDetail, i18n) describe('AMMDelete: TableDetail', () => { it('renders with an expiration and offer', () => { diff --git a/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx b/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx index f90ddcbe2..75ca84e71 100644 --- a/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx @@ -1,6 +1,6 @@ import { Simple } from '../Simple' import { - createSimpleWrapperFactory, + createSimpleRenderFactory, expectSimpleRowNotToExist, expectSimpleRowText, } from '../../test' @@ -12,7 +12,7 @@ import depositNonXRP from './mock_data/deposit_nonxrp.json' import depositFail from './mock_data/deposit_fail.json' describe('AMM Deposit Tests', () => { - const createWrapper = createSimpleWrapperFactory(Simple) + const createWrapper = createSimpleRenderFactory(Simple) it('renders with both assets', () => { const wrapper = createWrapper(depositBothAssets) diff --git a/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx b/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx index e9e9799a3..7260f6de4 100644 --- a/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx +++ b/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx @@ -1,9 +1,9 @@ import { Simple } from '../Simple' -import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test' +import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import voteMock from './mock_data/amm_vote.json' describe('AMM Vote Tests', () => { - const createWrapper = createSimpleWrapperFactory(Simple) + const createWrapper = createSimpleRenderFactory(Simple) it('renders from transaction', () => { const wrapper = createWrapper(voteMock) diff --git a/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx b/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx index c086d1545..b878a0506 100644 --- a/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx +++ b/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx @@ -1,6 +1,6 @@ import { Simple } from '../Simple' import { - createSimpleWrapperFactory, + createSimpleRenderFactory, expectSimpleRowNotToExist, expectSimpleRowText, } from '../../test' @@ -10,7 +10,7 @@ import withdrawXRPMock from './mock_data/withdraw_xrp.json' import withdrawEpriceMock from './mock_data/withdraw_eprice.json' describe('AMM Withdraw Tests', () => { - const createWrapper = createSimpleWrapperFactory(Simple) + const createWrapper = createSimpleRenderFactory(Simple) it('renders from transaction', () => { const wrapper = createWrapper(withdrawMock) diff --git a/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx b/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx index 97a9c908f..0a75e791c 100644 --- a/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx +++ b/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx @@ -1,11 +1,11 @@ import i18n from '../../../../../../i18n/testConfigEnglish' -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockAccountDelete from './mock_data/AccountDelete.json' import mockAccountDeleteWithDestinationTag from './mock_data/AccountDeleteWithDestinationTag.json' -const createWrapper = createSimpleWrapperFactory(Simple, i18n) +const createWrapper = createSimpleRenderFactory(Simple, i18n) describe('AccountDelete: Simple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx index 17c70de7c..a07850dd6 100644 --- a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx @@ -1,14 +1,14 @@ import i18n from '../../../../../../i18n/testConfigEnglish' import { Description } from '../Description' -import { createDescriptionWrapperFactory } from '../../test' +import { createDescriptionRenderFactory } from '../../test' import mockAccountSetWithDomain from './mock_data/AccountSetWithDomain.json' import mockAccountSetWithClearFlag from './mock_data/AccountSetWithClearFlag.json' import mockAccountSetWithSetFlag from './mock_data/AccountSetWithSetFlag.json' import mockAccountSetWithMessageKey from './mock_data/AccountSetWithMessageKey.json' import mockAccountSetWithNFTokenMinter from './mock_data/AccountSetWithNFTokenMinter.json' -const createWrapper = createDescriptionWrapperFactory(Description, i18n) +const createWrapper = createDescriptionRenderFactory(Description, i18n) describe('AccountSet: Description', () => { it('renders tx that sets the domain', () => { diff --git a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetSimple.test.tsx b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetSimple.test.tsx index 628b1c77e..292dccab9 100644 --- a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetSimple.test.tsx @@ -1,6 +1,6 @@ import i18n from '../../../../../../i18n/testConfigEnglish' -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockAccountSetWithDomain from './mock_data/AccountSetWithDomain.json' import mockAccountSetWithClearFlag from './mock_data/AccountSetWithClearFlag.json' @@ -9,7 +9,7 @@ import mockAccountSetWithMessageKey from './mock_data/AccountSetWithMessageKey.j import mockAccountSetWithNFTokenMinter from './mock_data/AccountSetWithNFTokenMinter.json' import { expectSimpleRowLabel, expectSimpleRowText } from '../../test' -const createWrapper = createSimpleWrapperFactory(Simple, i18n) +const createWrapper = createSimpleRenderFactory(Simple, i18n) describe('AccountSet: Simple', () => { it('renders tx that sets the domain', () => { diff --git a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx index dbc1527ff..b1c768c2f 100644 --- a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx @@ -1,4 +1,4 @@ -import { createTableDetailWrapperFactory } from '../../test' +import { createTableDetailRenderFactory } from '../../test' import i18n from '../../../../../../i18n/testConfigEnglish' import { TableDetail } from '../TableDetail' @@ -8,7 +8,7 @@ import mockAccountSetWithSetFlag from './mock_data/AccountSetWithSetFlag.json' import mockAccountSetWithMessageKey from './mock_data/AccountSetWithMessageKey.json' import mockAccountSetWithNFTokenMinter from './mock_data/AccountSetWithNFTokenMinter.json' -const createWrapper = createTableDetailWrapperFactory(TableDetail, i18n) +const createWrapper = createTableDetailRenderFactory(TableDetail, i18n) describe('AccountSet: TableDetail', () => { it('renders tx that sets the domain', () => { diff --git a/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx b/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx index 2bd59f9ff..ef75b0fc1 100644 --- a/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx +++ b/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx @@ -1,9 +1,9 @@ -import { createDescriptionWrapperFactory } from '../../test' +import { createDescriptionRenderFactory } from '../../test' import { Description } from '../Description' import transaction from './mock_data/Clawback.json' import i18n from '../../../../../../i18n/testConfigEnglish' -const createWrapper = createDescriptionWrapperFactory(Description, i18n) +const createWrapper = createDescriptionRenderFactory(Description, i18n) describe('Clawback', () => { it('handles Clawback Description ', () => { diff --git a/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx b/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx index 1a7e19ee7..8d2cd6392 100644 --- a/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx +++ b/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx @@ -1,5 +1,5 @@ import { useQuery } from 'react-query' -import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test' +import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import { Simple } from '../Simple' import transaction from './mock_data/Clawback.json' import transactionFailure from './mock_data/Clawback_Failure.json' @@ -11,7 +11,7 @@ jest.mock('react-query', () => ({ useQuery: jest.fn(), })) -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('Clawback', () => { it('handles Clawback simple view ', () => { diff --git a/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx b/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx index 0fd2926e5..2bd7b414f 100644 --- a/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx @@ -1,8 +1,8 @@ -import { createTableDetailWrapperFactory } from '../../test' +import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import transaction from './mock_data/Clawback.json' -const createWrapper = createTableDetailWrapperFactory(TableDetail) +const createWrapper = createTableDetailRenderFactory(TableDetail) describe('Clawback', () => { it('handles Clawback TableDetail ', () => { diff --git a/src/containers/shared/components/Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx b/src/containers/shared/components/Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx index 6b81a49a5..08d0262f3 100644 --- a/src/containers/shared/components/Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx +++ b/src/containers/shared/components/Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx @@ -1,8 +1,8 @@ -import { createSimpleWrapperFactory } from '../../test' +import { createSimpleRenderFactory } from '../../test' import { Simple } from '../Simple' import DIDDelete from './mock_data/DIDDelete.json' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('DIDDelete: Simple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetSimple.test.tsx b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetSimple.test.tsx index 433d2a4ed..13735b8da 100644 --- a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetSimple.test.tsx @@ -1,15 +1,16 @@ -import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test' +import { cleanup, screen } from '@testing-library/react' +import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import { Simple } from '../Simple' import DIDSet from './mock_data/DIDSet.json' -const createWrapper = createSimpleWrapperFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('DIDSet: Simple', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(DIDSet) - expectSimpleRowText(wrapper, 'uri', 'did_example') - expectSimpleRowText(wrapper, 'did-document', 'doc') - expectSimpleRowText(wrapper, 'attestation', 'attest') - wrapper.unmount() + renderComponent(DIDSet) + expectSimpleRowText(screen, 'uri', 'did_example') + expectSimpleRowText(screen, 'did_document', 'doc') + expectSimpleRowText(screen, 'attestation', 'attest') }) }) diff --git a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx index 8a0af72fd..bef41ab89 100644 --- a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx @@ -1,8 +1,8 @@ -import { createTableDetailWrapperFactory } from '../../test' +import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import DIDSet from './mock_data/DIDSet.json' -const createWrapper = createTableDetailWrapperFactory(TableDetail) +const createWrapper = createTableDetailRenderFactory(TableDetail) describe('DIDSet: TableDetail', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthDescription.test.tsx b/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthDescription.test.tsx index fdaa7079e..8b3c5dce8 100644 --- a/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthDescription.test.tsx +++ b/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthDescription.test.tsx @@ -4,9 +4,9 @@ import mockDepositPreaut from './mock_data/DepositPreauth.json' import mockDepositPreauthUnauthorize from './mock_data/DepositPreauthUnauthorize.json' import { Description } from '../Description' -import { createDescriptionWrapperFactory } from '../../test' +import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionWrapperFactory(Description, i18n) +const createWrapper = createDescriptionRenderFactory(Description, i18n) describe('DepositPreauth: Description', () => { it('renders description for authorize', () => { diff --git a/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthSimple.test.tsx b/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthSimple.test.tsx index 3793f16d2..aa90425ce 100644 --- a/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthSimple.test.tsx +++ b/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthSimple.test.tsx @@ -1,11 +1,11 @@ import i18n from '../../../../../../i18n/testConfigEnglish' -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockDepositPreauth from './mock_data/DepositPreauth.json' import mockDepositPreauthUnauthorize from './mock_data/DepositPreauthUnauthorize.json' -const createWrapper = createSimpleWrapperFactory(Simple, i18n) +const createWrapper = createSimpleRenderFactory(Simple, i18n) describe('DepositPreauth: Simple', () => { it('renders authorized', () => { diff --git a/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx b/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx index a39951432..8a089955d 100644 --- a/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx @@ -1,6 +1,6 @@ import i18n from '../../../../../../i18n/testConfigEnglish' import { expectSimpleRowLabel, expectSimpleRowText } from '../../test' -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockEnableAmendmentWithEnabled from './mock_data/EnableAmendmentWithEnabled.json' @@ -12,7 +12,7 @@ import { getRippledVersion } from '../../../../amendmentUtils' import { flushPromises } from '../../../../../test/utils' import { getFeature } from '../../../../../../rippled/lib/rippled' -const createWrapper = createSimpleWrapperFactory(Simple, i18n) +const createWrapper = createSimpleRenderFactory(Simple, i18n) jest.mock('../../../../amendmentUtils', () => { // Require the original module to not be mocked... diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx index 25af99edc..d71594a00 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx @@ -1,8 +1,8 @@ import EscrowCancel from './mock_data/EscrowCancel.json' import { Description } from '../Description' -import { createDescriptionWrapperFactory } from '../../test' +import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionWrapperFactory(Description) +const createWrapper = createDescriptionRenderFactory(Description) describe('EscrowCancelDescription', () => { it('renders description for EscrowCancel', () => { diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx index 9865b6169..98995a9d7 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx @@ -1,8 +1,8 @@ -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockEscrowCancel from './mock_data/EscrowCancel.json' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('EscrowCancelSimple', () => { it('renders with an expiration and offer', () => { diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx index be2e5f173..2b5c8e229 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx @@ -1,9 +1,9 @@ import { TableDetail } from '../TableDetail' import mockEscrowCancel from './mock_data/EscrowCancel.json' -import { createTableDetailWrapperFactory } from '../../test' +import { createTableDetailRenderFactory } from '../../test' import i18nTestConfigEnUS from '../../../../../../i18n/testConfigEnglish' -const createWrapper = createTableDetailWrapperFactory( +const createWrapper = createTableDetailRenderFactory( TableDetail, i18nTestConfigEnUS, ) diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx index 0c256b19e..d4c5b1362 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx @@ -1,8 +1,8 @@ import EscrowCreate from './mock_data/EscrowCreate.json' import { Description } from '../Description' -import { createDescriptionWrapperFactory } from '../../test' +import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionWrapperFactory(Description) +const createWrapper = createDescriptionRenderFactory(Description) describe('EscrowCreateDescription', () => { it('renders description for EscrowCreate', () => { diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx index 27da075d6..57e0c817c 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx @@ -1,8 +1,8 @@ import { Simple } from '../Simple' import mockEscrowCreate from './mock_data/EscrowCreate.json' -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('EscrowCreateSimple', () => { it('renders with an expiration and offer', () => { diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx index 8bdca0c92..93c490c8c 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx @@ -1,8 +1,8 @@ -import { createTableDetailWrapperFactory } from '../../test' +import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import mockEscrowCreate from './mock_data/EscrowCreate.json' -const createWrapper = createTableDetailWrapperFactory(TableDetail) +const createWrapper = createTableDetailRenderFactory(TableDetail) describe('EscrowCreateTableDetail', () => { it('renders EscrowCreate without crashing', () => { diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx index 558762aa2..b1aa79519 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx @@ -1,8 +1,8 @@ import EscrowFinish from './mock_data/EscrowFinish.json' import { Description } from '../Description' -import { createDescriptionWrapperFactory } from '../../test' +import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionWrapperFactory(Description) +const createWrapper = createDescriptionRenderFactory(Description) describe('EscrowFinishDescription', () => { it('renders description for EscrowFinish', () => { diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx index 32c67a94d..4c4b7cad3 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx @@ -1,8 +1,8 @@ -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockEscrowFinish from './mock_data/EscrowFinish.json' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('EscrowFinishSimple', () => { it('renders with an expiration and offer', () => { diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx index 7bc188a40..7b667fb84 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx @@ -1,8 +1,8 @@ -import { createTableDetailWrapperFactory } from '../../test' +import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import mockEscrowFinish from './mock_data/EscrowFinish.json' -const createWrapper = createTableDetailWrapperFactory(TableDetail) +const createWrapper = createTableDetailRenderFactory(TableDetail) describe('EscrowFinishTableDetail', () => { it('renders EscrowFinish without crashing', () => { diff --git a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx index f324577bc..c9e751c2b 100644 --- a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx @@ -1,4 +1,4 @@ -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import transactionBuy from './mock_data/NFTokenAcceptOffer_Buy.json' import transactionSell from './mock_data/NFTokenAcceptOffer_Sell.json' @@ -6,7 +6,7 @@ import transactionFailure from './mock_data/NFTokenAcceptOffer_Failure.json' import transactionBroker from './mock_data/NFTokenAcceptOffer_Broker.json' import { expectSimpleRowText, expectSimpleRowNotToExist } from '../../test' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('NFTokenAcceptOffer', () => { it('handles NFTokenAcceptOffer Buy simple view ', () => { diff --git a/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx index 73d99fb27..2642d270f 100644 --- a/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx @@ -1,5 +1,5 @@ import { - createSimpleWrapperFactory, + createSimpleRenderFactory, expectSimpleRowText, expectSimpleRowNotToExist, } from '../../test' @@ -7,7 +7,7 @@ import { Simple } from '../Simple' import transaction from './mock_data/NFTokenBurn.json' import transactionByIssuer from './mock_data/NFTokenBurnByIssuer.json' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('NFTokenBurn', () => { it('handles NFTokenBurn simple view ', () => { diff --git a/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx index 110891c70..4a5b9b9f5 100644 --- a/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx @@ -1,11 +1,11 @@ -import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test' +import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import { Simple } from '../Simple' import transactionBuy from './mock_data/NFTokenCreateOffer_Buy.json' import transactionSell from './mock_data/NFTokenCreateOffer_Sell.json' import transactionFailed from './mock_data/NFTokenCreateOfferFailed.json' import transactionDestination from './mock_data/NFTokenCreateOfferDestination.json' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('NFTokenCreateOffer', () => { it('handles NFTokenCreateOffer buy simple view ', () => { diff --git a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx index 50f0f9051..84f2a91b5 100644 --- a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx @@ -1,8 +1,8 @@ -import { createDescriptionWrapperFactory } from '../../test' +import { createDescriptionRenderFactory } from '../../test' import { Description } from '../Description' import offerCancel from './mock_data/OfferCancel.json' -const createWrapper = createDescriptionWrapperFactory(Description) +const createWrapper = createDescriptionRenderFactory(Description) describe('OfferCancel: Description', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateSimple.test.tsx b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateSimple.test.tsx index b3c1ef555..431eaa7c8 100644 --- a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateSimple.test.tsx @@ -1,8 +1,8 @@ -import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test' +import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import { Simple } from '../Simple' import offerCancel from './mock_data/OfferCancel.json' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('OfferCancel: Simple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx index 2c2932bc3..8a8965bbd 100644 --- a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx @@ -1,8 +1,8 @@ -import { createTableDetailWrapperFactory } from '../../test' +import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import offerCancel from './mock_data/OfferCancel.json' -const createWrapper = createTableDetailWrapperFactory(TableDetail) +const createWrapper = createTableDetailRenderFactory(TableDetail) describe('OfferCancel: TableDetail', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx index fd467dcde..a0264bc91 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx @@ -1,9 +1,9 @@ import OfferCreate from './mock_data/OfferCreateWithExpirationAndCancel.json' import OfferCreateInvertedCurrencies from './mock_data/OfferCreateInvertedCurrencies.json' import { Description } from '../Description' -import { createDescriptionWrapperFactory } from '../../test' +import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionWrapperFactory(Description) +const createWrapper = createDescriptionRenderFactory(Description) describe('OfferCreate: Description', () => { it('renders description for transaction with cancel and expiration', () => { diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx index 0953e75ac..23e661320 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx @@ -1,9 +1,9 @@ import { Simple } from '../Simple' import mockOfferCreateWithCancel from './mock_data/OfferCreateWithExpirationAndCancel.json' import mockOfferCreate from './mock_data/OfferCreate.json' -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('OfferCreate: Simple', () => { it('renders with an expiration and offer', () => { diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx index 059b95d94..f2196ebf5 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx @@ -2,9 +2,9 @@ import { TableDetail } from '../TableDetail' import mockOfferCreateInvertedCurrencies from './mock_data/OfferCreateInvertedCurrencies.json' import mockOfferCreateWithCancel from './mock_data/OfferCreateWithExpirationAndCancel.json' import mockOfferCreate from './mock_data/OfferCreate.json' -import { createTableDetailWrapperFactory } from '../../test' +import { createTableDetailRenderFactory } from '../../test' -const createWrapper = createTableDetailWrapperFactory(TableDetail) +const createWrapper = createTableDetailRenderFactory(TableDetail) describe('OfferCreate: TableDetail', () => { it('renders with an expiration and offer', () => { diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx index fc0fbf80c..72f98dc3a 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx @@ -7,9 +7,9 @@ import mockPaymentDestinationTag from './mock_data/PaymentWithDestinationTag.jso import mockPaymentPartial from './mock_data/PaymentWithPartial.json' import mockPaymentSendMax from './mock_data/PaymentWithSendMax.json' import mockPaymentSourceTag from './mock_data/PaymentWithSourceTag.json' -import { createDescriptionWrapperFactory } from '../../test' +import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionWrapperFactory(Description, i18n) +const createWrapper = createDescriptionRenderFactory(Description, i18n) describe('Payment: Description', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx index b05890cde..4946d015d 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx @@ -1,6 +1,6 @@ import { useQuery } from 'react-query' import { - createSimpleWrapperFactory, + createSimpleRenderFactory, expectSimpleRowLabel, expectSimpleRowText, } from '../../test' @@ -18,7 +18,7 @@ jest.mock('react-query', () => ({ useQuery: jest.fn(), })) -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('Payment: Simple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx index 9f49f0d7f..c58dabb23 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx @@ -1,4 +1,4 @@ -import { createTableDetailWrapperFactory } from '../../test' +import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import mockPayment from './mock_data/Payment.json' import mockPaymentConvert from './mock_data/PaymentWithConvert.json' @@ -7,7 +7,7 @@ import mockPaymentPartial from './mock_data/PaymentWithPartial.json' import mockPaymentSendMax from './mock_data/PaymentWithSendMax.json' import mockPaymentSourceTag from './mock_data/PaymentWithSourceTag.json' -const createWrapper = createTableDetailWrapperFactory(TableDetail) +const createWrapper = createTableDetailRenderFactory(TableDetail) describe('Payment: TableDetail', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx index f9cbe4db6..a9f04c584 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx @@ -1,13 +1,13 @@ import i18n from '../../../../../../i18n/testConfigEnglish' -import { createDescriptionWrapperFactory } from '../../test/createWrapperFactory' +import { createDescriptionRenderFactory } from '../../test/createRenderFactory' import mockPaymentChannelClaim from './mock_data/PaymentChannelClaim.json' import mockPaymentChannelClaimClosed from './mock_data/PaymentChannelClaimClosed.json' import mockPaymentChannelClaimCloseDenied from './mock_data/PaymentChannelClaimCloseDenied.json' import mockPaymentChannelClaimWithDestinationTag from './mock_data/PaymentChannelClaimWithDestinationTag.json' import { Description } from '../Description' -const createWrapper = createDescriptionWrapperFactory(Description, i18n) +const createWrapper = createDescriptionRenderFactory(Description, i18n) describe('PaymentChannelClaim: Description', () => { it('renders a claim', () => { diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx index 4a54173bf..9e85ecd99 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx @@ -1,6 +1,6 @@ import i18n from '../../../../../../i18n/testConfigEnglish' -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockPaymentChannelClaim from './mock_data/PaymentChannelClaim.json' import mockPaymentChannelClaimClosed from './mock_data/PaymentChannelClaimClosed.json' @@ -12,7 +12,7 @@ import { expectSimpleRowText, } from '../../test' -const createWrapper = createSimpleWrapperFactory(Simple, i18n) +const createWrapper = createSimpleRenderFactory(Simple, i18n) describe('PaymentChannelClaim: Simple', () => { it('renders a claim', () => { diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx index de68e843d..996e89852 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx @@ -1,13 +1,13 @@ import i18n from '../../../../../../i18n/testConfigEnglish' -import { createTableDetailWrapperFactory } from '../../test/createWrapperFactory' +import { createTableDetailRenderFactory } from '../../test/createRenderFactory' import { TableDetail } from '../TableDetail' import mockPaymentChannelClaim from './mock_data/PaymentChannelClaim.json' import mockPaymentChannelClaimClosed from './mock_data/PaymentChannelClaimClosed.json' import mockPaymentChannelClaimCloseDenied from './mock_data/PaymentChannelClaimCloseDenied.json' import mockPaymentChannelClaimWithDestinationTag from './mock_data/PaymentChannelClaimWithDestinationTag.json' -const createWrapper = createTableDetailWrapperFactory(TableDetail, i18n) +const createWrapper = createTableDetailRenderFactory(TableDetail, i18n) describe('PaymentChannelClaim: TableDetail', () => { it('renders a claim', () => { diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx index bba8fc3b9..c787024a5 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx @@ -1,12 +1,12 @@ import i18n from '../../../../../../i18n/testConfigEnglish' -import { createDescriptionWrapperFactory } from '../../test' +import { createDescriptionRenderFactory } from '../../test' import mockPaymentChannelCreate from './mock_data/PaymentChannelCreate.json' import mockPaymentChannelCreateFailed from './mock_data/PaymentChannelCreateFailed.json' import mockPaymentChannelCreateWithDestinationTag from './mock_data/PaymentChannelCreateWithDestinationTag.json' import { Description } from '../Description' -const createWrapper = createDescriptionWrapperFactory(Description, i18n) +const createWrapper = createDescriptionRenderFactory(Description, i18n) describe('PaymentChannelCreate: Description', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx index c8bae3e9d..2f41ea130 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx @@ -1,7 +1,7 @@ import i18n from '../../../../../../i18n/testConfigEnglish' import { - createSimpleWrapperFactory, + createSimpleRenderFactory, expectSimpleRowLabel, expectSimpleRowNotToExist, expectSimpleRowText, @@ -11,7 +11,7 @@ import mockPaymentChannelCreateFailed from './mock_data/PaymentChannelCreateFail import mockPaymentChannelCreateWithDestinationTag from './mock_data/PaymentChannelCreateWithDestinationTag.json' import { Simple } from '../Simple' -const createWrapper = createSimpleWrapperFactory(Simple, i18n) +const createWrapper = createSimpleRenderFactory(Simple, i18n) describe('PaymentChannelCreate: Simple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx index bef431ba4..0cf0814f0 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx @@ -1,12 +1,12 @@ import i18n from '../../../../../../i18n/testConfigEnglish' -import { createTableDetailWrapperFactory } from '../../test' +import { createTableDetailRenderFactory } from '../../test' import mockPaymentChannelCreate from './mock_data/PaymentChannelCreate.json' import mockPaymentChannelCreateFailed from './mock_data/PaymentChannelCreateFailed.json' import mockPaymentChannelCreateWithDestinationTag from './mock_data/PaymentChannelCreateWithDestinationTag.json' import { TableDetail } from '../TableDetail' -const createWrapper = createTableDetailWrapperFactory(TableDetail, i18n) +const createWrapper = createTableDetailRenderFactory(TableDetail, i18n) describe('PaymentChannelCreate: TableDetail', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx index ae1fdc448..d4663626e 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx @@ -1,11 +1,11 @@ import i18n from '../../../../../../i18n/testConfigEnglish' -import { createDescriptionWrapperFactory } from '../../test/createWrapperFactory' +import { createDescriptionRenderFactory } from '../../test/createRenderFactory' import mockPaymentChannelFund from './mock_data/PaymentChannelFund.json' import mockPaymentChannelFundFailed from './mock_data/PaymentChannelFundFailed.json' import { Description } from '../Description' -const createWrapper = createDescriptionWrapperFactory(Description, i18n) +const createWrapper = createDescriptionRenderFactory(Description, i18n) describe('PaymentChannelFund: Description', () => { it('renders a Fund', () => { diff --git a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx index a9b884ad6..f16bd3a43 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx @@ -1,6 +1,6 @@ import i18n from '../../../../../../i18n/testConfigEnglish' -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockPaymentChannelFund from './mock_data/PaymentChannelFund.json' import mockPaymentChannelFundFailed from './mock_data/PaymentChannelFundFailed.json' @@ -10,7 +10,7 @@ import { expectSimpleRowText, } from '../../test' -const createWrapper = createSimpleWrapperFactory(Simple, i18n) +const createWrapper = createSimpleRenderFactory(Simple, i18n) describe('PaymentChannelFund: Simple', () => { it('renders a fund', () => { diff --git a/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx b/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx index db2c1c14b..0ff67740c 100644 --- a/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx @@ -1,11 +1,11 @@ -import { createDescriptionWrapperFactory } from '../../test' +import { createDescriptionRenderFactory } from '../../test' import { Description } from '../Description' import i18nTestConfigEnUS from '../../../../../../i18n/testConfigEnglish' import SetFeePreAmendment from './mock_data/SetFee_PreAmendment.json' import SetFeePostAmendment from './mock_data/SetFee_PostAmendment.json' -const createWrapper = createDescriptionWrapperFactory( +const createWrapper = createDescriptionRenderFactory( Description, i18nTestConfigEnUS, ) diff --git a/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx b/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx index df3921f9f..5b038c640 100644 --- a/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx @@ -1,5 +1,5 @@ import { - createSimpleWrapperFactory, + createSimpleRenderFactory, expectSimpleRowLabel, expectSimpleRowText, } from '../../test' @@ -9,7 +9,7 @@ import i18nTestConfigEnUS from '../../../../../../i18n/testConfigEnglish' import SetFeePreAmendment from './mock_data/SetFee_PreAmendment.json' import SetFeePostAmendment from './mock_data/SetFee_PostAmendment.json' -const createWrapper = createSimpleWrapperFactory(Simple, i18nTestConfigEnUS) +const createWrapper = createSimpleRenderFactory(Simple, i18nTestConfigEnUS) function testSimple(wrapper) { expectSimpleRowLabel(wrapper, `base-fee`, 'Base Fee') diff --git a/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx b/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx index 164d6a026..2873dce54 100644 --- a/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx @@ -1,11 +1,11 @@ -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockSetHook from './mock_data/SetHook.json' import mockSetHook2 from './mock_data/SetHook2.json' import mockSetHookFailure from './mock_data/SetHookFailure.json' import { expectSimpleRowText } from '../../test/expectations' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('SetHookSimple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx index f8dd96327..055ba1a38 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx @@ -1,9 +1,9 @@ import SetRegularKey from './mock_data/SetRegularKey.json' import SetRegularKeyUnset from './mock_data/SetRegularKeyUnsetKey.json' import { Description } from '../Description' -import { createDescriptionWrapperFactory } from '../../test' +import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionWrapperFactory(Description) +const createWrapper = createDescriptionRenderFactory(Description) describe('SetRegularKey: Description', () => { it('renders description for transaction', () => { diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx index dbbf01785..e27f2b088 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx @@ -2,9 +2,9 @@ import SetRegularKey from './mock_data/SetRegularKey.json' import SetRegularKeyUnset from './mock_data/SetRegularKeyUnsetKey.json' import { Simple } from '../Simple' import { SimpleRow } from '../../SimpleRow' -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('SetRegularKey: Simple', () => { it('renders Simple for transaction', () => { diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx index 713e350e6..e118acbdc 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx @@ -1,9 +1,9 @@ import SetRegularKey from './mock_data/SetRegularKey.json' import SetRegularKeyUnset from './mock_data/SetRegularKeyUnsetKey.json' import { TableDetail } from '../TableDetail' -import { createTableDetailWrapperFactory } from '../../test' +import { createTableDetailRenderFactory } from '../../test' -const createWrapper = createTableDetailWrapperFactory(TableDetail) +const createWrapper = createTableDetailRenderFactory(TableDetail) describe('SetRegularKeyTable: Detail', () => { it('renders Simple for transaction', () => { diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx index ad0a56932..cc8773ef7 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx @@ -1,9 +1,9 @@ import mockSignerListSetClear from './mock_data/SignerListSetClear.json' import mockSignerListSet from './mock_data/SignerListSet.json' import { Description } from '../Description' -import { createDescriptionWrapperFactory } from '../../test' +import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionWrapperFactory(Description) +const createWrapper = createDescriptionRenderFactory(Description) describe('SignerListSet: Description', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx index 4330dc059..e734a7c42 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx @@ -2,9 +2,9 @@ import { Simple } from '../Simple' import mockSignerListSetClear from './mock_data/SignerListSetClear.json' import mockSignerListSet from './mock_data/SignerListSet.json' import { SimpleRow } from '../../SimpleRow' -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('SignerListSet: Simple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx index 9de69b6d1..f6c256628 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx @@ -2,9 +2,9 @@ import { TableDetail } from '../TableDetail' import mockSignerListSetClear from './mock_data/SignerListSetClear.json' import mockSignerListSet from './mock_data/SignerListSet.json' -import { createTableDetailWrapperFactory } from '../../test' +import { createTableDetailRenderFactory } from '../../test' -const createWrapper = createTableDetailWrapperFactory(TableDetail) +const createWrapper = createTableDetailRenderFactory(TableDetail) describe('SignerListSet: TableDetail', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/SimpleRow.tsx b/src/containers/shared/components/Transaction/SimpleRow.tsx index 8d443162e..4cc56510b 100644 --- a/src/containers/shared/components/Transaction/SimpleRow.tsx +++ b/src/containers/shared/components/Transaction/SimpleRow.tsx @@ -9,7 +9,7 @@ export type SimpleRowProps = PropsWithChildren<{ export const SimpleRow = (props: SimpleRowProps) => { const { label, children, className } = props return ( -
+
{label}
{children}
diff --git a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateSimple.test.tsx b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateSimple.test.tsx index 7b2e02349..50b0cd8e5 100644 --- a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateSimple.test.tsx @@ -1,8 +1,8 @@ -import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test' +import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import { Simple } from '../Simple' import TicketCreate from './mock_data/TicketCreate.json' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('TicketCreate: Simple', () => { it('renders ticket count', () => { diff --git a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx index 93dfe9461..04f1f3947 100644 --- a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx @@ -1,8 +1,8 @@ -import { createTableDetailWrapperFactory } from '../../test' +import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import TicketCreate from './mock_data/TicketCreate.json' -const createWrapper = createTableDetailWrapperFactory(TableDetail) +const createWrapper = createTableDetailRenderFactory(TableDetail) describe('TicketCreate: TableDetail', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx index c1826319f..42f5254a2 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx @@ -3,9 +3,9 @@ import i18n from '../../../../../../i18n/testConfigEnglish' import mockTrustSet from './mock_data/TrustSet.json' import { Description } from '../Description' -import { createDescriptionWrapperFactory } from '../../test' +import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionWrapperFactory(Description, i18n) +const createWrapper = createDescriptionRenderFactory(Description, i18n) describe('TrustSet: Description', () => { it('renders description for authorize', () => { diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetSimple.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetSimple.test.tsx index e28a45a95..e1081ed35 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetSimple.test.tsx @@ -1,11 +1,11 @@ import i18n from '../../../../../../i18n/testConfigEnglish' -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockTrustSet from './mock_data/TrustSet.json' import { expectSimpleRowLabel, expectSimpleRowText } from '../../test' -const createWrapper = createSimpleWrapperFactory(Simple, i18n) +const createWrapper = createSimpleRenderFactory(Simple, i18n) describe('TrustSet: Simple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx index d1f200684..e6728fd7f 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx @@ -1,9 +1,9 @@ -import { createTableDetailWrapperFactory } from '../../test' +import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import mockTrustSet from './mock_data/TrustSet.json' import i18n from '../../../../../../i18n/testConfigEnglish' -const createWrapper = createTableDetailWrapperFactory(TableDetail, i18n) +const createWrapper = createTableDetailRenderFactory(TableDetail, i18n) describe('TrustSet: TableDetail', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx index 6a17eaffb..490fb672c 100644 --- a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx +++ b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx @@ -1,7 +1,7 @@ import { mount } from 'enzyme' import i18n from '../../../../../../i18n/testConfigEnglish' import { expectSimpleRowLabel, expectSimpleRowText } from '../../test' -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockUNLModifyEnable from './mock_data/UNLModifyEnable.json' @@ -10,7 +10,7 @@ import { SimpleTab } from '../../../../../Transactions/SimpleTab' import { QuickHarness } from '../../../../../test/utils' import summarizeTransaction from '../../../../../../rippled/lib/txSummary' -const createWrapper = createSimpleWrapperFactory(Simple, i18n) +const createWrapper = createSimpleRenderFactory(Simple, i18n) describe('UNLModify: Simple', () => { it('renders tx that enables a validator', () => { diff --git a/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx index f21484912..ab47de1dd 100644 --- a/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx @@ -1,10 +1,10 @@ -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockXChainAccountCreateCommit from './mock_data/XChainAccountCreateCommit.json' import mockXChainAccountCreateCommitInsufficientFunds from './mock_data/XChainAccountCreateCommitInsufficientFunds.json' import { expectSimpleRowText } from '../../test/expectations' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('XChainAccountCreateCommitSimple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx index eb6bbca43..4993773bb 100644 --- a/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx @@ -1,10 +1,10 @@ -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockXChainAddAccountCreateAttestation from './mock_data/XChainAddAccountCreateAttestation.json' import mockXChainAddAccountCreateAttestationFailed from './mock_data/XChainAddAccountCreateAttestationFailed.json' import { expectSimpleRowText } from '../../test/expectations' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('XChainAddAccountCreateAttestationSimple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx index d86c3287f..0d90e21b6 100644 --- a/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx @@ -1,10 +1,10 @@ -import { createSimpleWrapperFactory } from '../../test/createWrapperFactory' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockXChainAddClaimAttestation from './mock_data/XChainAddClaimAttestation.json' import mockXChainAddClaimAttestationFailed from './mock_data/XChainAddClaimAttestationFailed.json' import { expectSimpleRowText } from '../../test/expectations' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('XChainAddClaimAttestationSimple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx b/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx index 9147d645b..686ee7640 100644 --- a/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx @@ -1,9 +1,9 @@ -import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test' +import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import { Simple } from '../Simple' import mockXChainClaim from './mock_data/XChainClaim.json' import mockXChainClaimNoQuorum from './mock_data/XChainClaimNoQuorum.json' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('XChainClaimSimple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx index c57575d6d..d91d2c011 100644 --- a/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx @@ -2,9 +2,9 @@ import { Simple } from '../Simple' import mockXChainCommit from './mock_data/XChainCommit.json' import mockXChainCommitInsufficientFunds from './mock_data/XChainCommitInsufficientFunds.json' -import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test' +import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('XChainCommitSimple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx index d7a837909..f4b57dbab 100644 --- a/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx @@ -2,9 +2,9 @@ import { Simple } from '../Simple' import mockXChainCreateBridge from './mock_data/XChainCreateBridge.json' import mockXChainCreateBridgeFailed from './mock_data/XChainCreateBridgeFailed.json' import mockXChainCreateBridgeIOU from './mock_data/XChainCreateBridgeIOU.json' -import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test' +import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('XChainCreateBridgeSimple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx index ff6d62f6f..480d48b6c 100644 --- a/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx @@ -1,9 +1,9 @@ -import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test' +import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import { Simple } from '../Simple' import mockXChainCreateClaimID from './mock_data/XChainCreateClaimID.json' import mockXChainCreateClaimIDFailed from './mock_data/XChainCreateClaimIDFailed.json' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('XChainCreateClaimIDSimple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx b/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx index 215580a71..c90c6f40f 100644 --- a/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx @@ -1,10 +1,10 @@ -import { createSimpleWrapperFactory, expectSimpleRowText } from '../../test' +import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import { Simple } from '../Simple' import mockXChainModifyBridge from './mock_data/XChainModifyBridge.json' import mockXChainModifyBridgeMinAccountCreateAmount from './mock_data/XChainModifyBridgeMinAccountCreateAmount.json' import mockXChainModifyBridgeNoEntry from './mock_data/XChainModifyBridgeNoEntry.json' -const createWrapper = createSimpleWrapperFactory(Simple) +const createWrapper = createSimpleRenderFactory(Simple) describe('XChainModifyBridgeSimple', () => { it('renders', () => { diff --git a/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx b/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx index f80c0b5dc..fe8278577 100644 --- a/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx +++ b/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx @@ -3,7 +3,7 @@ import SetHook from './mock_data/SetHook.json' import SetHook2 from './mock_data/SetHook2.json' import TokenSwapPropose from './mock_data/TokenSwapPropose.json' import { DefaultSimple } from '../DefaultSimple' -import { createWrapper as createGeneralWrapper } from './createWrapperFactory' +import { createWrapper as createGeneralWrapper } from './createRenderFactory' import { expectSimpleRowText } from './expectations' import summarizeTransaction from '../../../../../rippled/lib/txSummary' diff --git a/src/containers/shared/components/Transaction/test/createWrapperFactory.tsx b/src/containers/shared/components/Transaction/test/createRenderFactory.tsx similarity index 76% rename from src/containers/shared/components/Transaction/test/createWrapperFactory.tsx rename to src/containers/shared/components/Transaction/test/createRenderFactory.tsx index 9c93c4a01..2f6f9254d 100644 --- a/src/containers/shared/components/Transaction/test/createWrapperFactory.tsx +++ b/src/containers/shared/components/Transaction/test/createRenderFactory.tsx @@ -1,9 +1,9 @@ -import { mount, ReactWrapper } from 'enzyme' import { ReactElement } from 'react' import { I18nextProvider } from 'react-i18next' import { BrowserRouter } from 'react-router-dom' import { i18n } from 'i18next' import { QueryClientProvider } from 'react-query' +import { render } from '@testing-library/react' import defaultI18nConfig from '../../../../../i18n/testConfig' import summarizeTransaction from '../../../../../rippled/lib/txSummary' import { @@ -19,11 +19,11 @@ import { testQueryClient } from '../../../../test/QueryClient' * @param i18nConfig - i18next configuration to use instead of the default which outputs the key as the value */ -export function createWrapper( +export function renderComponent( TestComponent: ReactElement, i18nConfig?: i18n, -): ReactWrapper { - return mount( +): void { + render( {TestComponent} @@ -32,33 +32,33 @@ export function createWrapper( ) } -export function createDescriptionWrapperFactory( +export function createDescriptionRenderFactory( Description: TransactionDescriptionComponent, i18nConfig?: i18n, -): (tx: any) => ReactWrapper { +): (tx: any) => void { return function createDescriptionWrapper(tx: any) { - return createWrapper(, i18nConfig) + renderComponent(, i18nConfig) } } -export function createSimpleWrapperFactory( +export function createSimpleRenderFactory( Simple: TransactionSimpleComponent, i18nConfig?: i18n, -): (tx: any) => ReactWrapper { +): (tx: any) => void { return function createSimpleWrapper(tx: any) { const data = summarizeTransaction(tx, true) - return createWrapper(, i18nConfig) + renderComponent(, i18nConfig) } } -export function createTableDetailWrapperFactory( +export function createTableDetailRenderFactory( TableDetail: TransactionTableDetailComponent, i18nConfig?: i18n, -): (tx: any) => ReactWrapper { +): (tx: any) => void { return function createTableDetailWrapper(tx: any) { const data = summarizeTransaction(tx, true) - return createWrapper( + renderComponent( , i18nConfig, ) diff --git a/src/containers/shared/components/Transaction/test/expectations.ts b/src/containers/shared/components/Transaction/test/expectations.ts index 01827b83e..5ef9f58f2 100644 --- a/src/containers/shared/components/Transaction/test/expectations.ts +++ b/src/containers/shared/components/Transaction/test/expectations.ts @@ -1,21 +1,8 @@ -import { ReactWrapper } from 'enzyme' +export const expectSimpleRowLabel = (screen: any, key: string, text: string) => + expect(screen.getByTestId(key)).toHaveTextContent(text) -const getSelector = (selector: string) => - selector.indexOf('.') === 0 ? selector : `[data-testid="${selector}"]` +export const expectSimpleRowText = (screen: any, key: string, text: string) => + expect(screen.getByTestId(key)).toHaveTextContent(text) -export const expectSimpleRowLabel = ( - wrapper: ReactWrapper>, - key: string, - text: string, -) => expect(wrapper.find(`${getSelector(key)} .label`)).toHaveText(text) - -export const expectSimpleRowText = ( - wrapper: ReactWrapper>, - key: string, - text: string, -) => expect(wrapper.find(`${getSelector(key)} .value`)).toHaveText(text) - -export const expectSimpleRowNotToExist = ( - wrapper: ReactWrapper>, - key: string, -) => expect(wrapper.find(`${getSelector(key)}`)).not.toExist() +export const expectSimpleRowNotToExist = (screen: any, key: string) => + expect(screen.getByTestId(key)).not.toExist() diff --git a/src/containers/shared/components/Transaction/test/index.ts b/src/containers/shared/components/Transaction/test/index.ts index 0d1b90d58..b226bafbf 100644 --- a/src/containers/shared/components/Transaction/test/index.ts +++ b/src/containers/shared/components/Transaction/test/index.ts @@ -1,2 +1,2 @@ -export * from './createWrapperFactory' +export * from './createRenderFactory' export * from './expectations' From 84ecfa50cd13942bae385ba03e1858a9b20d7448 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 9 May 2024 10:18:17 -0400 Subject: [PATCH 03/55] DIDDelete --- .../Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/containers/shared/components/Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx b/src/containers/shared/components/Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx index 08d0262f3..d60dceedc 100644 --- a/src/containers/shared/components/Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx +++ b/src/containers/shared/components/Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx @@ -2,11 +2,10 @@ import { createSimpleRenderFactory } from '../../test' import { Simple } from '../Simple' import DIDDelete from './mock_data/DIDDelete.json' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('DIDDelete: Simple', () => { it('renders', () => { - const wrapper = createWrapper(DIDDelete) - wrapper.unmount() + renderComponent(DIDDelete) }) }) From 878ac6287ce4e9fb9186e1ad8f5d634f826151b3 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 9 May 2024 10:20:47 -0400 Subject: [PATCH 04/55] change imports, handle cleanup --- .../Transaction/AMMBid/test/AMMBid.test.tsx | 5 +++-- .../AMMCreate/test/AMMCreate.test.tsx | 5 +++-- .../test/AMMDeleteDescription.test.tsx | 6 ++++-- .../AMMDelete/test/AMMDeleteSimple.test.tsx | 6 ++++-- .../test/AMMDeleteTableDetail.test.tsx | 6 ++++-- .../AMMDeposit/test/AMMDeposit.test.tsx | 15 +++++++------- .../Transaction/AMMVote/test/AMMVote.test.tsx | 5 +++-- .../AMMWithdraw/test/AMMWithdraw.test.tsx | 11 +++++----- .../test/AccountDeleteSimple.test.tsx | 7 ++++--- .../test/AccountSetDescription.test.tsx | 20 ++++++++++--------- .../AccountSet/test/AccountSetSimple.test.tsx | 20 ++++++++++--------- .../test/AccountSetTableDetail.test.tsx | 20 ++++++++++--------- .../test/ClawbackDescription.test.tsx | 5 +++-- .../Clawback/test/ClawbackSimple.test.tsx | 7 ++++--- .../test/ClawbackTableDetail.test.tsx | 5 +++-- .../DIDDelete/test/DIDDeleteSimple.test.tsx | 2 ++ .../DIDSet/test/DIDSetSimple.test.tsx | 1 + .../DIDSet/test/DIDSetTableDetail.test.tsx | 6 ++++-- .../test/DepositPreauthDescription.test.tsx | 8 +++++--- .../test/DepositPreauthSimple.test.tsx | 7 ++++--- .../test/EnableAmendmentSimple.test.tsx | 17 +++++++++------- .../test/EscrowCancelDescription.test.tsx | 5 +++-- .../test/EscrowCancelSimple.test.tsx | 4 ++-- .../test/EscrowCancelTableDetail.test.tsx | 5 +++-- .../test/EscrowCreateDescription.test.tsx | 5 +++-- .../test/EscrowCreateSimple.test.tsx | 4 ++-- .../test/EscrowCreateTableDetail.test.tsx | 5 +++-- .../test/EscrowFinishDescription.test.tsx | 5 +++-- .../test/EscrowFinishSimple.test.tsx | 4 ++-- .../test/EscrowFinishTableDetail.test.tsx | 5 +++-- .../test/NFTokenAcceptOfferSimple.test.tsx | 11 +++++----- .../test/NFTokenBurnSimple.test.tsx | 7 ++++--- .../test/NFTokenCreateOfferSimple.test.tsx | 11 +++++----- .../test/NFTokenMintSimple.test.tsx | 1 + .../test/OfferCreateDescription.test.tsx | 6 ++++-- .../test/OfferCreateSimple.test.tsx | 6 ++++-- .../test/OfferCreateTableDetail.test.tsx | 6 ++++-- .../test/OfferCreateDescription.test.tsx | 8 +++++--- .../test/OfferCreateSimple.test.tsx | 7 ++++--- .../test/OfferCreateTableDetail.test.tsx | 10 ++++++---- .../Payment/test/PaymentDescription.test.tsx | 16 ++++++++------- .../Payment/test/PaymentSimple.test.tsx | 16 ++++++++------- .../Payment/test/PaymentTableDetail.test.tsx | 16 ++++++++------- .../PaymentChannelClaimDescription.test.tsx | 11 +++++----- .../test/PaymentChannelClaimSimple.test.tsx | 12 ++++++----- .../PaymentChannelClaimTableDetail.test.tsx | 11 +++++----- .../PaymentChannelCreateDescription.test.tsx | 10 ++++++---- .../test/PaymentChannelCreateSimple.test.tsx | 10 ++++++---- .../PaymentChannelCreateTableDetail.test.tsx | 10 ++++++---- .../PaymentChannelFundDescription.test.tsx | 7 ++++--- .../test/PaymentChannelFundSimple.test.tsx | 8 +++++--- .../SetFee/test/SetFeeDescription.test.tsx | 8 +++++--- .../SetFee/test/SetFeeSimple.test.tsx | 8 +++++--- .../SetHook/test/SetHookSimple.test.tsx | 8 ++++---- .../test/SetRegularKeyDescription.test.tsx | 8 +++++--- .../test/SetRegularKeySimple.test.tsx | 7 ++++--- .../test/SetRegularKeyTableDetail.test.tsx | 7 ++++--- .../test/SignerListSetDescription.test.tsx | 8 +++++--- .../test/SignerListSetSimple.test.tsx | 7 ++++--- .../test/SignerListSetTableDetail.test.tsx | 8 +++++--- .../test/TicketCreateSimple.test.tsx | 6 ++++-- .../test/TicketCreateTableDetail.test.tsx | 6 ++++-- .../test/TrustSetDescription.test.tsx | 6 ++++-- .../TrustSet/test/TrustSetSimple.test.tsx | 6 ++++-- .../test/TrustSetTableDetail.test.tsx | 6 ++++-- .../UNLModify/test/UNLModifySimple.test.tsx | 8 +++++--- .../XChainAccountCreateCommitSimple.test.tsx | 8 +++----- ...AddAccountCreateAttestationSimple.test.tsx | 6 +++--- .../XChainAddClaimAttestationSimple.test.tsx | 6 +++--- .../test/XChainClaimSimple.test.tsx | 7 ++++--- .../test/XChainCommitSimple.test.tsx | 7 ++++--- .../test/XChainCreateBridgeSimple.test.tsx | 9 +++++---- .../test/XChainCreateClaimIDSimple.test.tsx | 7 ++++--- .../test/XChainModifyBridgeSimple.test.tsx | 9 +++++---- .../Transaction/test/DefaultSimple.test.tsx | 8 ++++---- 75 files changed, 350 insertions(+), 250 deletions(-) diff --git a/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx b/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx index e39aafc6b..4f414c679 100644 --- a/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx +++ b/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx @@ -1,12 +1,13 @@ +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import bidMock from './mock_data/amm_bid.json' describe('AMM Bid Tests', () => { - const createWrapper = createSimpleRenderFactory(Simple) + const renderComponent = createSimpleRenderFactory(Simple) it('renders from transaction', () => { - const wrapper = createWrapper(bidMock) + renderComponent(bidMock) expectSimpleRowText( wrapper, 'min_slot_price', diff --git a/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx b/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx index 20c1de190..4011b5669 100644 --- a/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx +++ b/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx @@ -1,12 +1,13 @@ +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import createMock from './mock_data/amm_create.json' describe('AMM Create Tests', () => { - const createWrapper = createSimpleRenderFactory(Simple) + const renderComponent = createSimpleRenderFactory(Simple) it('renders from transaction', () => { - const wrapper = createWrapper(createMock) + renderComponent(createMock) expectSimpleRowText(wrapper, 'asset1', '\uE90010,000.00 XRP') expectSimpleRowText(wrapper, 'trading_fee', '0.001%') expectSimpleRowText( diff --git a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx index 0fe55fd88..c20733088 100644 --- a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx @@ -1,13 +1,15 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import mockAMMDelete from './mock_data/AMMDelete.json' import { Description } from '../Description' import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionRenderFactory(Description, i18n) +const renderComponent = createDescriptionRenderFactory(Description, i18n) describe('AMMDelete: Description', () => { + afterEach(cleanup) it('renders description for AMMDelete transaction', () => { - const wrapper = createWrapper(mockAMMDelete) + renderComponent(mockAMMDelete) expect(wrapper.find('[data-testid="amm-delete-description"]')).toHaveText( 'Attempted to delete the AMM for \uE900 XRP and FOO.rm5c42Crqpdch5fbuCdHmSMV1wrL9arV9.If there were more than 512 trustlines, this only removes 512 trustlines instead.', diff --git a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteSimple.test.tsx b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteSimple.test.tsx index c24f93611..c0780dc7d 100644 --- a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteSimple.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteSimple.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { expectSimpleRowText } from '../../test' @@ -5,11 +6,12 @@ import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockAMMDelete from './mock_data/AMMDelete.json' -const createWrapper = createSimpleRenderFactory(Simple, i18n) +const renderComponent = createSimpleRenderFactory(Simple, i18n) describe('AMMDelete: Simple', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(mockAMMDelete) // TOOD: - Make this look up asset 1 / asset 2 currency codes + renderComponent(mockAMMDelete) // TOOD: - Make this look up asset 1 / asset 2 currency codes expectSimpleRowText(wrapper, 'asset1', '\uE900 XRP') expectSimpleRowText( wrapper, diff --git a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx index 62ad9ecc9..10fe0d598 100644 --- a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx @@ -1,13 +1,15 @@ +import { cleanup, screen } from '@testing-library/react' import { TableDetail } from '../TableDetail' import mockAMMDelete from './mock_data/AMMDelete.json' import { createTableDetailRenderFactory } from '../../test' import i18n from '../../../../../../i18n/testConfigEnglish' -const createWrapper = createTableDetailRenderFactory(TableDetail, i18n) +const renderComponent = createTableDetailRenderFactory(TableDetail, i18n) describe('AMMDelete: TableDetail', () => { + afterEach(cleanup) it('renders with an expiration and offer', () => { - const wrapper = createWrapper(mockAMMDelete) + renderComponent(mockAMMDelete) expect(wrapper.find('[data-testid="asset"]')).toHaveText( 'Asset 1\uE900 XRP', diff --git a/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx b/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx index 75ca84e71..410adfb7f 100644 --- a/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import { createSimpleRenderFactory, @@ -12,10 +13,10 @@ import depositNonXRP from './mock_data/deposit_nonxrp.json' import depositFail from './mock_data/deposit_fail.json' describe('AMM Deposit Tests', () => { - const createWrapper = createSimpleRenderFactory(Simple) + const renderComponent = createSimpleRenderFactory(Simple) it('renders with both assets', () => { - const wrapper = createWrapper(depositBothAssets) + renderComponent(depositBothAssets) expectSimpleRowText(wrapper, 'asset1', '\uE90010,997.290462 XRP') expectSimpleRowText( wrapper, @@ -31,7 +32,7 @@ describe('AMM Deposit Tests', () => { }) it('renders only with USD', () => { - const wrapper = createWrapper(depositUSD) + renderComponent(depositUSD) expectSimpleRowNotToExist(wrapper, 'asset1') expectSimpleRowText( wrapper, @@ -47,7 +48,7 @@ describe('AMM Deposit Tests', () => { }) it('renders only with XRP', () => { - const wrapper = createWrapper(depositXRP) + renderComponent(depositXRP) expectSimpleRowText(wrapper, 'asset1', '\uE9001,000.00 XRP') expectSimpleRowText( wrapper, @@ -58,7 +59,7 @@ describe('AMM Deposit Tests', () => { }) it('renders with eprice', () => { - const wrapper = createWrapper(depositEprice) + renderComponent(depositEprice) expectSimpleRowNotToExist(wrapper, 'asset1') expectSimpleRowText( wrapper, @@ -79,7 +80,7 @@ describe('AMM Deposit Tests', () => { }) it('renders with both assets non XRP', () => { - const wrapper = createWrapper(depositNonXRP) + renderComponent(depositNonXRP) expectSimpleRowText( wrapper, 'asset1', @@ -99,7 +100,7 @@ describe('AMM Deposit Tests', () => { }) it('deposit shouldnt crash with tx that changes fee', () => { - const wrapper = createWrapper(depositFail) + renderComponent(depositFail) expectSimpleRowNotToExist(wrapper, 'asset1') expectSimpleRowNotToExist(wrapper, 'asset2') expectSimpleRowNotToExist(wrapper, 'account_id') diff --git a/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx b/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx index 7260f6de4..12961c2fd 100644 --- a/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx +++ b/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx @@ -1,12 +1,13 @@ +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import voteMock from './mock_data/amm_vote.json' describe('AMM Vote Tests', () => { - const createWrapper = createSimpleRenderFactory(Simple) + const renderComponent = createSimpleRenderFactory(Simple) it('renders from transaction', () => { - const wrapper = createWrapper(voteMock) + renderComponent(voteMock) expectSimpleRowText(wrapper, 'trading_fee', '0.001%') expectSimpleRowText( wrapper, diff --git a/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx b/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx index b878a0506..edf854131 100644 --- a/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx +++ b/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import { createSimpleRenderFactory, @@ -10,10 +11,10 @@ import withdrawXRPMock from './mock_data/withdraw_xrp.json' import withdrawEpriceMock from './mock_data/withdraw_eprice.json' describe('AMM Withdraw Tests', () => { - const createWrapper = createSimpleRenderFactory(Simple) + const renderComponent = createSimpleRenderFactory(Simple) it('renders from transaction', () => { - const wrapper = createWrapper(withdrawMock) + renderComponent(withdrawMock) expectSimpleRowText(wrapper, 'asset1', '\uE9003,666.580862 XRP') expectSimpleRowText( wrapper, @@ -29,7 +30,7 @@ describe('AMM Withdraw Tests', () => { }) it('renders transaction from usd only', () => { - const wrapper = createWrapper(withdrawUSDMock) + renderComponent(withdrawUSDMock) expectSimpleRowNotToExist(wrapper, 'asset1') expectSimpleRowText( wrapper, @@ -44,7 +45,7 @@ describe('AMM Withdraw Tests', () => { wrapper.unmount() }) it('renders transaction from XRP only', () => { - const wrapper = createWrapper(withdrawXRPMock) + renderComponent(withdrawXRPMock) expectSimpleRowNotToExist(wrapper, 'asset2') expectSimpleRowText(wrapper, 'asset1', '\uE90099.99998 XRP') expectSimpleRowText( @@ -56,7 +57,7 @@ describe('AMM Withdraw Tests', () => { }) it('renders transaction from eprice', () => { - const wrapper = createWrapper(withdrawEpriceMock) + renderComponent(withdrawEpriceMock) expectSimpleRowNotToExist(wrapper, 'asset1') expectSimpleRowText( wrapper, diff --git a/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx b/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx index 0a75e791c..902db0123 100644 --- a/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx +++ b/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx @@ -5,11 +5,12 @@ import { Simple } from '../Simple' import mockAccountDelete from './mock_data/AccountDelete.json' import mockAccountDeleteWithDestinationTag from './mock_data/AccountDeleteWithDestinationTag.json' -const createWrapper = createSimpleRenderFactory(Simple, i18n) +const renderComponent = createSimpleRenderFactory(Simple, i18n) describe('AccountDelete: Simple', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(mockAccountDelete) + renderComponent(mockAccountDelete) expect(wrapper.find('.label')).toHaveText('destination') expect(wrapper.find('.value')).toHaveText( 'raT74sdzpxJUaubcBAQNS8aLqFMU85Rr5J', @@ -18,7 +19,7 @@ describe('AccountDelete: Simple', () => { }) it('renders with destination tag', () => { - const wrapper = createWrapper(mockAccountDeleteWithDestinationTag) + renderComponent(mockAccountDeleteWithDestinationTag) expect(wrapper.find('.label')).toHaveText('destination') expect(wrapper.find('.value')).toHaveText( 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn:123123', diff --git a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx index a07850dd6..e339cf617 100644 --- a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { Description } from '../Description' @@ -8,17 +9,18 @@ import mockAccountSetWithSetFlag from './mock_data/AccountSetWithSetFlag.json' import mockAccountSetWithMessageKey from './mock_data/AccountSetWithMessageKey.json' import mockAccountSetWithNFTokenMinter from './mock_data/AccountSetWithNFTokenMinter.json' -const createWrapper = createDescriptionRenderFactory(Description, i18n) +const renderComponent = createDescriptionRenderFactory(Description, i18n) describe('AccountSet: Description', () => { + afterEach(cleanup) it('renders tx that sets the domain', () => { - const wrapper = createWrapper(mockAccountSetWithDomain) + renderComponent(mockAccountSetWithDomain) expect(wrapper).toHaveText('It sets the account domain as mduo13.com') wrapper.unmount() }) it('renders tx that sets the email hash', () => { - const wrapper = createWrapper({ + renderComponent({ ...mockAccountSetWithDomain, tx: { ...mockAccountSetWithDomain.tx, @@ -33,19 +35,19 @@ describe('AccountSet: Description', () => { }) it('renders tx that clears a flag', () => { - const wrapper = createWrapper(mockAccountSetWithClearFlag) + renderComponent(mockAccountSetWithClearFlag) expect(wrapper).toHaveText('It clears the account flag asfGlobalFreeze') wrapper.unmount() }) it('renders tx that sets a flag', () => { - const wrapper = createWrapper(mockAccountSetWithSetFlag) + renderComponent(mockAccountSetWithSetFlag) expect(wrapper).toHaveText('It sets the account flag asfRequireDest') wrapper.unmount() }) it('renders tx that clears a flag that is not defined', () => { - const wrapper = createWrapper({ + renderComponent({ ...mockAccountSetWithClearFlag, tx: { ...mockAccountSetWithClearFlag.tx, ClearFlag: 45 }, }) @@ -54,7 +56,7 @@ describe('AccountSet: Description', () => { }) it('renders tx that sets a flag that is not defined', () => { - const wrapper = createWrapper({ + renderComponent({ ...mockAccountSetWithSetFlag, tx: { ...mockAccountSetWithSetFlag.tx, SetFlag: 45 }, }) @@ -63,7 +65,7 @@ describe('AccountSet: Description', () => { }) it('renders tx that sets a message', () => { - const wrapper = createWrapper(mockAccountSetWithMessageKey) + renderComponent(mockAccountSetWithMessageKey) expect(wrapper.find('[data-testid="message-key"]')).toHaveText( 'It sets the account message key as 020000000000000000000000000941C216565D33C8A8ACD1A33C359E84D652D1DA', ) @@ -71,7 +73,7 @@ describe('AccountSet: Description', () => { }) it('renders tx that sets a minter', () => { - const wrapper = createWrapper(mockAccountSetWithNFTokenMinter) + renderComponent(mockAccountSetWithNFTokenMinter) expect(wrapper.find('[data-testid="minter"]')).toHaveText( 'It sets rXMART8usFd5kABXCayoP6ZfB35b4v43t as the authorized minter for this account', ) diff --git a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetSimple.test.tsx b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetSimple.test.tsx index 292dccab9..e680b8c04 100644 --- a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetSimple.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createSimpleRenderFactory } from '../../test/createRenderFactory' @@ -9,18 +10,19 @@ import mockAccountSetWithMessageKey from './mock_data/AccountSetWithMessageKey.j import mockAccountSetWithNFTokenMinter from './mock_data/AccountSetWithNFTokenMinter.json' import { expectSimpleRowLabel, expectSimpleRowText } from '../../test' -const createWrapper = createSimpleRenderFactory(Simple, i18n) +const renderComponent = createSimpleRenderFactory(Simple, i18n) describe('AccountSet: Simple', () => { + afterEach(cleanup) it('renders tx that sets the domain', () => { - const wrapper = createWrapper(mockAccountSetWithDomain) + renderComponent(mockAccountSetWithDomain) expectSimpleRowLabel(wrapper, 'domain', 'domain') expectSimpleRowText(wrapper, 'domain', 'mduo13.com') wrapper.unmount() }) it('renders tx that sets the email hash', () => { - const wrapper = createWrapper({ + renderComponent({ ...mockAccountSetWithDomain, tx: { ...mockAccountSetWithDomain.tx, @@ -34,21 +36,21 @@ describe('AccountSet: Simple', () => { }) it('renders tx that clears a flag', () => { - const wrapper = createWrapper(mockAccountSetWithClearFlag) + renderComponent(mockAccountSetWithClearFlag) expectSimpleRowLabel(wrapper, 'clear-flag', 'clear flag') expectSimpleRowText(wrapper, 'clear-flag', 'asfGlobalFreeze') wrapper.unmount() }) it('renders tx that sets a flag', () => { - const wrapper = createWrapper(mockAccountSetWithSetFlag) + renderComponent(mockAccountSetWithSetFlag) expectSimpleRowLabel(wrapper, 'set-flag', 'set flag') expectSimpleRowText(wrapper, 'set-flag', 'asfRequireDest') wrapper.unmount() }) it('renders tx that clears a flag without a defined flag', () => { - const wrapper = createWrapper({ + renderComponent({ ...mockAccountSetWithClearFlag, tx: { ...mockAccountSetWithClearFlag.tx, ClearFlag: 45 }, }) @@ -58,7 +60,7 @@ describe('AccountSet: Simple', () => { }) it('renders tx that sets a flag without a defined flag', () => { - const wrapper = createWrapper({ + renderComponent({ ...mockAccountSetWithSetFlag, tx: { ...mockAccountSetWithSetFlag.tx, SetFlag: 45 }, }) @@ -68,7 +70,7 @@ describe('AccountSet: Simple', () => { }) it('renders tx that sets a message', () => { - const wrapper = createWrapper(mockAccountSetWithMessageKey) + renderComponent(mockAccountSetWithMessageKey) expectSimpleRowLabel(wrapper, 'message', 'message key') expectSimpleRowText( wrapper, @@ -79,7 +81,7 @@ describe('AccountSet: Simple', () => { }) it('renders tx that sets a minter', () => { - const wrapper = createWrapper(mockAccountSetWithNFTokenMinter) + renderComponent(mockAccountSetWithNFTokenMinter) expectSimpleRowLabel(wrapper, 'minter', 'NFT Minter') expectSimpleRowText(wrapper, 'minter', 'rXMART8usFd5kABXCayoP6ZfB35b4v43t') wrapper.unmount() diff --git a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx index b1c768c2f..a74097edd 100644 --- a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import { createTableDetailRenderFactory } from '../../test' import i18n from '../../../../../../i18n/testConfigEnglish' @@ -8,17 +9,18 @@ import mockAccountSetWithSetFlag from './mock_data/AccountSetWithSetFlag.json' import mockAccountSetWithMessageKey from './mock_data/AccountSetWithMessageKey.json' import mockAccountSetWithNFTokenMinter from './mock_data/AccountSetWithNFTokenMinter.json' -const createWrapper = createTableDetailRenderFactory(TableDetail, i18n) +const renderComponent = createTableDetailRenderFactory(TableDetail, i18n) describe('AccountSet: TableDetail', () => { + afterEach(cleanup) it('renders tx that sets the domain', () => { - const wrapper = createWrapper(mockAccountSetWithDomain) + renderComponent(mockAccountSetWithDomain) expect(wrapper).toHaveText('domain: mduo13.com') wrapper.unmount() }) it('renders tx that sets the email hash', () => { - const wrapper = createWrapper({ + renderComponent({ ...mockAccountSetWithDomain, tx: { ...mockAccountSetWithDomain.tx, @@ -31,19 +33,19 @@ describe('AccountSet: TableDetail', () => { }) it('renders tx that clears a flag', () => { - const wrapper = createWrapper(mockAccountSetWithClearFlag) + renderComponent(mockAccountSetWithClearFlag) expect(wrapper).toHaveText('clear flag: asfGlobalFreeze') wrapper.unmount() }) it('renders tx that sets a flag', () => { - const wrapper = createWrapper(mockAccountSetWithSetFlag) + renderComponent(mockAccountSetWithSetFlag) expect(wrapper).toHaveText('set flag: asfRequireDest') wrapper.unmount() }) it('renders tx that clears a flag that is not defined', () => { - const wrapper = createWrapper({ + renderComponent({ ...mockAccountSetWithClearFlag, tx: { ...mockAccountSetWithClearFlag.tx, ClearFlag: 45 }, }) @@ -52,7 +54,7 @@ describe('AccountSet: TableDetail', () => { }) it('renders tx that sets a flag that is not defined', () => { - const wrapper = createWrapper({ + renderComponent({ ...mockAccountSetWithSetFlag, tx: { ...mockAccountSetWithSetFlag.tx, SetFlag: 45 }, }) @@ -61,7 +63,7 @@ describe('AccountSet: TableDetail', () => { }) it('renders tx that sets a message', () => { - const wrapper = createWrapper(mockAccountSetWithMessageKey) + renderComponent(mockAccountSetWithMessageKey) expect(wrapper).toHaveText( 'message key: 020000000000000000000000000941C216565D33C8A8ACD1A33C359E84D652D1DA', ) @@ -69,7 +71,7 @@ describe('AccountSet: TableDetail', () => { }) it('renders tx that sets a minter', () => { - const wrapper = createWrapper(mockAccountSetWithNFTokenMinter) + renderComponent(mockAccountSetWithNFTokenMinter) expect(wrapper.find('[data-testid="minter"]')).toHaveText( 'NFT Minter: rXMART8usFd5kABXCayoP6ZfB35b4v43t', ) diff --git a/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx b/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx index ef75b0fc1..1760519d6 100644 --- a/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx +++ b/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx @@ -1,13 +1,14 @@ +import { cleanup, screen } from '@testing-library/react' import { createDescriptionRenderFactory } from '../../test' import { Description } from '../Description' import transaction from './mock_data/Clawback.json' import i18n from '../../../../../../i18n/testConfigEnglish' -const createWrapper = createDescriptionRenderFactory(Description, i18n) +const renderComponent = createDescriptionRenderFactory(Description, i18n) describe('Clawback', () => { it('handles Clawback Description ', () => { - const wrapper = createWrapper(transaction) + renderComponent(transaction) expect(wrapper.find('[data-testid="from-to-line"]')).toHaveText( `rDZ713igKfedN4hhY6SjQse4Mv3ZrBxnn9 claws back from rscBWQpyZEmQvupeB1quu7Ky8YX4f5CHDP`, ) diff --git a/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx b/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx index 8d2cd6392..e98dd1dae 100644 --- a/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx +++ b/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx @@ -1,4 +1,5 @@ import { useQuery } from 'react-query' +import { cleanup, screen } from '@testing-library/react' import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import { Simple } from '../Simple' import transaction from './mock_data/Clawback.json' @@ -11,11 +12,11 @@ jest.mock('react-query', () => ({ useQuery: jest.fn(), })) -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('Clawback', () => { it('handles Clawback simple view ', () => { - const wrapper = createWrapper(transaction) + renderComponent(transaction) expectSimpleRowText(wrapper, 'holder', 'rscBWQpyZEmQvupeB1quu7Ky8YX4f5CHDP') expectSimpleRowText( wrapper, @@ -46,7 +47,7 @@ describe('Clawback', () => { }) it('handles failed Clawback simple view ', () => { - const wrapper = createWrapper(transactionFailure) + renderComponent(transactionFailure) expectSimpleRowText(wrapper, 'holder', 'rDZ713igKfedN4hhY6SjQse4Mv3ZrBxnn9') expectSimpleRowText( wrapper, diff --git a/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx b/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx index 2bd7b414f..a13d9b537 100644 --- a/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx @@ -1,12 +1,13 @@ +import { cleanup, screen } from '@testing-library/react' import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import transaction from './mock_data/Clawback.json' -const createWrapper = createTableDetailRenderFactory(TableDetail) +const renderComponent = createTableDetailRenderFactory(TableDetail) describe('Clawback', () => { it('handles Clawback TableDetail ', () => { - const wrapper = createWrapper(transaction) + renderComponent(transaction) expect(wrapper.find('.clawback')).toHaveText( `claws_back3,840.00 FOO.rDZ713igKfedN4hhY6SjQse4Mv3ZrBxnn9fromrscBWQpyZEmQvupeB1quu7Ky8YX4f5CHDP`, ) diff --git a/src/containers/shared/components/Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx b/src/containers/shared/components/Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx index d60dceedc..b79391e3b 100644 --- a/src/containers/shared/components/Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx +++ b/src/containers/shared/components/Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import { createSimpleRenderFactory } from '../../test' import { Simple } from '../Simple' import DIDDelete from './mock_data/DIDDelete.json' @@ -5,6 +6,7 @@ import DIDDelete from './mock_data/DIDDelete.json' const renderComponent = createSimpleRenderFactory(Simple) describe('DIDDelete: Simple', () => { + afterEach(cleanup) it('renders', () => { renderComponent(DIDDelete) }) diff --git a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetSimple.test.tsx b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetSimple.test.tsx index 13735b8da..c9e82210c 100644 --- a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetSimple.test.tsx @@ -6,6 +6,7 @@ import DIDSet from './mock_data/DIDSet.json' const renderComponent = createSimpleRenderFactory(Simple) describe('DIDSet: Simple', () => { + afterEach(cleanup) afterEach(cleanup) it('renders', () => { renderComponent(DIDSet) diff --git a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx index bef41ab89..b2fb3aec9 100644 --- a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx @@ -1,12 +1,14 @@ +import { cleanup, screen } from '@testing-library/react' import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import DIDSet from './mock_data/DIDSet.json' -const createWrapper = createTableDetailRenderFactory(TableDetail) +const renderComponent = createTableDetailRenderFactory(TableDetail) describe('DIDSet: TableDetail', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(DIDSet) + renderComponent(DIDSet) // eslint-disable-next-line no-useless-concat -- easier to read this way expect(wrapper).toHaveText('uri: did_example' + 'did_document: doc') wrapper.unmount() diff --git a/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthDescription.test.tsx b/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthDescription.test.tsx index 8b3c5dce8..3040c4998 100644 --- a/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthDescription.test.tsx +++ b/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthDescription.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import mockDepositPreaut from './mock_data/DepositPreauth.json' @@ -6,11 +7,12 @@ import mockDepositPreauthUnauthorize from './mock_data/DepositPreauthUnauthorize import { Description } from '../Description' import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionRenderFactory(Description, i18n) +const renderComponent = createDescriptionRenderFactory(Description, i18n) describe('DepositPreauth: Description', () => { + afterEach(cleanup) it('renders description for authorize', () => { - const wrapper = createWrapper(mockDepositPreaut) + renderComponent(mockDepositPreaut) expect(wrapper.html()).toBe( `
It authorizes to send payments to this account
`, ) @@ -18,7 +20,7 @@ describe('DepositPreauth: Description', () => { }) it('renders description for unauthorize', () => { - const wrapper = createWrapper(mockDepositPreauthUnauthorize) + renderComponent(mockDepositPreauthUnauthorize) expect(wrapper.html()).toBe( `
It removes the authorization for to send payments to this account
`, ) diff --git a/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthSimple.test.tsx b/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthSimple.test.tsx index aa90425ce..9f9e9bf6a 100644 --- a/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthSimple.test.tsx +++ b/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthSimple.test.tsx @@ -5,11 +5,12 @@ import { Simple } from '../Simple' import mockDepositPreauth from './mock_data/DepositPreauth.json' import mockDepositPreauthUnauthorize from './mock_data/DepositPreauthUnauthorize.json' -const createWrapper = createSimpleRenderFactory(Simple, i18n) +const renderComponent = createSimpleRenderFactory(Simple, i18n) describe('DepositPreauth: Simple', () => { + afterEach(cleanup) it('renders authorized', () => { - const wrapper = createWrapper(mockDepositPreauth) + renderComponent(mockDepositPreauth) expect(wrapper.find('.label')).toHaveText('authorize') expect(wrapper.find('.value')).toHaveText( 'rDJFnv5sEfp42LMFiX3mVQKczpFTdxYDzM', @@ -18,7 +19,7 @@ describe('DepositPreauth: Simple', () => { }) it('renders unauthorized', () => { - const wrapper = createWrapper(mockDepositPreauthUnauthorize) + renderComponent(mockDepositPreauthUnauthorize) expect(wrapper.find('.label')).toHaveText('unauthorize') expect(wrapper.find('.value')).toHaveText( 'rDJFnv5sEfp42LMFiX3mVQKczpFTdxYDzM', diff --git a/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx b/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx index 8a089955d..c9e38e5fb 100644 --- a/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { expectSimpleRowLabel, expectSimpleRowText } from '../../test' import { createSimpleRenderFactory } from '../../test/createRenderFactory' @@ -12,7 +13,7 @@ import { getRippledVersion } from '../../../../amendmentUtils' import { flushPromises } from '../../../../../test/utils' import { getFeature } from '../../../../../../rippled/lib/rippled' -const createWrapper = createSimpleRenderFactory(Simple, i18n) +const renderComponent = createSimpleRenderFactory(Simple, i18n) jest.mock('../../../../amendmentUtils', () => { // Require the original module to not be mocked... @@ -45,13 +46,14 @@ const mockedGetFeature = getFeature as jest.MockedFunction describe('EnableAmendment: Simple', () => { afterEach(() => { mockedGetFeature.mockReset() + cleanup() }) it('renders tx that causes an amendment to loose majority', async () => { mockedGetRippledVersion.mockImplementation(() => Promise.resolve('v1.9.1')) mockedGetFeature.mockImplementation(() => Promise.resolve(mockFeatureExpandedSignerList), ) - const wrapper = createWrapper(mockEnableAmendmentWithMinority) + renderComponent(mockEnableAmendmentWithMinority) expectSimpleRowLabel(wrapper, 'name', 'Amendment Name') expectSimpleRowText(wrapper, 'name', 'Loading') expectSimpleRowLabel(wrapper, 'status', 'Amendment Status') @@ -74,7 +76,7 @@ describe('EnableAmendment: Simple', () => { mockedGetFeature.mockImplementation(() => Promise.resolve(mockFeatureExpandedSignerList), ) - const wrapper = createWrapper(mockEnableAmendmentWithMajority) + renderComponent(mockEnableAmendmentWithMajority) expectSimpleRowLabel(wrapper, 'name', 'Amendment Name') expectSimpleRowText(wrapper, 'name', 'Loading') expectSimpleRowLabel(wrapper, 'status', 'Amendment Status') @@ -102,7 +104,7 @@ describe('EnableAmendment: Simple', () => { mockedGetFeature.mockImplementation(() => Promise.resolve(mockFeatureNegativeUNL), ) - const wrapper = createWrapper(mockEnableAmendmentWithEnabled) + renderComponent(mockEnableAmendmentWithEnabled) expectSimpleRowLabel(wrapper, 'name', 'Amendment Name') expectSimpleRowText(wrapper, 'name', 'Loading') expectSimpleRowLabel(wrapper, 'status', 'Amendment Status') @@ -122,7 +124,8 @@ describe('EnableAmendment: Simple', () => { it('renders tx that cannot determine version or name', async () => { mockedGetRippledVersion.mockImplementation(() => Promise.resolve('')) mockedGetFeature.mockImplementation(() => Promise.resolve(null)) - const wrapper = createWrapper(mockEnableAmendmentWithEnabled) + renderComponent(mockEnableAmendmentWithEnabled) + renderComponent(mockEnableAmendmentWithEnabled) expectSimpleRowLabel(wrapper, 'name', 'Amendment Name') expectSimpleRowText(wrapper, 'name', 'Loading') expectSimpleRowLabel(wrapper, 'version', 'Introduced In') @@ -140,7 +143,7 @@ describe('EnableAmendment: Simple', () => { mockedGetFeature.mockImplementation(() => Promise.resolve(mockFeatureNegativeUNL), ) - const wrapper = createWrapper(mockEnableAmendmentWithEnabled) + renderComponent(mockEnableAmendmentWithEnabled) expectSimpleRowLabel(wrapper, 'name', 'Amendment Name') expectSimpleRowText(wrapper, 'name', 'Loading') expectSimpleRowLabel(wrapper, 'version', 'Introduced In') @@ -156,7 +159,7 @@ describe('EnableAmendment: Simple', () => { it('renders tx that cannot determine name', async () => { mockedGetRippledVersion.mockImplementation(() => Promise.resolve('v1.7.3')) mockedGetFeature.mockImplementation(() => Promise.resolve(null)) - const wrapper = createWrapper(mockEnableAmendmentWithEnabled) + renderComponent(mockEnableAmendmentWithEnabled) expectSimpleRowLabel(wrapper, 'name', 'Amendment Name') expectSimpleRowText(wrapper, 'name', 'Loading') expectSimpleRowLabel(wrapper, 'version', 'Introduced In') diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx index d71594a00..d5a3b4d50 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx @@ -1,12 +1,13 @@ +import { cleanup, screen } from '@testing-library/react' import EscrowCancel from './mock_data/EscrowCancel.json' import { Description } from '../Description' import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionRenderFactory(Description) +const renderComponent = createDescriptionRenderFactory(Description) describe('EscrowCancelDescription', () => { it('renders description for EscrowCancel', () => { - const wrapper = createWrapper(EscrowCancel) + renderComponent(EscrowCancel) expect(wrapper.html()).toBe( '
escrow_cancellation_desc
The escrowed amount of\uE900135.79XRPwas returned to (\uE900135.78999XRP escrow_after_transaction_cost)
The escrow was created bywith transactionA979AD...', ) diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx index 98995a9d7..ff42b8838 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx @@ -2,11 +2,11 @@ import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockEscrowCancel from './mock_data/EscrowCancel.json' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('EscrowCancelSimple', () => { it('renders with an expiration and offer', () => { - const wrapper = createWrapper(mockEscrowCancel) + renderComponent(mockEscrowCancel) expect(wrapper.find('[data-testid="escrow-amount"] .value')).toHaveText( `\uE900135.79 XRP`, ) diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx index 2b5c8e229..dc7327a4a 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx @@ -1,16 +1,17 @@ +import { cleanup, screen } from '@testing-library/react' import { TableDetail } from '../TableDetail' import mockEscrowCancel from './mock_data/EscrowCancel.json' import { createTableDetailRenderFactory } from '../../test' import i18nTestConfigEnUS from '../../../../../../i18n/testConfigEnglish' -const createWrapper = createTableDetailRenderFactory( +const renderComponent = createTableDetailRenderFactory( TableDetail, i18nTestConfigEnUS, ) describe('EscrowCancelTableDetail', () => { it('renders EscrowCancel without crashing', () => { - const wrapper = createWrapper(mockEscrowCancel) + renderComponent(mockEscrowCancel) expect(wrapper).toHaveText( 'cancel escrow rpmqbo5FWoydTL2Ufh5YdtzmRjbeLyxt56 - 9', ) diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx index d4c5b1362..88f8f17bf 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx @@ -1,12 +1,13 @@ +import { cleanup, screen } from '@testing-library/react' import EscrowCreate from './mock_data/EscrowCreate.json' import { Description } from '../Description' import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionRenderFactory(Description) +const renderComponent = createDescriptionRenderFactory(Description) describe('EscrowCreateDescription', () => { it('renders description for EscrowCreate', () => { - const wrapper = createWrapper(EscrowCreate) + renderComponent(EscrowCreate) expect(wrapper.html()).toBe( 'The escrow is fromto
escrow_condition A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120
escrowed_amount \uE900997.50XRP
describe_cancel_after March 1, 2020 at 8:54:20 AM UTC
describe_finish_after March 1, 2020 at 9:01:00 AM UTC
', ) diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx index 57e0c817c..d8f2d552b 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx @@ -2,11 +2,11 @@ import { Simple } from '../Simple' import mockEscrowCreate from './mock_data/EscrowCreate.json' import { createSimpleRenderFactory } from '../../test/createRenderFactory' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('EscrowCreateSimple', () => { it('renders with an expiration and offer', () => { - const wrapper = createWrapper(mockEscrowCreate) + renderComponent(mockEscrowCreate) expect(wrapper.find('[data-testid="escrow-amount"] .value')).toHaveText( `\uE900997.50 XRP`, ) diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx index 93c490c8c..c663aef45 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx @@ -1,12 +1,13 @@ +import { cleanup, screen } from '@testing-library/react' import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import mockEscrowCreate from './mock_data/EscrowCreate.json' -const createWrapper = createTableDetailRenderFactory(TableDetail) +const renderComponent = createTableDetailRenderFactory(TableDetail) describe('EscrowCreateTableDetail', () => { it('renders EscrowCreate without crashing', () => { - const wrapper = createWrapper(mockEscrowCreate) + renderComponent(mockEscrowCreate) expect(wrapper.find('[data-testid="account"]')).toHaveText( ` rLbgNAngLq3HABBXK4uPGCHrqeZwgaYi7q `, ) diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx index b1aa79519..f4bcfffcc 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx @@ -1,12 +1,13 @@ +import { cleanup, screen } from '@testing-library/react' import EscrowFinish from './mock_data/EscrowFinish.json' import { Description } from '../Description' import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionRenderFactory(Description) +const renderComponent = createDescriptionRenderFactory(Description) describe('EscrowFinishDescription', () => { it('renders description for EscrowFinish', () => { - const wrapper = createWrapper(EscrowFinish) + renderComponent(EscrowFinish) expect(wrapper.html()).toBe( '
escrow_completion_desc
The escrowed amount of\uE9000.0154XRPwas delivered to (\uE9000.015388XRP escrow_after_transaction_cost)
The escrow was created bywith transaction3E2E75...
escrow_finish_fullfillment_desc Fulfillment
', ) diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx index 4c4b7cad3..ca316075a 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx @@ -2,11 +2,11 @@ import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockEscrowFinish from './mock_data/EscrowFinish.json' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('EscrowFinishSimple', () => { it('renders with an expiration and offer', () => { - const wrapper = createWrapper(mockEscrowFinish) + renderComponent(mockEscrowFinish) expect(wrapper.find('[data-testid="escrow-amount"] .value')).toHaveText( `\uE9000.0154 XRP`, ) diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx index 7b667fb84..b709cfe26 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx @@ -1,12 +1,13 @@ +import { cleanup, screen } from '@testing-library/react' import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import mockEscrowFinish from './mock_data/EscrowFinish.json' -const createWrapper = createTableDetailRenderFactory(TableDetail) +const renderComponent = createTableDetailRenderFactory(TableDetail) describe('EscrowFinishTableDetail', () => { it('renders EscrowFinish without crashing', () => { - const wrapper = createWrapper(mockEscrowFinish) + renderComponent(mockEscrowFinish) expect(wrapper.find('[data-testid="escrow-account"]')).toHaveText( `finish_escrowr4UDXF4nL7Tgss8uQxn39cCocd8GnGyXS8 -28`, ) diff --git a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx index c9e751c2b..3f3847b36 100644 --- a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import transactionBuy from './mock_data/NFTokenAcceptOffer_Buy.json' @@ -6,11 +7,11 @@ import transactionFailure from './mock_data/NFTokenAcceptOffer_Failure.json' import transactionBroker from './mock_data/NFTokenAcceptOffer_Broker.json' import { expectSimpleRowText, expectSimpleRowNotToExist } from '../../test' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('NFTokenAcceptOffer', () => { it('handles NFTokenAcceptOffer Buy simple view ', () => { - const wrapper = createWrapper(transactionBuy) + renderComponent(transactionBuy) expectSimpleRowText( wrapper, @@ -29,7 +30,7 @@ describe('NFTokenAcceptOffer', () => { }) it('handles NFTokenAcceptOffer Sell simple view ', () => { - const wrapper = createWrapper(transactionSell) + renderComponent(transactionSell) expectSimpleRowText( wrapper, 'token-id', @@ -47,7 +48,7 @@ describe('NFTokenAcceptOffer', () => { }) it('handles NFTokenAcceptOffer Sell Failure simple view ', () => { - const wrapper = createWrapper(transactionFailure) + renderComponent(transactionFailure) expectSimpleRowText( wrapper, @@ -62,7 +63,7 @@ describe('NFTokenAcceptOffer', () => { }) it('handles NFTokenAcceptOffer from Broker simple view ', () => { - const wrapper = createWrapper(transactionBroker) + renderComponent(transactionBroker) expectSimpleRowText( wrapper, 'token-id', diff --git a/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx index 2642d270f..86b3089d8 100644 --- a/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import { createSimpleRenderFactory, expectSimpleRowText, @@ -7,11 +8,11 @@ import { Simple } from '../Simple' import transaction from './mock_data/NFTokenBurn.json' import transactionByIssuer from './mock_data/NFTokenBurnByIssuer.json' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('NFTokenBurn', () => { it('handles NFTokenBurn simple view ', () => { - const wrapper = createWrapper(transaction) + renderComponent(transaction) expectSimpleRowText( wrapper, 'token-id', @@ -22,7 +23,7 @@ describe('NFTokenBurn', () => { }) it('handles NFTokenBurn when the burner is not the owner', () => { - const wrapper = createWrapper(transactionByIssuer) + renderComponent(transactionByIssuer) expectSimpleRowText( wrapper, 'token-id', diff --git a/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx index 4a5b9b9f5..73d290146 100644 --- a/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import { Simple } from '../Simple' import transactionBuy from './mock_data/NFTokenCreateOffer_Buy.json' @@ -5,11 +6,11 @@ import transactionSell from './mock_data/NFTokenCreateOffer_Sell.json' import transactionFailed from './mock_data/NFTokenCreateOfferFailed.json' import transactionDestination from './mock_data/NFTokenCreateOfferDestination.json' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('NFTokenCreateOffer', () => { it('handles NFTokenCreateOffer buy simple view ', () => { - const wrapper = createWrapper(transactionBuy) + renderComponent(transactionBuy) expectSimpleRowText( wrapper, 'token-id', @@ -35,7 +36,7 @@ describe('NFTokenCreateOffer', () => { }) it('handles NFTokenCreateOffer sell simple view ', () => { - const wrapper = createWrapper(transactionSell) + renderComponent(transactionSell) expectSimpleRowText( wrapper, 'token-id', @@ -65,7 +66,7 @@ describe('NFTokenCreateOffer', () => { }) it('handles failed NFTokenCreateOffer transaction', () => { - const wrapper = createWrapper(transactionFailed) + renderComponent(transactionFailed) expectSimpleRowText( wrapper, 'token-id', @@ -78,7 +79,7 @@ describe('NFTokenCreateOffer', () => { }) it('handles NFTokenCreateOffer with destination', () => { - const wrapper = createWrapper(transactionDestination) + renderComponent(transactionDestination) expectSimpleRowText( wrapper, 'destination', diff --git a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx index ffb8fd35a..9d1c35d61 100644 --- a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx @@ -1,6 +1,7 @@ import { BrowserRouter as Router } from 'react-router-dom' import { mount } from 'enzyme' import { I18nextProvider } from 'react-i18next' +import { cleanup, screen } from '@testing-library/react' import { Simple as NFTokenMint } from '../Simple' import transactionModified2 from './mock_data/NFTokenMintModified2.json' import transactionModified1Created1 from './mock_data/NFTokenMintModified1Created1.json' diff --git a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx index 84f2a91b5..bce27f634 100644 --- a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx @@ -1,12 +1,14 @@ +import { cleanup, screen } from '@testing-library/react' import { createDescriptionRenderFactory } from '../../test' import { Description } from '../Description' import offerCancel from './mock_data/OfferCancel.json' -const createWrapper = createDescriptionRenderFactory(Description) +const renderComponent = createDescriptionRenderFactory(Description) describe('OfferCancel: Description', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(offerCancel) + renderComponent(offerCancel) expect(wrapper.find('[data-testid="cancel-line"]')).toHaveText( 'offer_cancel_description15239384', diff --git a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateSimple.test.tsx b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateSimple.test.tsx index 431eaa7c8..1f94935ba 100644 --- a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateSimple.test.tsx @@ -1,12 +1,14 @@ +import { cleanup, screen } from '@testing-library/react' import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import { Simple } from '../Simple' import offerCancel from './mock_data/OfferCancel.json' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('OfferCancel: Simple', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(offerCancel) + renderComponent(offerCancel) expectSimpleRowText(wrapper, 'cancel', '#15239384') }) diff --git a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx index 8a8965bbd..8270131e5 100644 --- a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx @@ -1,12 +1,14 @@ +import { cleanup, screen } from '@testing-library/react' import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import offerCancel from './mock_data/OfferCancel.json' -const createWrapper = createTableDetailRenderFactory(TableDetail) +const renderComponent = createTableDetailRenderFactory(TableDetail) describe('OfferCancel: TableDetail', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(offerCancel) + renderComponent(offerCancel) expect(wrapper).toHaveText('cancel_offer #15239384') }) diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx index a0264bc91..491162269 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx @@ -1,13 +1,15 @@ +import { cleanup, screen } from '@testing-library/react' import OfferCreate from './mock_data/OfferCreateWithExpirationAndCancel.json' import OfferCreateInvertedCurrencies from './mock_data/OfferCreateInvertedCurrencies.json' import { Description } from '../Description' import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionRenderFactory(Description) +const renderComponent = createDescriptionRenderFactory(Description) describe('OfferCreate: Description', () => { + afterEach(cleanup) it('renders description for transaction with cancel and expiration', () => { - const wrapper = createWrapper(OfferCreate) + renderComponent(OfferCreate) expect(wrapper.html()).toBe( '
The accountoffered to pay1,080,661.95882CSCin order to receive\uE9001,764.293151XRP
offer_create_desc_line_2 612.52XRP/CSC
offer_create_desc_line_3 44866443
The offer expiresMay 18, 2022 at 5:28:16 PM UTCunless cancelled before', @@ -16,7 +18,7 @@ describe('OfferCreate: Description', () => { }) it('renders description for transaction with inverted currencies', () => { - const wrapper = createWrapper(OfferCreateInvertedCurrencies) + renderComponent(OfferCreateInvertedCurrencies) expect(wrapper.html()).toBe( '
The accountoffered to pay\uE90017,588.363594XRPin order to receive$6,101.33033905USD
offer_create_desc_line_2 0.34690XRP/USD
offer_create_desc_line_3 80543309
', diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx index 23e661320..45efedaf6 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx @@ -3,11 +3,12 @@ import mockOfferCreateWithCancel from './mock_data/OfferCreateWithExpirationAndC import mockOfferCreate from './mock_data/OfferCreate.json' import { createSimpleRenderFactory } from '../../test/createRenderFactory' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('OfferCreate: Simple', () => { + afterEach(cleanup) it('renders with an expiration and offer', () => { - const wrapper = createWrapper(mockOfferCreateWithCancel) + renderComponent(mockOfferCreateWithCancel) expect(wrapper.find('[data-testid="amount"] .one-line')).toHaveText( '\uE900 XRP/CSC.rCSC', ) @@ -24,7 +25,7 @@ describe('OfferCreate: Simple', () => { }) it('renders', () => { - const wrapper = createWrapper(mockOfferCreate) + renderComponent(mockOfferCreate) expect(wrapper.find('[data-testid="offer-id"] .value')).not.toExist() expect(wrapper.find('[data-testid="amount-buy"] .value')).toHaveText( diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx index f2196ebf5..248021fc2 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx @@ -1,14 +1,16 @@ +import { cleanup, screen } from '@testing-library/react' import { TableDetail } from '../TableDetail' import mockOfferCreateInvertedCurrencies from './mock_data/OfferCreateInvertedCurrencies.json' import mockOfferCreateWithCancel from './mock_data/OfferCreateWithExpirationAndCancel.json' import mockOfferCreate from './mock_data/OfferCreate.json' import { createTableDetailRenderFactory } from '../../test' -const createWrapper = createTableDetailRenderFactory(TableDetail) +const renderComponent = createTableDetailRenderFactory(TableDetail) describe('OfferCreate: TableDetail', () => { + afterEach(cleanup) it('renders with an expiration and offer', () => { - const wrapper = createWrapper(mockOfferCreateWithCancel) + renderComponent(mockOfferCreateWithCancel) expect(wrapper.find('[data-testid="pair"]')).toHaveText( 'price:612.518 \uE900 XRP/CSC.rCSC', @@ -26,7 +28,7 @@ describe('OfferCreate: TableDetail', () => { }) it('renders', () => { - const wrapper = createWrapper(mockOfferCreate) + renderComponent(mockOfferCreate) expect(wrapper.find('[data-testid="pair"]')).toHaveText( 'price:0.00207696 \uE900 XRP/BCH.rcyS', @@ -41,7 +43,7 @@ describe('OfferCreate: TableDetail', () => { }) it('renders inverted currencies', () => { - const wrapper = createWrapper(mockOfferCreateInvertedCurrencies) + renderComponent(mockOfferCreateInvertedCurrencies) expect(wrapper.find('[data-testid="pair"]')).toHaveText( 'price:0.346896 \uE900 XRP/USD.rvYA', diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx index 72f98dc3a..316cad5d0 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { Description } from '../Description' @@ -9,11 +10,12 @@ import mockPaymentSendMax from './mock_data/PaymentWithSendMax.json' import mockPaymentSourceTag from './mock_data/PaymentWithSourceTag.json' import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionRenderFactory(Description, i18n) +const renderComponent = createDescriptionRenderFactory(Description, i18n) describe('Payment: Description', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(mockPayment) + renderComponent(mockPayment) expect(wrapper.find('[data-testid="from-to-line"]')).toHaveText( `The payment is from rNQEMJA4PsoSrZRn9J6RajAYhcDzzhf8ok to rHoPwMC75KVUhBMeV3uDMybKG5JND74teh`, @@ -31,7 +33,7 @@ describe('Payment: Description', () => { }) it('renders with failed partial conversion', () => { - const wrapper = createWrapper(mockPaymentConvert) + renderComponent(mockPaymentConvert) expect(wrapper.find('[data-testid="from-to-line"]')).toHaveText( `The payment is from r9x5PHDiwuvbpYB3uvGAqEUVV5wxHayQEx to r9x5PHDiwuvbpYB3uvGAqEUVV5wxHayQEx`, @@ -47,7 +49,7 @@ describe('Payment: Description', () => { }) it('renders with destination tag', () => { - const wrapper = createWrapper(mockPaymentDestinationTag) + renderComponent(mockPaymentDestinationTag) expect(wrapper.find('[data-testid="from-to-line"]')).toHaveText( `The payment is from rDAE53VfMvftPB4ogpWGWvzkQxfht6JPxr to rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt`, @@ -67,7 +69,7 @@ describe('Payment: Description', () => { }) it('renders with send max', () => { - const wrapper = createWrapper(mockPaymentSendMax) + renderComponent(mockPaymentSendMax) expect(wrapper.find('[data-testid="from-to-line"]')).toHaveText( `The payment is from r3RaNVLvWjqqtFAawC6jbRhgKyFH7HvRS8 to rprcTynT68nYdKzDTefAZG9HjSHiYcnP4b`, @@ -86,7 +88,7 @@ describe('Payment: Description', () => { }) it('renders with partial', () => { - const wrapper = createWrapper(mockPaymentPartial) + renderComponent(mockPaymentPartial) expect(wrapper.find('[data-testid="from-to-line"]')).toHaveText( `The payment is from rGTurN94Nn3RkJGSqy9MwmQCLpXZkELbnq to rMQ4oGC8fasuJwfdrfknFTttDbf8cR3D2j`, @@ -106,7 +108,7 @@ describe('Payment: Description', () => { }) it('renders with SourceTag', () => { - const wrapper = createWrapper(mockPaymentSourceTag) + renderComponent(mockPaymentSourceTag) expect(wrapper.find('[data-testid="source-tag-line"]')).toHaveText( `The source tag is 20648`, diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx index 4946d015d..7a3ffe879 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx @@ -1,4 +1,5 @@ import { useQuery } from 'react-query' +import { cleanup, screen } from '@testing-library/react' import { createSimpleRenderFactory, expectSimpleRowLabel, @@ -18,11 +19,12 @@ jest.mock('react-query', () => ({ useQuery: jest.fn(), })) -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('Payment: Simple', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(mockPayment) + renderComponent(mockPayment) expectSimpleRowText(wrapper, 'amount', `\uE9002,421.8268 XRP`) expectSimpleRowLabel(wrapper, 'amount', `send`) @@ -37,7 +39,7 @@ describe('Payment: Simple', () => { }) it('renders with failed partial conversion', () => { - const wrapper = createWrapper(mockPaymentConvert) + renderComponent(mockPaymentConvert) expectSimpleRowLabel(wrapper, 'max', `convert_maximum`) expectSimpleRowText(wrapper, 'max', `\uE9001,140.00 XRP`) @@ -55,7 +57,7 @@ describe('Payment: Simple', () => { }) it('renders with destination tag', () => { - const wrapper = createWrapper(mockPaymentDestinationTag) + renderComponent(mockPaymentDestinationTag) expectSimpleRowText(wrapper, 'amount', `\uE9001,531.267 XRP`) expectSimpleRowLabel(wrapper, 'amount', `send`) @@ -70,7 +72,7 @@ describe('Payment: Simple', () => { }) it('renders with send max', () => { - const wrapper = createWrapper(mockPaymentSendMax) + renderComponent(mockPaymentSendMax) expectSimpleRowText( wrapper, @@ -96,7 +98,7 @@ describe('Payment: Simple', () => { }) it('renders with partial', () => { - const wrapper = createWrapper(mockPaymentPartial) + renderComponent(mockPaymentPartial) expectSimpleRowText( wrapper, @@ -115,7 +117,7 @@ describe('Payment: Simple', () => { }) it('renders with SourceTag', () => { - const wrapper = createWrapper(mockPaymentSourceTag) + renderComponent(mockPaymentSourceTag) expectSimpleRowText(wrapper, 'source-tag', `20648`) diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx index c58dabb23..ae4348b89 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import mockPayment from './mock_data/Payment.json' @@ -7,11 +8,12 @@ import mockPaymentPartial from './mock_data/PaymentWithPartial.json' import mockPaymentSendMax from './mock_data/PaymentWithSendMax.json' import mockPaymentSourceTag from './mock_data/PaymentWithSourceTag.json' -const createWrapper = createTableDetailRenderFactory(TableDetail) +const renderComponent = createTableDetailRenderFactory(TableDetail) describe('Payment: TableDetail', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(mockPayment) + renderComponent(mockPayment) // styling makes this look okay expect(wrapper.find('.payment')).toHaveText( @@ -22,7 +24,7 @@ describe('Payment: TableDetail', () => { }) it('renders with failed partial conversion', () => { - const wrapper = createWrapper(mockPaymentConvert) + renderComponent(mockPaymentConvert) // styling makes this look okay expect(wrapper.find('.payment')).toHaveText( @@ -33,7 +35,7 @@ describe('Payment: TableDetail', () => { }) it('renders with destination tag', () => { - const wrapper = createWrapper(mockPaymentDestinationTag) + renderComponent(mockPaymentDestinationTag) // styling makes this look okay expect(wrapper.find('.payment')).toHaveText( @@ -44,7 +46,7 @@ describe('Payment: TableDetail', () => { }) it('renders with send max', () => { - const wrapper = createWrapper(mockPaymentSendMax) + renderComponent(mockPaymentSendMax) // styling makes this look okay expect(wrapper.find('.payment')).toHaveText( @@ -55,7 +57,7 @@ describe('Payment: TableDetail', () => { }) it('renders with partial', () => { - const wrapper = createWrapper(mockPaymentPartial) + renderComponent(mockPaymentPartial) // styling makes this look okay expect(wrapper.find('.payment')).toHaveText( @@ -66,7 +68,7 @@ describe('Payment: TableDetail', () => { }) it('renders with SourceTag', () => { - const wrapper = createWrapper(mockPaymentSourceTag) + renderComponent(mockPaymentSourceTag) expect(wrapper.find('.st')).toHaveText('source_tag: 20648') diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx index a9f04c584..5b0ab0f0e 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx @@ -7,11 +7,12 @@ import mockPaymentChannelClaimCloseDenied from './mock_data/PaymentChannelClaimC import mockPaymentChannelClaimWithDestinationTag from './mock_data/PaymentChannelClaimWithDestinationTag.json' import { Description } from '../Description' -const createWrapper = createDescriptionRenderFactory(Description, i18n) +const renderComponent = createDescriptionRenderFactory(Description, i18n) describe('PaymentChannelClaim: Description', () => { + afterEach(cleanup) it('renders a claim', () => { - const wrapper = createWrapper(mockPaymentChannelClaim) + renderComponent(mockPaymentChannelClaim) expect(wrapper.find('[data-testid="account-line"]')).toHaveText( `The transaction was initiated by rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN`, ) @@ -26,7 +27,7 @@ describe('PaymentChannelClaim: Description', () => { }) it('renders tx with channel being closed', () => { - const wrapper = createWrapper(mockPaymentChannelClaimClosed) + renderComponent(mockPaymentChannelClaimClosed) expect(wrapper.find('[data-testid="account-line"]')).toHaveText( `The transaction was initiated by rH11fDGhbVH5NVXNXkGAMTmfWhUHjCtA3B`, ) @@ -41,7 +42,7 @@ describe('PaymentChannelClaim: Description', () => { }) it('renders tx requesting channel be closed but not closing it', () => { - const wrapper = createWrapper(mockPaymentChannelClaimCloseDenied) + renderComponent(mockPaymentChannelClaimCloseDenied) expect(wrapper.find('[data-testid="account-line"]')).toHaveText( `The transaction was initiated by rH11fDGhbVH5NVXNXkGAMTmfWhUHjCtA3B`, ) @@ -54,7 +55,7 @@ describe('PaymentChannelClaim: Description', () => { }) it('renders tx with destination tag', () => { - const wrapper = createWrapper(mockPaymentChannelClaimWithDestinationTag) + renderComponent(mockPaymentChannelClaimWithDestinationTag) expect(wrapper.find('[data-testid="account-line"]')).toHaveText( `The transaction was initiated by rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn`, ) diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx index 9e85ecd99..4d339d5c4 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createSimpleRenderFactory } from '../../test/createRenderFactory' @@ -12,11 +13,12 @@ import { expectSimpleRowText, } from '../../test' -const createWrapper = createSimpleRenderFactory(Simple, i18n) +const renderComponent = createSimpleRenderFactory(Simple, i18n) describe('PaymentChannelClaim: Simple', () => { + afterEach(cleanup) it('renders a claim', () => { - const wrapper = createWrapper(mockPaymentChannelClaim) + renderComponent(mockPaymentChannelClaim) expectSimpleRowLabel(wrapper, 'amount', 'channel amount') expectSimpleRowText(wrapper, 'amount', '\uE90070.00 XRP') expectSimpleRowLabel(wrapper, 'claimed', 'amount claimed') @@ -48,7 +50,7 @@ describe('PaymentChannelClaim: Simple', () => { }) it('renders tx with channel being closed', () => { - const wrapper = createWrapper(mockPaymentChannelClaimClosed) + renderComponent(mockPaymentChannelClaimClosed) expectSimpleRowText(wrapper, 'amount', '\uE90010.00 XRP') expectSimpleRowNotToExist(wrapper, 'claimed') expectSimpleRowText(wrapper, 'total', '\uE9000.34 XRP') @@ -74,7 +76,7 @@ describe('PaymentChannelClaim: Simple', () => { }) it('renders tx requesting channel be closed but not closing it', () => { - const wrapper = createWrapper(mockPaymentChannelClaimCloseDenied) + renderComponent(mockPaymentChannelClaimCloseDenied) expectSimpleRowText(wrapper, 'amount', '\uE90010.00 XRP') expectSimpleRowNotToExist(wrapper, 'claimed') expectSimpleRowNotToExist(wrapper, 'total') @@ -100,7 +102,7 @@ describe('PaymentChannelClaim: Simple', () => { }) it('renders tx with destination tag', () => { - const wrapper = createWrapper(mockPaymentChannelClaimWithDestinationTag) + renderComponent(mockPaymentChannelClaimWithDestinationTag) expectSimpleRowText(wrapper, 'amount', '\uE900100.00 XRP') expectSimpleRowText(wrapper, 'claimed', '\uE9001.00 XRP') expectSimpleRowText(wrapper, 'total', '\uE9001.00 XRP') diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx index 996e89852..889216bac 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx @@ -7,11 +7,12 @@ import mockPaymentChannelClaimClosed from './mock_data/PaymentChannelClaimClosed import mockPaymentChannelClaimCloseDenied from './mock_data/PaymentChannelClaimCloseDenied.json' import mockPaymentChannelClaimWithDestinationTag from './mock_data/PaymentChannelClaimWithDestinationTag.json' -const createWrapper = createTableDetailRenderFactory(TableDetail, i18n) +const renderComponent = createTableDetailRenderFactory(TableDetail, i18n) describe('PaymentChannelClaim: TableDetail', () => { + afterEach(cleanup) it('renders a claim', () => { - const wrapper = createWrapper(mockPaymentChannelClaim) + renderComponent(mockPaymentChannelClaim) expect(wrapper.find('[data-testid="source"]')).toHaveText( 'sourcernNzy3iPc7gPEAJbAdXwxY1UTBamBqTYhR:1002539517', ) @@ -29,7 +30,7 @@ describe('PaymentChannelClaim: TableDetail', () => { }) it('renders tx with channel being closed', () => { - const wrapper = createWrapper(mockPaymentChannelClaimClosed) + renderComponent(mockPaymentChannelClaimClosed) expect(wrapper.find('[data-testid="source"]')).toHaveText( 'sourcerH11fDGhbVH5NVXNXkGAMTmfWhUHjCtA3B:2647131528', ) @@ -51,7 +52,7 @@ describe('PaymentChannelClaim: TableDetail', () => { }) it('renders tx requesting channel be closed but not closing it', () => { - const wrapper = createWrapper(mockPaymentChannelClaimCloseDenied) + renderComponent(mockPaymentChannelClaimCloseDenied) expect(wrapper.find('[data-testid="source"]')).toHaveText( 'sourcerH11fDGhbVH5NVXNXkGAMTmfWhUHjCtA3B:2647131528', ) @@ -71,7 +72,7 @@ describe('PaymentChannelClaim: TableDetail', () => { }) it('renders tx with destination tag', () => { - const wrapper = createWrapper(mockPaymentChannelClaimWithDestinationTag) + renderComponent(mockPaymentChannelClaimWithDestinationTag) expect(wrapper.find('[data-testid="source"]')).toHaveText( 'sourcerN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH', ) diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx index c787024a5..4778ec989 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createDescriptionRenderFactory } from '../../test' @@ -6,11 +7,12 @@ import mockPaymentChannelCreateFailed from './mock_data/PaymentChannelCreateFail import mockPaymentChannelCreateWithDestinationTag from './mock_data/PaymentChannelCreateWithDestinationTag.json' import { Description } from '../Description' -const createWrapper = createDescriptionRenderFactory(Description, i18n) +const renderComponent = createDescriptionRenderFactory(Description, i18n) describe('PaymentChannelCreate: Description', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(mockPaymentChannelCreate) + renderComponent(mockPaymentChannelCreate) expect(wrapper.find('[data-testid="accounts-line"]')).toHaveText( `The account rJnQrhRTXutuSwtrwxYiTkHn4Dtp8sF2LM:2460331042 will create a payment channel to rUXYat4hW2M87gHoqKK7fC4cqrT9C6V7d7`, ) @@ -28,7 +30,7 @@ describe('PaymentChannelCreate: Description', () => { }) it('renders failed tx', () => { - const wrapper = createWrapper(mockPaymentChannelCreateFailed) + renderComponent(mockPaymentChannelCreateFailed) expect(wrapper.find('[data-testid="accounts-line"]')).toHaveText( `The account rMphibGfHpLDU4DzVCspzLYVuMNpmzN6n8:2810223114 will create a payment channel to rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN`, ) @@ -44,7 +46,7 @@ describe('PaymentChannelCreate: Description', () => { }) it('renders tx with destination tag', () => { - const wrapper = createWrapper(mockPaymentChannelCreateWithDestinationTag) + renderComponent(mockPaymentChannelCreateWithDestinationTag) expect(wrapper.find('[data-testid="accounts-line"]')).toHaveText( `The account rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH will create a payment channel to rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn:20170428`, ) diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx index 2f41ea130..fc0789b35 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { @@ -11,11 +12,12 @@ import mockPaymentChannelCreateFailed from './mock_data/PaymentChannelCreateFail import mockPaymentChannelCreateWithDestinationTag from './mock_data/PaymentChannelCreateWithDestinationTag.json' import { Simple } from '../Simple' -const createWrapper = createSimpleRenderFactory(Simple, i18n) +const renderComponent = createSimpleRenderFactory(Simple, i18n) describe('PaymentChannelCreate: Simple', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(mockPaymentChannelCreate) + renderComponent(mockPaymentChannelCreate) expectSimpleRowLabel(wrapper, 'amount', 'Amount') expectSimpleRowText(wrapper, 'amount', '\uE9001.00 XRP') expectSimpleRowLabel(wrapper, 'source', 'source') @@ -42,7 +44,7 @@ describe('PaymentChannelCreate: Simple', () => { }) it('renders failed tx', () => { - const wrapper = createWrapper(mockPaymentChannelCreateFailed) + renderComponent(mockPaymentChannelCreateFailed) expectSimpleRowText(wrapper, 'amount', '\uE90010.00 XRP') expectSimpleRowText( wrapper, @@ -60,7 +62,7 @@ describe('PaymentChannelCreate: Simple', () => { }) it('renders tx with destination tag', () => { - const wrapper = createWrapper(mockPaymentChannelCreateWithDestinationTag) + renderComponent(mockPaymentChannelCreateWithDestinationTag) expectSimpleRowText(wrapper, 'amount', '\uE900100.00 XRP') expectSimpleRowText(wrapper, 'source', 'rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH') expectSimpleRowText( diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx index 0cf0814f0..015b1330b 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createTableDetailRenderFactory } from '../../test' @@ -6,11 +7,12 @@ import mockPaymentChannelCreateFailed from './mock_data/PaymentChannelCreateFail import mockPaymentChannelCreateWithDestinationTag from './mock_data/PaymentChannelCreateWithDestinationTag.json' import { TableDetail } from '../TableDetail' -const createWrapper = createTableDetailRenderFactory(TableDetail, i18n) +const renderComponent = createTableDetailRenderFactory(TableDetail, i18n) describe('PaymentChannelCreate: TableDetail', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(mockPaymentChannelCreate) + renderComponent(mockPaymentChannelCreate) expect(wrapper.find('[data-testid="source"]')).toHaveText( 'sourcerJnQrhRTXutuSwtrwxYiTkHn4Dtp8sF2LM:2460331042', ) @@ -22,7 +24,7 @@ describe('PaymentChannelCreate: TableDetail', () => { }) it('renders failed tx', () => { - const wrapper = createWrapper(mockPaymentChannelCreateFailed) + renderComponent(mockPaymentChannelCreateFailed) expect(wrapper.find('[data-testid="source"]')).toHaveText( 'sourcerMphibGfHpLDU4DzVCspzLYVuMNpmzN6n8:2810223114', ) @@ -34,7 +36,7 @@ describe('PaymentChannelCreate: TableDetail', () => { }) it('renders tx with destination tag', () => { - const wrapper = createWrapper(mockPaymentChannelCreateWithDestinationTag) + renderComponent(mockPaymentChannelCreateWithDestinationTag) expect(wrapper.find('[data-testid="source"]')).toHaveText( 'sourcerN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH', ) diff --git a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx index d4663626e..32bbaecbe 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx @@ -5,11 +5,12 @@ import mockPaymentChannelFund from './mock_data/PaymentChannelFund.json' import mockPaymentChannelFundFailed from './mock_data/PaymentChannelFundFailed.json' import { Description } from '../Description' -const createWrapper = createDescriptionRenderFactory(Description, i18n) +const renderComponent = createDescriptionRenderFactory(Description, i18n) describe('PaymentChannelFund: Description', () => { + afterEach(cleanup) it('renders a Fund', () => { - const wrapper = createWrapper(mockPaymentChannelFund) + renderComponent(mockPaymentChannelFund) expect(wrapper.find('[data-testid="channel-line"]')).toHaveText( `It will update the payment channel 4BEAC9E4C10674AB698EAC0F2D78A4FF507428370578A59B04883E7EB8D82260`, ) @@ -20,7 +21,7 @@ describe('PaymentChannelFund: Description', () => { }) it('renders failed tx', () => { - const wrapper = createWrapper(mockPaymentChannelFundFailed) + renderComponent(mockPaymentChannelFundFailed) expect(wrapper.find('[data-testid="channel-line"]')).toHaveText( `It will update the payment channel 933F93F7113A2F94B7838D64D0D2A244C57EFD6411C16FFF5FA293D200EF5876`, ) diff --git a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx index f16bd3a43..43947ee55 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createSimpleRenderFactory } from '../../test/createRenderFactory' @@ -10,11 +11,12 @@ import { expectSimpleRowText, } from '../../test' -const createWrapper = createSimpleRenderFactory(Simple, i18n) +const renderComponent = createSimpleRenderFactory(Simple, i18n) describe('PaymentChannelFund: Simple', () => { + afterEach(cleanup) it('renders a fund', () => { - const wrapper = createWrapper(mockPaymentChannelFund) + renderComponent(mockPaymentChannelFund) expectSimpleRowLabel(wrapper, 'increase', 'channel amount increase') expectSimpleRowText(wrapper, 'increase', '+\uE9001.00 XRP') expectSimpleRowLabel(wrapper, 'channel-amount', 'channel amount') @@ -43,7 +45,7 @@ describe('PaymentChannelFund: Simple', () => { }) it('renders failed tx', () => { - const wrapper = createWrapper(mockPaymentChannelFundFailed) + renderComponent(mockPaymentChannelFundFailed) expectSimpleRowLabel(wrapper, 'increase', 'channel amount increase') expectSimpleRowText(wrapper, 'increase', '+\uE90020.00 XRP') expectSimpleRowNotToExist(wrapper, 'channel-amount') diff --git a/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx b/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx index 0ff67740c..16887a098 100644 --- a/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import { createDescriptionRenderFactory } from '../../test' import { Description } from '../Description' import i18nTestConfigEnUS from '../../../../../../i18n/testConfigEnglish' @@ -5,7 +6,7 @@ import i18nTestConfigEnUS from '../../../../../../i18n/testConfigEnglish' import SetFeePreAmendment from './mock_data/SetFee_PreAmendment.json' import SetFeePostAmendment from './mock_data/SetFee_PostAmendment.json' -const createWrapper = createDescriptionRenderFactory( +const renderComponent = createDescriptionRenderFactory( Description, i18nTestConfigEnUS, ) @@ -23,14 +24,15 @@ function testDescription(wrapper) { } describe('SetFee: Description', () => { + afterEach(cleanup) it('renders Description for transaction before XRPFees amendment', () => { - const wrapper = createWrapper(SetFeePreAmendment) + renderComponent(SetFeePreAmendment) testDescription(wrapper) wrapper.unmount() }) it('renders Description for transaction after XRPFees amendment', () => { - const wrapper = createWrapper(SetFeePostAmendment) + renderComponent(SetFeePostAmendment) testDescription(wrapper) wrapper.unmount() }) diff --git a/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx b/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx index 5b038c640..9dd7a28f3 100644 --- a/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import { createSimpleRenderFactory, expectSimpleRowLabel, @@ -9,7 +10,7 @@ import i18nTestConfigEnUS from '../../../../../../i18n/testConfigEnglish' import SetFeePreAmendment from './mock_data/SetFee_PreAmendment.json' import SetFeePostAmendment from './mock_data/SetFee_PostAmendment.json' -const createWrapper = createSimpleRenderFactory(Simple, i18nTestConfigEnUS) +const renderComponent = createSimpleRenderFactory(Simple, i18nTestConfigEnUS) function testSimple(wrapper) { expectSimpleRowLabel(wrapper, `base-fee`, 'Base Fee') @@ -21,14 +22,15 @@ function testSimple(wrapper) { } describe('SetFee: Simple', () => { + afterEach(cleanup) it('renders Simple for transaction before XRPFees amendment', () => { - const wrapper = createWrapper(SetFeePreAmendment) + renderComponent(SetFeePreAmendment) testSimple(wrapper) wrapper.unmount() }) it('renders Simple for transaction after XRPFees amendment', () => { - const wrapper = createWrapper(SetFeePostAmendment) + renderComponent(SetFeePostAmendment) testSimple(wrapper) wrapper.unmount() }) diff --git a/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx b/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx index 2873dce54..7e9662982 100644 --- a/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx @@ -5,11 +5,11 @@ import mockSetHook2 from './mock_data/SetHook2.json' import mockSetHookFailure from './mock_data/SetHookFailure.json' import { expectSimpleRowText } from '../../test/expectations' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('SetHookSimple', () => { it('renders', () => { - const wrapper = createWrapper(mockSetHook) + renderComponent(mockSetHook) expect(wrapper.find('.group')).toHaveLength(2) @@ -46,7 +46,7 @@ describe('SetHookSimple', () => { }) it('renders a different SetHook tx', () => { - const wrapper = createWrapper(mockSetHook2) + renderComponent(mockSetHook2) expect(wrapper.find('.group')).toHaveLength(1) @@ -81,7 +81,7 @@ describe('SetHookSimple', () => { }) it('renders a failed SetHook tx', () => { - const wrapper = createWrapper(mockSetHookFailure) + renderComponent(mockSetHookFailure) expect(wrapper.find('.group')).toHaveLength(1) diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx index 055ba1a38..30ce5cde4 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx @@ -1,13 +1,15 @@ +import { cleanup, screen } from '@testing-library/react' import SetRegularKey from './mock_data/SetRegularKey.json' import SetRegularKeyUnset from './mock_data/SetRegularKeyUnsetKey.json' import { Description } from '../Description' import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionRenderFactory(Description) +const renderComponent = createDescriptionRenderFactory(Description) describe('SetRegularKey: Description', () => { + afterEach(cleanup) it('renders description for transaction', () => { - const wrapper = createWrapper(SetRegularKey) + renderComponent(SetRegularKey) expect(wrapper.html()).toBe( `
set_regular_key_description rULyyLRoZ47P33Vapew67VoiRqPrZ2ejbp
`, @@ -16,7 +18,7 @@ describe('SetRegularKey: Description', () => { }) it('renders description for transaction that unsets key', () => { - const wrapper = createWrapper(SetRegularKeyUnset) + renderComponent(SetRegularKeyUnset) expect(wrapper.html()).toBe(`
unset_regular_key_description
`) wrapper.unmount() diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx index e27f2b088..0c7f4b342 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx @@ -4,11 +4,12 @@ import { Simple } from '../Simple' import { SimpleRow } from '../../SimpleRow' import { createSimpleRenderFactory } from '../../test/createRenderFactory' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('SetRegularKey: Simple', () => { + afterEach(cleanup) it('renders Simple for transaction', () => { - const wrapper = createWrapper(SetRegularKey) + renderComponent(SetRegularKey) const keyRow = wrapper.find(SimpleRow) expect(keyRow.prop('label')).toBe(`regular_key`) @@ -19,7 +20,7 @@ describe('SetRegularKey: Simple', () => { }) it('renders Simple for transaction that unsets key', () => { - const wrapper = createWrapper(SetRegularKeyUnset) + renderComponent(SetRegularKeyUnset) const keyRow = wrapper.find(SimpleRow) expect(keyRow.prop('label')).toBe('') diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx index e118acbdc..a78dc9926 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx @@ -1,13 +1,14 @@ +import { cleanup, screen } from '@testing-library/react' import SetRegularKey from './mock_data/SetRegularKey.json' import SetRegularKeyUnset from './mock_data/SetRegularKeyUnsetKey.json' import { TableDetail } from '../TableDetail' import { createTableDetailRenderFactory } from '../../test' -const createWrapper = createTableDetailRenderFactory(TableDetail) +const renderComponent = createTableDetailRenderFactory(TableDetail) describe('SetRegularKeyTable: Detail', () => { it('renders Simple for transaction', () => { - const wrapper = createWrapper(SetRegularKey) + renderComponent(SetRegularKey) expect(wrapper.find('.setregularkey')).toExist() expect(wrapper.find('.label').text()).toBe(`regular_key`) @@ -18,7 +19,7 @@ describe('SetRegularKeyTable: Detail', () => { }) it('renders Simple for transaction that unsets key', () => { - const wrapper = createWrapper(SetRegularKeyUnset) + renderComponent(SetRegularKeyUnset) expect(wrapper.find('.unset')).toExist() expect(wrapper.text()).toBe(`unset_regular_key`) diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx index cc8773ef7..b1d07b4b1 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx @@ -1,13 +1,15 @@ +import { cleanup, screen } from '@testing-library/react' import mockSignerListSetClear from './mock_data/SignerListSetClear.json' import mockSignerListSet from './mock_data/SignerListSet.json' import { Description } from '../Description' import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionRenderFactory(Description) +const renderComponent = createDescriptionRenderFactory(Description) describe('SignerListSet: Description', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(mockSignerListSet) + renderComponent(mockSignerListSet) expect(wrapper.find('div').at(0).text()).toEqual( 'set_signer_list_description:', @@ -26,7 +28,7 @@ describe('SignerListSet: Description', () => { }) it('renders when signer list is cleared', () => { - const wrapper = createWrapper(mockSignerListSetClear) + renderComponent(mockSignerListSetClear) expect(wrapper).toHaveText('unset_signer_list_description') wrapper.unmount() }) diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx index e734a7c42..869089210 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx @@ -4,11 +4,12 @@ import mockSignerListSet from './mock_data/SignerListSet.json' import { SimpleRow } from '../../SimpleRow' import { createSimpleRenderFactory } from '../../test/createRenderFactory' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('SignerListSet: Simple', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(mockSignerListSet) + renderComponent(mockSignerListSet) expect(wrapper.find('[data-testid="quorum"] .value').text()).toEqual( '3 out_of 4', @@ -28,7 +29,7 @@ describe('SignerListSet: Simple', () => { }) it('renders when signer list is cleared', () => { - const wrapper = createWrapper(mockSignerListSetClear) + renderComponent(mockSignerListSetClear) expect(wrapper.find(SimpleRow)).toHaveText('unset_signer_list') wrapper.unmount() }) diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx index f6c256628..8fb4246ba 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx @@ -1,20 +1,22 @@ +import { cleanup, screen } from '@testing-library/react' import { TableDetail } from '../TableDetail' import mockSignerListSetClear from './mock_data/SignerListSetClear.json' import mockSignerListSet from './mock_data/SignerListSet.json' import { createTableDetailRenderFactory } from '../../test' -const createWrapper = createTableDetailRenderFactory(TableDetail) +const renderComponent = createTableDetailRenderFactory(TableDetail) describe('SignerListSet: TableDetail', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(mockSignerListSet) + renderComponent(mockSignerListSet) expect(wrapper).toHaveText('signers: 3 - quorum: 3/4') wrapper.unmount() }) it('renders when signer list is cleared', () => { - const wrapper = createWrapper(mockSignerListSetClear) + renderComponent(mockSignerListSetClear) expect(wrapper).toHaveText('unset_signer_list') wrapper.unmount() }) diff --git a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateSimple.test.tsx b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateSimple.test.tsx index 50b0cd8e5..02558e539 100644 --- a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateSimple.test.tsx @@ -1,12 +1,14 @@ +import { cleanup, screen } from '@testing-library/react' import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import { Simple } from '../Simple' import TicketCreate from './mock_data/TicketCreate.json' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('TicketCreate: Simple', () => { + afterEach(cleanup) it('renders ticket count', () => { - const wrapper = createWrapper(TicketCreate) + renderComponent(TicketCreate) expectSimpleRowText(wrapper, 'ticket-count', '1') wrapper.unmount() }) diff --git a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx index 04f1f3947..4c8be6bdd 100644 --- a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx @@ -1,12 +1,14 @@ +import { cleanup, screen } from '@testing-library/react' import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import TicketCreate from './mock_data/TicketCreate.json' -const createWrapper = createTableDetailRenderFactory(TableDetail) +const renderComponent = createTableDetailRenderFactory(TableDetail) describe('TicketCreate: TableDetail', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(TicketCreate) + renderComponent(TicketCreate) expect(wrapper).toHaveText('ticket_count: 1') wrapper.unmount() }) diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx index 42f5254a2..47318be53 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import mockTrustSet from './mock_data/TrustSet.json' @@ -5,11 +6,12 @@ import mockTrustSet from './mock_data/TrustSet.json' import { Description } from '../Description' import { createDescriptionRenderFactory } from '../../test' -const createWrapper = createDescriptionRenderFactory(Description, i18n) +const renderComponent = createDescriptionRenderFactory(Description, i18n) describe('TrustSet: Description', () => { + afterEach(cleanup) it('renders description for authorize', () => { - const wrapper = createWrapper(mockTrustSet) + renderComponent(mockTrustSet) expect(wrapper.html()).toBe( `
It establishes CNÂ¥1,000,000,000.00 as the maximum amount of CNY from that is willing to hold
`, ) diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetSimple.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetSimple.test.tsx index e1081ed35..e7a5a9960 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetSimple.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createSimpleRenderFactory } from '../../test/createRenderFactory' @@ -5,11 +6,12 @@ import { Simple } from '../Simple' import mockTrustSet from './mock_data/TrustSet.json' import { expectSimpleRowLabel, expectSimpleRowText } from '../../test' -const createWrapper = createSimpleRenderFactory(Simple, i18n) +const renderComponent = createSimpleRenderFactory(Simple, i18n) describe('TrustSet: Simple', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(mockTrustSet) + renderComponent(mockTrustSet) expectSimpleRowLabel(wrapper, 'amount', 'Set Trust Limit') expectSimpleRowText( wrapper, diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx index e6728fd7f..6fc7a6941 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx @@ -1,13 +1,15 @@ +import { cleanup, screen } from '@testing-library/react' import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import mockTrustSet from './mock_data/TrustSet.json' import i18n from '../../../../../../i18n/testConfigEnglish' -const createWrapper = createTableDetailRenderFactory(TableDetail, i18n) +const renderComponent = createTableDetailRenderFactory(TableDetail, i18n) describe('TrustSet: TableDetail', () => { + afterEach(cleanup) it('renders', () => { - const wrapper = createWrapper(mockTrustSet) + renderComponent(mockTrustSet) expect(wrapper.find('.label')).toHaveText('Set Trust Limit') expect(wrapper.find('Amount')).toHaveText( 'CNÂ¥1,000,000,000.00 CNY.razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA', diff --git a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx index 490fb672c..9dc720ce5 100644 --- a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx +++ b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx @@ -1,4 +1,5 @@ import { mount } from 'enzyme' +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { expectSimpleRowLabel, expectSimpleRowText } from '../../test' import { createSimpleRenderFactory } from '../../test/createRenderFactory' @@ -10,11 +11,12 @@ import { SimpleTab } from '../../../../../Transactions/SimpleTab' import { QuickHarness } from '../../../../../test/utils' import summarizeTransaction from '../../../../../../rippled/lib/txSummary' -const createWrapper = createSimpleRenderFactory(Simple, i18n) +const renderComponent = createSimpleRenderFactory(Simple, i18n) describe('UNLModify: Simple', () => { + afterEach(cleanup) it('renders tx that enables a validator', () => { - const wrapper = createWrapper(mockUNLModifyEnable) + renderComponent(mockUNLModifyEnable) expectSimpleRowLabel(wrapper, 'validator', 'Validator') expectSimpleRowText( wrapper, @@ -27,7 +29,7 @@ describe('UNLModify: Simple', () => { }) it('renders tx that disables a validator', () => { - const wrapper = createWrapper(mockUNLModifyDisable) + renderComponent(mockUNLModifyDisable) expectSimpleRowLabel(wrapper, 'validator', 'Validator') expectSimpleRowText( wrapper, diff --git a/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx index ab47de1dd..5dc04f7bb 100644 --- a/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx @@ -4,11 +4,11 @@ import mockXChainAccountCreateCommit from './mock_data/XChainAccountCreateCommit import mockXChainAccountCreateCommitInsufficientFunds from './mock_data/XChainAccountCreateCommitInsufficientFunds.json' import { expectSimpleRowText } from '../../test/expectations' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('XChainAccountCreateCommitSimple', () => { it('renders', () => { - const wrapper = createWrapper(mockXChainAccountCreateCommit) + renderComponent(mockXChainAccountCreateCommit) // check XChainBridge parts expectSimpleRowText( @@ -36,9 +36,7 @@ describe('XChainAccountCreateCommitSimple', () => { }) it('renders failed transaction', () => { - const wrapper = createWrapper( - mockXChainAccountCreateCommitInsufficientFunds, - ) + renderComponent(mockXChainAccountCreateCommitInsufficientFunds) // check XChainBridge parts expectSimpleRowText( diff --git a/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx index 4993773bb..3266df1b4 100644 --- a/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx @@ -4,11 +4,11 @@ import mockXChainAddAccountCreateAttestation from './mock_data/XChainAddAccountC import mockXChainAddAccountCreateAttestationFailed from './mock_data/XChainAddAccountCreateAttestationFailed.json' import { expectSimpleRowText } from '../../test/expectations' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('XChainAddAccountCreateAttestationSimple', () => { it('renders', () => { - const wrapper = createWrapper(mockXChainAddAccountCreateAttestation) + renderComponent(mockXChainAddAccountCreateAttestation) // check XChainBridge parts expectSimpleRowText( @@ -41,7 +41,7 @@ describe('XChainAddAccountCreateAttestationSimple', () => { }) it('renders failed transaction', () => { - const wrapper = createWrapper(mockXChainAddAccountCreateAttestationFailed) + renderComponent(mockXChainAddAccountCreateAttestationFailed) // check XChainBridge parts expectSimpleRowText( diff --git a/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx index 0d90e21b6..211aa0348 100644 --- a/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx @@ -4,11 +4,11 @@ import mockXChainAddClaimAttestation from './mock_data/XChainAddClaimAttestation import mockXChainAddClaimAttestationFailed from './mock_data/XChainAddClaimAttestationFailed.json' import { expectSimpleRowText } from '../../test/expectations' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('XChainAddClaimAttestationSimple', () => { it('renders', () => { - const wrapper = createWrapper(mockXChainAddClaimAttestation) + renderComponent(mockXChainAddClaimAttestation) // check XChainBridge parts expectSimpleRowText( @@ -42,7 +42,7 @@ describe('XChainAddClaimAttestationSimple', () => { }) it('renders failed transaction', () => { - const wrapper = createWrapper(mockXChainAddClaimAttestationFailed) + renderComponent(mockXChainAddClaimAttestationFailed) // check XChainBridge parts expectSimpleRowText( diff --git a/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx b/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx index 686ee7640..44e12fd50 100644 --- a/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx @@ -1,13 +1,14 @@ +import { cleanup, screen } from '@testing-library/react' import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import { Simple } from '../Simple' import mockXChainClaim from './mock_data/XChainClaim.json' import mockXChainClaimNoQuorum from './mock_data/XChainClaimNoQuorum.json' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('XChainClaimSimple', () => { it('renders', () => { - const wrapper = createWrapper(mockXChainClaim) + renderComponent(mockXChainClaim) // check XChainBridge parts expectSimpleRowText( @@ -35,7 +36,7 @@ describe('XChainClaimSimple', () => { }) it('renders failed tx', () => { - const wrapper = createWrapper(mockXChainClaimNoQuorum) + renderComponent(mockXChainClaimNoQuorum) // check XChainBridge parts expectSimpleRowText( diff --git a/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx index d91d2c011..44bffd65b 100644 --- a/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx @@ -1,14 +1,15 @@ +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockXChainCommit from './mock_data/XChainCommit.json' import mockXChainCommitInsufficientFunds from './mock_data/XChainCommitInsufficientFunds.json' import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('XChainCommitSimple', () => { it('renders', () => { - const wrapper = createWrapper(mockXChainCommit) + renderComponent(mockXChainCommit) // check XChainBridge parts expectSimpleRowText( @@ -32,7 +33,7 @@ describe('XChainCommitSimple', () => { }) it('renders failed tx', () => { - const wrapper = createWrapper(mockXChainCommitInsufficientFunds) + renderComponent(mockXChainCommitInsufficientFunds) // check XChainBridge parts expectSimpleRowText( diff --git a/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx index f4b57dbab..47e16d882 100644 --- a/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx @@ -1,14 +1,15 @@ +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockXChainCreateBridge from './mock_data/XChainCreateBridge.json' import mockXChainCreateBridgeFailed from './mock_data/XChainCreateBridgeFailed.json' import mockXChainCreateBridgeIOU from './mock_data/XChainCreateBridgeIOU.json' import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('XChainCreateBridgeSimple', () => { it('renders', () => { - const wrapper = createWrapper(mockXChainCreateBridge) + renderComponent(mockXChainCreateBridge) // check XChainBridge parts expectSimpleRowText( @@ -33,7 +34,7 @@ describe('XChainCreateBridgeSimple', () => { }) it('renders IOU bridge', () => { - const wrapper = createWrapper(mockXChainCreateBridgeIOU) + renderComponent(mockXChainCreateBridgeIOU) // check XChainBridge parts expectSimpleRowText( @@ -64,7 +65,7 @@ describe('XChainCreateBridgeSimple', () => { }) it('renders failed tx', () => { - const wrapper = createWrapper(mockXChainCreateBridgeFailed) + renderComponent(mockXChainCreateBridgeFailed) // check XChainBridge parts expectSimpleRowText( diff --git a/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx index 480d48b6c..95b08a5a1 100644 --- a/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx @@ -1,13 +1,14 @@ +import { cleanup, screen } from '@testing-library/react' import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import { Simple } from '../Simple' import mockXChainCreateClaimID from './mock_data/XChainCreateClaimID.json' import mockXChainCreateClaimIDFailed from './mock_data/XChainCreateClaimIDFailed.json' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('XChainCreateClaimIDSimple', () => { it('renders', () => { - const wrapper = createWrapper(mockXChainCreateClaimID) + renderComponent(mockXChainCreateClaimID) // check XChainBridge parts expectSimpleRowText( @@ -35,7 +36,7 @@ describe('XChainCreateClaimIDSimple', () => { }) it('renders failed transaction', () => { - const wrapper = createWrapper(mockXChainCreateClaimIDFailed) + renderComponent(mockXChainCreateClaimIDFailed) // check XChainBridge parts expectSimpleRowText( diff --git a/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx b/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx index c90c6f40f..5986d11e5 100644 --- a/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx @@ -1,14 +1,15 @@ +import { cleanup, screen } from '@testing-library/react' import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import { Simple } from '../Simple' import mockXChainModifyBridge from './mock_data/XChainModifyBridge.json' import mockXChainModifyBridgeMinAccountCreateAmount from './mock_data/XChainModifyBridgeMinAccountCreateAmount.json' import mockXChainModifyBridgeNoEntry from './mock_data/XChainModifyBridgeNoEntry.json' -const createWrapper = createSimpleRenderFactory(Simple) +const renderComponent = createSimpleRenderFactory(Simple) describe('XChainModifyBridgeSimple', () => { it('renders', () => { - const wrapper = createWrapper(mockXChainModifyBridge) + renderComponent(mockXChainModifyBridge) // check XChainBridge parts expectSimpleRowText( @@ -30,7 +31,7 @@ describe('XChainModifyBridgeSimple', () => { }) it('renders MinAccountCreateAmount', () => { - const wrapper = createWrapper(mockXChainModifyBridgeMinAccountCreateAmount) + renderComponent(mockXChainModifyBridgeMinAccountCreateAmount) // check XChainBridge parts expectSimpleRowText( @@ -56,7 +57,7 @@ describe('XChainModifyBridgeSimple', () => { }) it('renders failed transaction', () => { - const wrapper = createWrapper(mockXChainModifyBridgeNoEntry) + renderComponent(mockXChainModifyBridgeNoEntry) // check XChainBridge parts expectSimpleRowText( diff --git a/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx b/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx index fe8278577..e7500ac16 100644 --- a/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx +++ b/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx @@ -16,7 +16,7 @@ function createWrapper(tx: { tx: any; meta: any }) { describe('DefaultSimple', () => { it('renders Simple for basic transaction', () => { - const wrapper = createWrapper(NewEscrowCreate) + renderComponent(NewEscrowCreate) expectSimpleRowText( wrapper, 'Destination', @@ -29,7 +29,7 @@ describe('DefaultSimple', () => { }) it('renders Simple for more complex transaction', () => { - const wrapper = createWrapper(SetHook) + renderComponent(SetHook) expect(wrapper.find(`[data-testid="group"]`).length).toEqual(10) expect(wrapper.find(`[data-testid="CreateCode"]`).length).toEqual(10) expect(wrapper.find(`[data-testid="Flags"]`).length).toEqual(10) @@ -60,7 +60,7 @@ describe('DefaultSimple', () => { }) it('renders Simple for more complex transaction', () => { - const wrapper = createWrapper(SetHook2) + renderComponent(SetHook2) expect(wrapper.find(`[data-testid="group"]`).length).toEqual(1) expect(wrapper.find(`[data-testid="CreateCode"]`).length).toEqual(1) expect(wrapper.find(`[data-testid="Flags"]`).length).toEqual(1) @@ -102,7 +102,7 @@ describe('DefaultSimple', () => { }) it('renders Simple for amount', () => { - const wrapper = createWrapper(TokenSwapPropose) + renderComponent(TokenSwapPropose) expectSimpleRowText( wrapper, 'AccountOther', From e9f47fe4fa66e0472baaffd16526c5a15cba340e Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 9 May 2024 10:33:26 -0400 Subject: [PATCH 05/55] more cleanup --- .../Transaction/AMMBid/test/AMMBid.test.tsx | 1 - .../AMMCreate/test/AMMCreate.test.tsx | 1 - .../test/AMMDeleteDescription.test.tsx | 2 -- .../AMMDelete/test/AMMDeleteSimple.test.tsx | 2 +- .../test/AMMDeleteTableDetail.test.tsx | 1 - .../AMMDeposit/test/AMMDeposit.test.tsx | 6 ------ .../Transaction/AMMVote/test/AMMVote.test.tsx | 1 - .../AMMWithdraw/test/AMMWithdraw.test.tsx | 4 ---- .../test/AccountDeleteSimple.test.tsx | 3 +-- .../test/AccountSetDescription.test.tsx | 8 ------- .../AccountSet/test/AccountSetSimple.test.tsx | 8 +------ .../test/AccountSetTableDetail.test.tsx | 8 ------- .../test/ClawbackDescription.test.tsx | 1 - .../Clawback/test/ClawbackSimple.test.tsx | 2 -- .../test/ClawbackTableDetail.test.tsx | 1 - .../DIDSet/test/DIDSetTableDetail.test.tsx | 1 - .../DepositPreauth/Description.tsx | 4 ++-- .../test/DepositPreauthDescription.test.tsx | 21 ++++++++++++------- .../test/DepositPreauthSimple.test.tsx | 16 ++++++++------ .../test/EnableAmendmentSimple.test.tsx | 6 ------ .../test/EscrowCancelDescription.test.tsx | 1 - .../test/EscrowCancelSimple.test.tsx | 2 +- .../test/EscrowCancelTableDetail.test.tsx | 1 - .../test/EscrowCreateDescription.test.tsx | 1 - .../test/EscrowCreateSimple.test.tsx | 2 +- .../test/EscrowCreateTableDetail.test.tsx | 2 -- .../test/EscrowFinishDescription.test.tsx | 1 - .../test/EscrowFinishSimple.test.tsx | 2 +- .../test/EscrowFinishTableDetail.test.tsx | 1 - .../test/NFTokenAcceptOfferSimple.test.tsx | 5 +---- .../test/NFTokenBurnSimple.test.tsx | 2 -- .../test/NFTokenCancelOfferSimple.test.tsx | 1 - .../test/NFTokenCreateOfferSimple.test.tsx | 4 ---- .../test/NFTokenMintSimple.test.tsx | 7 ------- .../test/OfferCreateDescription.test.tsx | 2 -- .../test/OfferCreateSimple.test.tsx | 2 +- .../test/OfferCreateTableDetail.test.tsx | 1 - .../Payment/test/PaymentDescription.test.tsx | 11 ---------- .../Payment/test/PaymentSimple.test.tsx | 12 ----------- .../Payment/test/PaymentTableDetail.test.tsx | 12 ----------- .../PaymentChannelClaimDescription.test.tsx | 5 +---- .../test/PaymentChannelClaimSimple.test.tsx | 5 +---- .../PaymentChannelClaimTableDetail.test.tsx | 5 +---- .../PaymentChannelCreateDescription.test.tsx | 3 --- .../test/PaymentChannelCreateSimple.test.tsx | 3 --- .../PaymentChannelCreateTableDetail.test.tsx | 3 --- .../PaymentChannelFundDescription.test.tsx | 3 +-- .../test/PaymentChannelFundSimple.test.tsx | 3 +-- .../SetFee/test/SetFeeDescription.test.tsx | 2 -- .../SetFee/test/SetFeeSimple.test.tsx | 2 -- .../SetHook/test/SetHookSimple.test.tsx | 1 + .../test/SetRegularKeyDescription.test.tsx | 2 -- .../test/SetRegularKeySimple.test.tsx | 3 +-- .../test/SetRegularKeyTableDetail.test.tsx | 2 -- .../test/SignerListSetDescription.test.tsx | 1 - .../test/SignerListSetSimple.test.tsx | 3 +-- .../test/SignerListSetTableDetail.test.tsx | 2 -- .../test/TicketCreateSimple.test.tsx | 1 - .../test/TicketCreateTableDetail.test.tsx | 1 - .../test/TrustSetDescription.test.tsx | 1 - .../TrustSet/test/TrustSetSimple.test.tsx | 2 +- .../test/TrustSetTableDetail.test.tsx | 1 - .../UNLModify/test/UNLModifySimple.test.tsx | 4 ---- .../XChainAccountCreateCommitSimple.test.tsx | 1 + ...AddAccountCreateAttestationSimple.test.tsx | 1 + .../XChainAddClaimAttestationSimple.test.tsx | 1 + .../Transaction/test/DefaultSimple.test.tsx | 6 ------ 67 files changed, 45 insertions(+), 191 deletions(-) diff --git a/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx b/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx index 4f414c679..08cfee2b6 100644 --- a/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx +++ b/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx @@ -28,6 +28,5 @@ describe('AMM Bid Tests', () => { 'auth_accounts', 'ra8uHq2Qme5j19TqvPzTE2nqT12Zc3xJmKrU6o2YguZi847RaiH2QGTkL4eZWZjbxZvk', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx b/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx index 4011b5669..c63923570 100644 --- a/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx +++ b/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx @@ -20,6 +20,5 @@ describe('AMM Create Tests', () => { 'account_id', 'rMEdVzU8mtEArzjrN9avm3kA675GX7ez8W', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx index c20733088..f520abffa 100644 --- a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx @@ -18,7 +18,5 @@ describe('AMMDelete: Description', () => { 'href', '/token/FOO.rm5c42Crqpdch5fbuCdHmSMV1wrL9arV9', ) - - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteSimple.test.tsx b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteSimple.test.tsx index c0780dc7d..a7cd86e27 100644 --- a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteSimple.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteSimple.test.tsx @@ -3,6 +3,7 @@ import i18n from '../../../../../../i18n/testConfigEnglish' import { expectSimpleRowText } from '../../test' import { createSimpleRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockAMMDelete from './mock_data/AMMDelete.json' @@ -18,6 +19,5 @@ describe('AMMDelete: Simple', () => { 'asset2', 'FOO.rm5c42Crqpdch5fbuCdHmSMV1wrL9arV9', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx index 10fe0d598..ffda46118 100644 --- a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx @@ -17,6 +17,5 @@ describe('AMMDelete: TableDetail', () => { expect(wrapper.find('[data-testid="asset2"]')).toHaveText( 'Asset 2FOO.rm5c42Crqpdch5fbuCdHmSMV1wrL9arV9', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx b/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx index 410adfb7f..53cd17206 100644 --- a/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx @@ -28,7 +28,6 @@ describe('AMM Deposit Tests', () => { 'account_id', 'rMEdVzU8mtEArzjrN9avm3kA675GX7ez8W', ) - wrapper.unmount() }) it('renders only with USD', () => { @@ -44,7 +43,6 @@ describe('AMM Deposit Tests', () => { 'account_id', 'rMEdVzU8mtEArzjrN9avm3kA675GX7ez8W', ) - wrapper.unmount() }) it('renders only with XRP', () => { @@ -55,7 +53,6 @@ describe('AMM Deposit Tests', () => { 'account_id', 'rMEdVzU8mtEArzjrN9avm3kA675GX7ez8W', ) - wrapper.unmount() }) it('renders with eprice', () => { @@ -76,7 +73,6 @@ describe('AMM Deposit Tests', () => { 'account_id', 'rHrzrzVHSyunKzW3JLgSaLcsxfwVLPVV97', ) - wrapper.unmount() }) it('renders with both assets non XRP', () => { @@ -96,7 +92,6 @@ describe('AMM Deposit Tests', () => { 'account_id', 'rEJ1X5BoSmHqa5h6TSVvYrHAzFmyxGqNic', ) - wrapper.unmount() }) it('deposit shouldnt crash with tx that changes fee', () => { @@ -104,6 +99,5 @@ describe('AMM Deposit Tests', () => { expectSimpleRowNotToExist(wrapper, 'asset1') expectSimpleRowNotToExist(wrapper, 'asset2') expectSimpleRowNotToExist(wrapper, 'account_id') - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx b/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx index 12961c2fd..495458d17 100644 --- a/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx +++ b/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx @@ -14,6 +14,5 @@ describe('AMM Vote Tests', () => { 'account_id', 'rMEdVzU8mtEArzjrN9avm3kA675GX7ez8W', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx b/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx index edf854131..f3c9278c6 100644 --- a/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx +++ b/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx @@ -26,7 +26,6 @@ describe('AMM Withdraw Tests', () => { 'account_id', 'rMEdVzU8mtEArzjrN9avm3kA675GX7ez8W', ) - wrapper.unmount() }) it('renders transaction from usd only', () => { @@ -42,7 +41,6 @@ describe('AMM Withdraw Tests', () => { 'account_id', 'rHrzrzVHSyunKzW3JLgSaLcsxfwVLPVV97', ) - wrapper.unmount() }) it('renders transaction from XRP only', () => { renderComponent(withdrawXRPMock) @@ -53,7 +51,6 @@ describe('AMM Withdraw Tests', () => { 'account_id', 'rHrzrzVHSyunKzW3JLgSaLcsxfwVLPVV97', ) - wrapper.unmount() }) it('renders transaction from eprice', () => { @@ -69,6 +66,5 @@ describe('AMM Withdraw Tests', () => { 'account_id', 'rHrzrzVHSyunKzW3JLgSaLcsxfwVLPVV97', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx b/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx index 902db0123..372d315c9 100644 --- a/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx +++ b/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx @@ -1,6 +1,7 @@ import i18n from '../../../../../../i18n/testConfigEnglish' import { createSimpleRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockAccountDelete from './mock_data/AccountDelete.json' import mockAccountDeleteWithDestinationTag from './mock_data/AccountDeleteWithDestinationTag.json' @@ -15,7 +16,6 @@ describe('AccountDelete: Simple', () => { expect(wrapper.find('.value')).toHaveText( 'raT74sdzpxJUaubcBAQNS8aLqFMU85Rr5J', ) - wrapper.unmount() }) it('renders with destination tag', () => { @@ -24,6 +24,5 @@ describe('AccountDelete: Simple', () => { expect(wrapper.find('.value')).toHaveText( 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn:123123', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx index e339cf617..99bb2f00a 100644 --- a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx @@ -16,7 +16,6 @@ describe('AccountSet: Description', () => { it('renders tx that sets the domain', () => { renderComponent(mockAccountSetWithDomain) expect(wrapper).toHaveText('It sets the account domain as mduo13.com') - wrapper.unmount() }) it('renders tx that sets the email hash', () => { @@ -31,19 +30,16 @@ describe('AccountSet: Description', () => { expect(wrapper).toHaveText( 'It sets the account email hash as 7AC3878BF42A5329698F468A6AAA03B9', ) - wrapper.unmount() }) it('renders tx that clears a flag', () => { renderComponent(mockAccountSetWithClearFlag) expect(wrapper).toHaveText('It clears the account flag asfGlobalFreeze') - wrapper.unmount() }) it('renders tx that sets a flag', () => { renderComponent(mockAccountSetWithSetFlag) expect(wrapper).toHaveText('It sets the account flag asfRequireDest') - wrapper.unmount() }) it('renders tx that clears a flag that is not defined', () => { @@ -52,7 +48,6 @@ describe('AccountSet: Description', () => { tx: { ...mockAccountSetWithClearFlag.tx, ClearFlag: 45 }, }) expect(wrapper).toHaveText('It clears the account flag 45') - wrapper.unmount() }) it('renders tx that sets a flag that is not defined', () => { @@ -61,7 +56,6 @@ describe('AccountSet: Description', () => { tx: { ...mockAccountSetWithSetFlag.tx, SetFlag: 45 }, }) expect(wrapper).toHaveText('It sets the account flag 45') - wrapper.unmount() }) it('renders tx that sets a message', () => { @@ -69,7 +63,6 @@ describe('AccountSet: Description', () => { expect(wrapper.find('[data-testid="message-key"]')).toHaveText( 'It sets the account message key as 020000000000000000000000000941C216565D33C8A8ACD1A33C359E84D652D1DA', ) - wrapper.unmount() }) it('renders tx that sets a minter', () => { @@ -77,6 +70,5 @@ describe('AccountSet: Description', () => { expect(wrapper.find('[data-testid="minter"]')).toHaveText( 'It sets rXMART8usFd5kABXCayoP6ZfB35b4v43t as the authorized minter for this account', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetSimple.test.tsx b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetSimple.test.tsx index e680b8c04..84f9d81f2 100644 --- a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetSimple.test.tsx @@ -2,6 +2,7 @@ import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createSimpleRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockAccountSetWithDomain from './mock_data/AccountSetWithDomain.json' import mockAccountSetWithClearFlag from './mock_data/AccountSetWithClearFlag.json' @@ -18,7 +19,6 @@ describe('AccountSet: Simple', () => { renderComponent(mockAccountSetWithDomain) expectSimpleRowLabel(wrapper, 'domain', 'domain') expectSimpleRowText(wrapper, 'domain', 'mduo13.com') - wrapper.unmount() }) it('renders tx that sets the email hash', () => { @@ -39,14 +39,12 @@ describe('AccountSet: Simple', () => { renderComponent(mockAccountSetWithClearFlag) expectSimpleRowLabel(wrapper, 'clear-flag', 'clear flag') expectSimpleRowText(wrapper, 'clear-flag', 'asfGlobalFreeze') - wrapper.unmount() }) it('renders tx that sets a flag', () => { renderComponent(mockAccountSetWithSetFlag) expectSimpleRowLabel(wrapper, 'set-flag', 'set flag') expectSimpleRowText(wrapper, 'set-flag', 'asfRequireDest') - wrapper.unmount() }) it('renders tx that clears a flag without a defined flag', () => { @@ -56,7 +54,6 @@ describe('AccountSet: Simple', () => { }) expectSimpleRowLabel(wrapper, 'clear-flag', 'clear flag') expectSimpleRowText(wrapper, 'clear-flag', '45') - wrapper.unmount() }) it('renders tx that sets a flag without a defined flag', () => { @@ -66,7 +63,6 @@ describe('AccountSet: Simple', () => { }) expectSimpleRowLabel(wrapper, 'set-flag', 'set flag') expectSimpleRowText(wrapper, 'set-flag', '45') - wrapper.unmount() }) it('renders tx that sets a message', () => { @@ -77,13 +73,11 @@ describe('AccountSet: Simple', () => { 'message', '020000000000000000000000000941C216565D33C8A8ACD1A33C359E84D652D1DA', ) - wrapper.unmount() }) it('renders tx that sets a minter', () => { renderComponent(mockAccountSetWithNFTokenMinter) expectSimpleRowLabel(wrapper, 'minter', 'NFT Minter') expectSimpleRowText(wrapper, 'minter', 'rXMART8usFd5kABXCayoP6ZfB35b4v43t') - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx index a74097edd..ae7d41457 100644 --- a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx @@ -16,7 +16,6 @@ describe('AccountSet: TableDetail', () => { it('renders tx that sets the domain', () => { renderComponent(mockAccountSetWithDomain) expect(wrapper).toHaveText('domain: mduo13.com') - wrapper.unmount() }) it('renders tx that sets the email hash', () => { @@ -29,19 +28,16 @@ describe('AccountSet: TableDetail', () => { }, }) expect(wrapper).toHaveText('email hash: 7AC3878BF42A5329698F468A6AAA03B9') - wrapper.unmount() }) it('renders tx that clears a flag', () => { renderComponent(mockAccountSetWithClearFlag) expect(wrapper).toHaveText('clear flag: asfGlobalFreeze') - wrapper.unmount() }) it('renders tx that sets a flag', () => { renderComponent(mockAccountSetWithSetFlag) expect(wrapper).toHaveText('set flag: asfRequireDest') - wrapper.unmount() }) it('renders tx that clears a flag that is not defined', () => { @@ -50,7 +46,6 @@ describe('AccountSet: TableDetail', () => { tx: { ...mockAccountSetWithClearFlag.tx, ClearFlag: 45 }, }) expect(wrapper).toHaveText('clear flag: 45') - wrapper.unmount() }) it('renders tx that sets a flag that is not defined', () => { @@ -59,7 +54,6 @@ describe('AccountSet: TableDetail', () => { tx: { ...mockAccountSetWithSetFlag.tx, SetFlag: 45 }, }) expect(wrapper).toHaveText('set flag: 45') - wrapper.unmount() }) it('renders tx that sets a message', () => { @@ -67,7 +61,6 @@ describe('AccountSet: TableDetail', () => { expect(wrapper).toHaveText( 'message key: 020000000000000000000000000941C216565D33C8A8ACD1A33C359E84D652D1DA', ) - wrapper.unmount() }) it('renders tx that sets a minter', () => { @@ -75,6 +68,5 @@ describe('AccountSet: TableDetail', () => { expect(wrapper.find('[data-testid="minter"]')).toHaveText( 'NFT Minter: rXMART8usFd5kABXCayoP6ZfB35b4v43t', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx b/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx index 1760519d6..5c5548c7f 100644 --- a/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx +++ b/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx @@ -15,6 +15,5 @@ describe('Clawback', () => { expect(wrapper.find('[data-testid="amount-line"]')).toHaveText( `The max clawback amount is 4,840.00 FOO.rDZ713igKfedN4hhY6SjQse4Mv3ZrBxnn9`, ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx b/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx index e98dd1dae..e04ebc1f7 100644 --- a/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx +++ b/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx @@ -23,7 +23,6 @@ describe('Clawback', () => { 'amount', '3,840.00 FOO.rDZ713igKfedN4hhY6SjQse4Mv3ZrBxnn9', ) - wrapper.unmount() }) it('handles MPT Clawback simple view ', () => { @@ -54,7 +53,6 @@ describe('Clawback', () => { 'amount', '4,840.00 FOO.rscBWQpyZEmQvupeB1quu7Ky8YX4f5CHDP', ) - wrapper.unmount() }) it('handles failed MPT Clawback simple view ', () => { diff --git a/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx b/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx index a13d9b537..fabcff15a 100644 --- a/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx @@ -11,6 +11,5 @@ describe('Clawback', () => { expect(wrapper.find('.clawback')).toHaveText( `claws_back3,840.00 FOO.rDZ713igKfedN4hhY6SjQse4Mv3ZrBxnn9fromrscBWQpyZEmQvupeB1quu7Ky8YX4f5CHDP`, ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx index b2fb3aec9..d9d29b93b 100644 --- a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx @@ -11,6 +11,5 @@ describe('DIDSet: TableDetail', () => { renderComponent(DIDSet) // eslint-disable-next-line no-useless-concat -- easier to read this way expect(wrapper).toHaveText('uri: did_example' + 'did_document: doc') - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/DepositPreauth/Description.tsx b/src/containers/shared/components/Transaction/DepositPreauth/Description.tsx index e722ba14c..46229795a 100644 --- a/src/containers/shared/components/Transaction/DepositPreauth/Description.tsx +++ b/src/containers/shared/components/Transaction/DepositPreauth/Description.tsx @@ -8,7 +8,7 @@ export const Description = ({ }: TransactionDescriptionProps) => { const { tx } = data return tx.Authorize ? ( -
+
It Authorizes @@ -16,7 +16,7 @@ export const Description = ({
) : ( -
+
It removes the authorization for diff --git a/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthDescription.test.tsx b/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthDescription.test.tsx index 3040c4998..e57d0b23f 100644 --- a/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthDescription.test.tsx +++ b/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthDescription.test.tsx @@ -1,7 +1,7 @@ import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' -import mockDepositPreaut from './mock_data/DepositPreauth.json' +import mockDepositPreauth from './mock_data/DepositPreauth.json' import mockDepositPreauthUnauthorize from './mock_data/DepositPreauthUnauthorize.json' import { Description } from '../Description' @@ -12,18 +12,23 @@ const renderComponent = createDescriptionRenderFactory(Description, i18n) describe('DepositPreauth: Description', () => { afterEach(cleanup) it('renders description for authorize', () => { - renderComponent(mockDepositPreaut) - expect(wrapper.html()).toBe( - `
It authorizes to send payments to this account
`, + renderComponent(mockDepositPreauth) + expect(screen.getByTestId('deposit-auth')).toHaveTextContent( + 'It authorizes rDJFnv5sEfp42LMFiX3mVQKczpFTdxYDzM to send payments to this account', ) - wrapper.unmount() + expect( + screen.getByText('rDJFnv5sEfp42LMFiX3mVQKczpFTdxYDzM'), + ).toHaveAttribute('href') }) it('renders description for unauthorize', () => { renderComponent(mockDepositPreauthUnauthorize) - expect(wrapper.html()).toBe( - `
It removes the authorization for to send payments to this account
`, + + expect(screen.getByTestId('deposit-unauth')).toHaveTextContent( + 'It removes the authorization for rDJFnv5sEfp42LMFiX3mVQKczpFTdxYDzM to send payments to this account', ) - wrapper.unmount() + expect( + screen.getByText('rDJFnv5sEfp42LMFiX3mVQKczpFTdxYDzM'), + ).toHaveAttribute('href') }) }) diff --git a/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthSimple.test.tsx b/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthSimple.test.tsx index 9f9e9bf6a..e297636c2 100644 --- a/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthSimple.test.tsx +++ b/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthSimple.test.tsx @@ -1,9 +1,11 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockDepositPreauth from './mock_data/DepositPreauth.json' import mockDepositPreauthUnauthorize from './mock_data/DepositPreauthUnauthorize.json' +import { expectSimpleRowLabel, expectSimpleRowText } from '../../test' const renderComponent = createSimpleRenderFactory(Simple, i18n) @@ -11,19 +13,21 @@ describe('DepositPreauth: Simple', () => { afterEach(cleanup) it('renders authorized', () => { renderComponent(mockDepositPreauth) - expect(wrapper.find('.label')).toHaveText('authorize') - expect(wrapper.find('.value')).toHaveText( + expectSimpleRowLabel(screen, 'authorize', 'authorize') + expectSimpleRowText( + screen, + 'authorize', 'rDJFnv5sEfp42LMFiX3mVQKczpFTdxYDzM', ) - wrapper.unmount() }) it('renders unauthorized', () => { renderComponent(mockDepositPreauthUnauthorize) - expect(wrapper.find('.label')).toHaveText('unauthorize') - expect(wrapper.find('.value')).toHaveText( + expectSimpleRowLabel(screen, 'unauthorize', 'unauthorize') + expectSimpleRowText( + screen, + 'unauthorize', 'rDJFnv5sEfp42LMFiX3mVQKczpFTdxYDzM', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx b/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx index c9e38e5fb..7ae0495b5 100644 --- a/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx @@ -67,8 +67,6 @@ describe('EnableAmendment: Simple', () => { expectSimpleRowText(wrapper, 'name', 'ExpandedSignerList') expectSimpleRowText(wrapper, 'version', 'v1.9.1') - - wrapper.unmount() }) it('renders tx that causes an amendment to gain majority', async () => { @@ -95,8 +93,6 @@ describe('EnableAmendment: Simple', () => { 'href', '/amendment/B2A4DB846F0891BF2C76AB2F2ACC8F5B4EC64437135C6E56F3F859DE5FFD5856', ) - - wrapper.unmount() }) it('renders tx that enables an amendment', async () => { @@ -117,8 +113,6 @@ describe('EnableAmendment: Simple', () => { expectSimpleRowText(wrapper, 'name', 'NegativeUNL') expectSimpleRowText(wrapper, 'version', 'v1.7.3') - - wrapper.unmount() }) it('renders tx that cannot determine version or name', async () => { diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx index d5a3b4d50..818b47451 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx @@ -11,6 +11,5 @@ describe('EscrowCancelDescription', () => { expect(wrapper.html()).toBe( '
escrow_cancellation_desc
The escrowed amount of\uE900135.79XRPwas returned to (\uE900135.78999XRP escrow_after_transaction_cost)
The escrow was created bywith transactionA979AD...', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx index ff42b8838..74713d3a3 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockEscrowCancel from './mock_data/EscrowCancel.json' @@ -16,6 +17,5 @@ describe('EscrowCancelSimple', () => { expect(wrapper.find('[data-testid="escrow-cancel-tx"] .value')).toHaveText( `A979AD5C6A6C844913DA51D71BF5F0B8E254D9A211FA837C4B322C4A8FD358E6`, ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx index dc7327a4a..3f803be91 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx @@ -15,6 +15,5 @@ describe('EscrowCancelTableDetail', () => { expect(wrapper).toHaveText( 'cancel escrow rpmqbo5FWoydTL2Ufh5YdtzmRjbeLyxt56 - 9', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx index 88f8f17bf..b4324b28e 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx @@ -11,6 +11,5 @@ describe('EscrowCreateDescription', () => { expect(wrapper.html()).toBe( 'The escrow is fromto
escrow_condition A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120
escrowed_amount \uE900997.50XRP
describe_cancel_after March 1, 2020 at 8:54:20 AM UTC
describe_finish_after March 1, 2020 at 9:01:00 AM UTC
', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx index d8f2d552b..1988d0d14 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx @@ -1,6 +1,7 @@ import { Simple } from '../Simple' import mockEscrowCreate from './mock_data/EscrowCreate.json' import { createSimpleRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' const renderComponent = createSimpleRenderFactory(Simple) @@ -16,6 +17,5 @@ describe('EscrowCreateSimple', () => { expect(wrapper.find('[data-testid="escrow-condition"] .value')).toHaveText( `A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120`, ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx index c663aef45..d939a89ff 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx @@ -21,7 +21,5 @@ describe('EscrowCreateTableDetail', () => { expect(wrapper.find('[data-testid="cancel_after"]')).toHaveText( `March 1, 2020 at 8:54:20 AM UTC`, ) - - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx index f4bcfffcc..f3fee9796 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx @@ -11,6 +11,5 @@ describe('EscrowFinishDescription', () => { expect(wrapper.html()).toBe( '
escrow_completion_desc
The escrowed amount of\uE9000.0154XRPwas delivered to (\uE9000.015388XRP escrow_after_transaction_cost)
The escrow was created bywith transaction3E2E75...
escrow_finish_fullfillment_desc Fulfillment
', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx index ca316075a..409bcc189 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx @@ -1,4 +1,5 @@ import { createSimpleRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockEscrowFinish from './mock_data/EscrowFinish.json' @@ -13,6 +14,5 @@ describe('EscrowFinishSimple', () => { expect(wrapper.find('[data-testid="escrow-tx"] .value')).toHaveText( `3E2E755FA75FF1020C39E2ECC407E9F1C0E49A7229EDD15FF93B9F869878F1CC`, ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx index b709cfe26..b6182475e 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx @@ -17,6 +17,5 @@ describe('EscrowFinishTableDetail', () => { expect(wrapper.find('[data-testid="escrow-fullfillment"]')).toHaveText( `fulfillment Fulfillment `, ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx index 3f3847b36..c350e9876 100644 --- a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx @@ -1,5 +1,6 @@ import { cleanup, screen } from '@testing-library/react' import { createSimpleRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import transactionBuy from './mock_data/NFTokenAcceptOffer_Buy.json' import transactionSell from './mock_data/NFTokenAcceptOffer_Sell.json' @@ -26,7 +27,6 @@ describe('NFTokenAcceptOffer', () => { expectSimpleRowText(wrapper, 'amount', '\uE9000.0001 XRP') expectSimpleRowText(wrapper, 'buyer', 'rfFRmXUR1yfxeUfXj7WwKhETrtToYx1hYh') expectSimpleRowText(wrapper, 'seller', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g') - wrapper.unmount() }) it('handles NFTokenAcceptOffer Sell simple view ', () => { @@ -44,7 +44,6 @@ describe('NFTokenAcceptOffer', () => { expectSimpleRowText(wrapper, 'amount', '\uE9000.000102 XRP') expectSimpleRowText(wrapper, 'buyer', 'rfFRmXUR1yfxeUfXj7WwKhETrtToYx1hYh') expectSimpleRowText(wrapper, 'seller', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g') - wrapper.unmount() }) it('handles NFTokenAcceptOffer Sell Failure simple view ', () => { @@ -59,7 +58,6 @@ describe('NFTokenAcceptOffer', () => { expectSimpleRowNotToExist(wrapper, 'amount') expectSimpleRowNotToExist(wrapper, 'buyer') expectSimpleRowNotToExist(wrapper, 'seller') - wrapper.unmount() }) it('handles NFTokenAcceptOffer from Broker simple view ', () => { @@ -73,6 +71,5 @@ describe('NFTokenAcceptOffer', () => { expectSimpleRowText(wrapper, 'amount', '\uE9002,500.00 XRP') expectSimpleRowText(wrapper, 'buyer', 'rNYKGnHrjSnKXQGgACciyCLg4xRcwWZixN') expectSimpleRowText(wrapper, 'seller', 'rnp9DA6H2tLH7YFkgpjoVREB2yccYv56Sg') - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx index 86b3089d8..e5268ed84 100644 --- a/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx @@ -19,7 +19,6 @@ describe('NFTokenBurn', () => { '000800006203F49C21D5D6E022CB16DE3538F248662FC73C29ABA6A90000000D', ) expectSimpleRowNotToExist(wrapper, 'owner') - wrapper.unmount() }) it('handles NFTokenBurn when the burner is not the owner', () => { @@ -30,6 +29,5 @@ describe('NFTokenBurn', () => { '00090000DF7682C6F61329B887798E2ABB518BF1C923F4010000099B00000000', ) expectSimpleRowText(wrapper, 'owner', 'rH3Jr1zwADrokm2niuJLEAD5NuoVwBvzpk') - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx index 5e9087e77..d8bebf33e 100644 --- a/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx @@ -33,6 +33,5 @@ describe('NFTokenCancelOffer', () => { expect(wrapper.find('[data-testid="offerer"] .value')).toHaveText( 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx index 73d290146..09b8559b0 100644 --- a/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx @@ -32,7 +32,6 @@ describe('NFTokenCreateOffer', () => { 'rfFRmXUR1yfxeUfXj7WwKhETrtToYx1hYh', ) expect(wrapper.find('[data-testid="destination"] .value')).not.toExist() - wrapper.unmount() }) it('handles NFTokenCreateOffer sell simple view ', () => { @@ -62,7 +61,6 @@ describe('NFTokenCreateOffer', () => { 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g', ) expect(wrapper.find('[data-testid="destination"] .value')).not.toExist() - wrapper.unmount() }) it('handles failed NFTokenCreateOffer transaction', () => { @@ -75,7 +73,6 @@ describe('NFTokenCreateOffer', () => { expect(wrapper.find('[data-testid="offer-id"] .value')).not.toExist() expect(wrapper.find('[data-testid="owner"] .value')).not.toExist() expectSimpleRowText(wrapper, 'amount', '\uE900500.00 XRP') - wrapper.unmount() }) it('handles NFTokenCreateOffer with destination', () => { @@ -85,6 +82,5 @@ describe('NFTokenCreateOffer', () => { 'destination', 'rpdUbED32X3YXRPBGzSv8gMTJE66t3sji9', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx index 9d1c35d61..0142dd54a 100644 --- a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx @@ -36,7 +36,6 @@ describe('NFTokenMint', () => { expectSimpleRowText(wrapper, 'token-uri', 'https://gregweisbrod.com') expectSimpleRowNotToExist(wrapper, 'token-fee') expectSimpleRowNotToExist(wrapper, 'token-issuer') - wrapper.unmount() }) it('handles NFTokenMint that modified 1 node and created 1 node', () => { @@ -61,7 +60,6 @@ describe('NFTokenMint', () => { expectSimpleRowText(wrapper, 'token-uri', 'https://gregweisbrod.com') expectSimpleRowNotToExist(wrapper, 'token-fee') expectSimpleRowNotToExist(wrapper, 'token-issuer') - wrapper.unmount() }) it('handles NFTokenMint that modified 2 nodes and created 1 node', () => { @@ -86,7 +84,6 @@ describe('NFTokenMint', () => { expectSimpleRowText(wrapper, 'token-uri', 'https://gregweisbrod.com') expectSimpleRowNotToExist(wrapper, 'token-fee') expectSimpleRowNotToExist(wrapper, 'token-issuer') - wrapper.unmount() }) it('handles NFTokenMint with issuer', () => { @@ -118,7 +115,6 @@ describe('NFTokenMint', () => { 'token-issuer', 'rGToUZ1JjRUdv1wXNXKMFn2o4wTM2DLkpg', ) - wrapper.unmount() }) it('handles NFTokenMint that modified 3 nodes', () => { @@ -147,7 +143,6 @@ describe('NFTokenMint', () => { '516D5071416B3677777577796A71654C476F64665253375156774677394346736A6D363375485661556438387463', ) as string, ) - wrapper.unmount() }) it('handles NFTokenMint that has null URI', () => { @@ -162,7 +157,6 @@ describe('NFTokenMint', () => { ) expectSimpleRowNotToExist(wrapper, 'token-uri') - wrapper.unmount() }) it('handles NFTokenMint that failed', () => { @@ -185,6 +179,5 @@ describe('NFTokenMint', () => { '516D5071416B3677777577796A71654C476F64665253375156774677394346736A6D363375485661556438387463', ) as string, ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx index 491162269..3e31893a5 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx @@ -14,7 +14,6 @@ describe('OfferCreate: Description', () => { expect(wrapper.html()).toBe( '
The accountoffered to pay1,080,661.95882CSCin order to receive\uE9001,764.293151XRP
offer_create_desc_line_2 612.52XRP/CSC
offer_create_desc_line_3 44866443
The offer expiresMay 18, 2022 at 5:28:16 PM UTCunless cancelled before', ) - wrapper.unmount() }) it('renders description for transaction with inverted currencies', () => { @@ -23,6 +22,5 @@ describe('OfferCreate: Description', () => { expect(wrapper.html()).toBe( '
The accountoffered to pay\uE90017,588.363594XRPin order to receive$6,101.33033905USD
offer_create_desc_line_2 0.34690XRP/USD
offer_create_desc_line_3 80543309
', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx index 45efedaf6..4ecadf54b 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx @@ -2,6 +2,7 @@ import { Simple } from '../Simple' import mockOfferCreateWithCancel from './mock_data/OfferCreateWithExpirationAndCancel.json' import mockOfferCreate from './mock_data/OfferCreate.json' import { createSimpleRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' const renderComponent = createSimpleRenderFactory(Simple) @@ -21,7 +22,6 @@ describe('OfferCreate: Simple', () => { expect(wrapper.find('[data-testid="amount-sell"] .value')).toHaveText( `1,080,661.95882 CSC.rCSCManTZ8ME9EoLrSHHYKW8PPwWMgkwr`, ) - wrapper.unmount() }) it('renders', () => { diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx index 248021fc2..03a47b6a3 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx @@ -24,7 +24,6 @@ describe('OfferCreate: TableDetail', () => { expect(wrapper.find('[data-testid="amount-sell"]')).toHaveText( `1,080,661.95882 CSC.rCSCManTZ8ME9EoLrSHHYKW8PPwWMgkwr`, ) - wrapper.unmount() }) it('renders', () => { diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx index 316cad5d0..f99864812 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx @@ -28,8 +28,6 @@ describe('Payment: Description', () => { expect(wrapper.find('[data-testid="delivered-line"]')).toHaveText( `The actual amount delivered was \uE9002,421.8268 XRP`, ) - - wrapper.unmount() }) it('renders with failed partial conversion', () => { @@ -44,8 +42,6 @@ describe('Payment: Description', () => { `It was instructed to deliver up to 1,140.00 YCN.r8HgVGenRTAiNSM5iqt9PX2D2EczFZhZr by spending up to \uE9001,140.00 XRP`, ) expect(wrapper.find('[data-testid="delivered-line"]')).not.toExist() - - wrapper.unmount() }) it('renders with destination tag', () => { @@ -64,8 +60,6 @@ describe('Payment: Description', () => { expect(wrapper.find('[data-testid="delivered-line"]')).toHaveText( `The actual amount delivered was \uE9001,531.267 XRP`, ) - - wrapper.unmount() }) it('renders with send max', () => { @@ -84,7 +78,6 @@ describe('Payment: Description', () => { expect(wrapper.find('[data-testid="delivered-line"]')).toHaveText( `The actual amount delivered was 17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA`, ) - wrapper.unmount() }) it('renders with partial', () => { @@ -103,8 +96,6 @@ describe('Payment: Description', () => { expect(wrapper.find('[data-testid="delivered-line"]')).toHaveText( `The actual amount delivered was 0.00104196 xCoin.rXCoYSUnkpygdtfpz3Df8dKQuRZjM9UFi`, ) - - wrapper.unmount() }) it('renders with SourceTag', () => { @@ -116,7 +107,5 @@ describe('Payment: Description', () => { expect(wrapper.find('[data-testid="destination-tag-line"]')).toHaveText( `The destination tag is 412453880`, ) - - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx index 7a3ffe879..061b3ed30 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx @@ -34,8 +34,6 @@ describe('Payment: Simple', () => { 'destination', `rHoPwMC75KVUhBMeV3uDMybKG5JND74teh`, ) - - wrapper.unmount() }) it('renders with failed partial conversion', () => { @@ -52,8 +50,6 @@ describe('Payment: Simple', () => { ) expect(wrapper.find('[data-testid="destination"]')).not.toExist() - - wrapper.unmount() }) it('renders with destination tag', () => { @@ -67,8 +63,6 @@ describe('Payment: Simple', () => { 'destination', `rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt:381702`, ) - - wrapper.unmount() }) it('renders with send max', () => { @@ -93,8 +87,6 @@ describe('Payment: Simple', () => { 'destination', `rprcTynT68nYdKzDTefAZG9HjSHiYcnP4b:0`, ) - - wrapper.unmount() }) it('renders with partial', () => { @@ -112,16 +104,12 @@ describe('Payment: Simple', () => { 'destination', `rMQ4oGC8fasuJwfdrfknFTttDbf8cR3D2j:0`, ) - - wrapper.unmount() }) it('renders with SourceTag', () => { renderComponent(mockPaymentSourceTag) expectSimpleRowText(wrapper, 'source-tag', `20648`) - - wrapper.unmount() }) it('renders direct MPT payment', () => { diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx index ae4348b89..3bd5fea65 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx @@ -19,8 +19,6 @@ describe('Payment: TableDetail', () => { expect(wrapper.find('.payment')).toHaveText( `send\uE9002,421.8268 XRPtorHoPwMC75KVUhBMeV3uDMybKG5JND74teh`, ) - - wrapper.unmount() }) it('renders with failed partial conversion', () => { @@ -30,8 +28,6 @@ describe('Payment: TableDetail', () => { expect(wrapper.find('.payment')).toHaveText( `convert_maximum1,140.00 XRPto0.00 YCN.r8HgVGenRTAiNSM5iqt9PX2D2EczFZhZrpartial_payment_allowed`, ) - - wrapper.unmount() }) it('renders with destination tag', () => { @@ -41,8 +37,6 @@ describe('Payment: TableDetail', () => { expect(wrapper.find('.payment')).toHaveText( `send1,531.267 XRPtorHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt:381702`, ) - - wrapper.unmount() }) it('renders with send max', () => { @@ -52,8 +46,6 @@ describe('Payment: TableDetail', () => { expect(wrapper.find('.payment')).toHaveText( `send17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjAtorprcTynT68nYdKzDTefAZG9HjSHiYcnP4b:0`, ) - - wrapper.unmount() }) it('renders with partial', () => { @@ -63,15 +55,11 @@ describe('Payment: TableDetail', () => { expect(wrapper.find('.payment')).toHaveText( `send0.00104196 xCoin.rXCoYSUnkpygdtfpz3Df8dKQuRZjM9UFitorMQ4oGC8fasuJwfdrfknFTttDbf8cR3D2j:0partial_payment_allowed`, ) - - wrapper.unmount() }) it('renders with SourceTag', () => { renderComponent(mockPaymentSourceTag) expect(wrapper.find('.st')).toHaveText('source_tag: 20648') - - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx index 5b0ab0f0e..4710094ad 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx @@ -1,6 +1,7 @@ import i18n from '../../../../../../i18n/testConfigEnglish' import { createDescriptionRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' import mockPaymentChannelClaim from './mock_data/PaymentChannelClaim.json' import mockPaymentChannelClaimClosed from './mock_data/PaymentChannelClaimClosed.json' import mockPaymentChannelClaimCloseDenied from './mock_data/PaymentChannelClaimCloseDenied.json' @@ -23,7 +24,6 @@ describe('PaymentChannelClaim: Description', () => { `The channel balance claimed is \uE90049.65716XRP (increased by \uE9000.01XRP)`, ) expect(wrapper.find('[data-testid="closed-line"]')).not.toExist() - wrapper.unmount() }) it('renders tx with channel being closed', () => { @@ -38,7 +38,6 @@ describe('PaymentChannelClaim: Description', () => { expect(wrapper.find('[data-testid="closed-line"]')).toHaveText( `The payment channel will be closed, any remaining balance will be returned to the source account`, ) - wrapper.unmount() }) it('renders tx requesting channel be closed but not closing it', () => { @@ -51,7 +50,6 @@ describe('PaymentChannelClaim: Description', () => { ) expect(wrapper.find('[data-testid="balance-line"]')).not.toExist() expect(wrapper.find('[data-testid="closed-line"]')).not.toExist() - wrapper.unmount() }) it('renders tx with destination tag', () => { @@ -66,6 +64,5 @@ describe('PaymentChannelClaim: Description', () => { `The channel balance claimed is \uE9001.00XRP (increased by \uE9001.00XRP)`, ) expect(wrapper.find('[data-testid="closed-line"]')).not.toExist() - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx index 4d339d5c4..de34f8581 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx @@ -2,6 +2,7 @@ import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createSimpleRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockPaymentChannelClaim from './mock_data/PaymentChannelClaim.json' import mockPaymentChannelClaimClosed from './mock_data/PaymentChannelClaimClosed.json' @@ -46,7 +47,6 @@ describe('PaymentChannelClaim: Simple', () => { expectSimpleRowNotToExist(wrapper, 'renew') expectSimpleRowNotToExist(wrapper, 'close-request') expectSimpleRowNotToExist(wrapper, 'closed') - wrapper.unmount() }) it('renders tx with channel being closed', () => { @@ -72,7 +72,6 @@ describe('PaymentChannelClaim: Simple', () => { expectSimpleRowNotToExist(wrapper, 'renew') expectSimpleRowText(wrapper, 'close-request', 'close channel request') expectSimpleRowText(wrapper, 'closed', 'payment channel closed') - wrapper.unmount() }) it('renders tx requesting channel be closed but not closing it', () => { @@ -98,7 +97,6 @@ describe('PaymentChannelClaim: Simple', () => { expectSimpleRowNotToExist(wrapper, 'renew') expectSimpleRowText(wrapper, 'close-request', 'close channel request') expectSimpleRowNotToExist(wrapper, 'closed') - wrapper.unmount() }) it('renders tx with destination tag', () => { @@ -120,6 +118,5 @@ describe('PaymentChannelClaim: Simple', () => { expectSimpleRowNotToExist(wrapper, 'renew') expectSimpleRowNotToExist(wrapper, 'close-request') expectSimpleRowNotToExist(wrapper, 'closed') - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx index 889216bac..1897fca58 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx @@ -1,6 +1,7 @@ import i18n from '../../../../../../i18n/testConfigEnglish' import { createTableDetailRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' import { TableDetail } from '../TableDetail' import mockPaymentChannelClaim from './mock_data/PaymentChannelClaim.json' import mockPaymentChannelClaimClosed from './mock_data/PaymentChannelClaimClosed.json' @@ -26,7 +27,6 @@ describe('PaymentChannelClaim: TableDetail', () => { expect(wrapper.find('[data-testid="renew"]')).not.toExist() expect(wrapper.find('[data-testid="close-request"]')).not.toExist() expect(wrapper.find('[data-testid="closed"]')).not.toExist() - wrapper.unmount() }) it('renders tx with channel being closed', () => { @@ -48,7 +48,6 @@ describe('PaymentChannelClaim: TableDetail', () => { expect(wrapper.find('[data-testid="closed"]')).toHaveText( 'payment channel closed', ) - wrapper.unmount() }) it('renders tx requesting channel be closed but not closing it', () => { @@ -68,7 +67,6 @@ describe('PaymentChannelClaim: TableDetail', () => { 'close channel request', ) expect(wrapper.find('[data-testid="closed"]')).not.toExist() - wrapper.unmount() }) it('renders tx with destination tag', () => { @@ -86,6 +84,5 @@ describe('PaymentChannelClaim: TableDetail', () => { expect(wrapper.find('[data-testid="renew"]')).not.toExist() expect(wrapper.find('[data-testid="close-request"]')).not.toExist() expect(wrapper.find('[data-testid="closed"]')).not.toExist() - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx index 4778ec989..a3c7bfcd6 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx @@ -26,7 +26,6 @@ describe('PaymentChannelCreate: Description', () => { `The channel has a settlement delay of 3,600 seconds`, ) expect(wrapper.find('[data-testid="cancel-line"]')).not.toExist() - wrapper.unmount() }) it('renders failed tx', () => { @@ -42,7 +41,6 @@ describe('PaymentChannelCreate: Description', () => { `The channel has a settlement delay of 3,600 seconds`, ) expect(wrapper.find('[data-testid="cancel-line"]')).not.toExist() - wrapper.unmount() }) it('renders tx with destination tag', () => { @@ -60,6 +58,5 @@ describe('PaymentChannelCreate: Description', () => { `The channel has a settlement delay of 86,400 seconds`, ) expect(wrapper.find('[data-testid="cancel-line"]')).not.toExist() - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx index fc0789b35..5594f06b2 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx @@ -40,7 +40,6 @@ describe('PaymentChannelCreate: Simple', () => { '.channel', '15AB9EE9344C42C05164E6A1F2F08B35F35D7B9D66CCB9697452B0995C8F8242', ) - wrapper.unmount() }) it('renders failed tx', () => { @@ -58,7 +57,6 @@ describe('PaymentChannelCreate: Simple', () => { ) expectSimpleRowText(wrapper, 'delay', '3,600 sec.') expectSimpleRowNotToExist(wrapper, '.channel') - wrapper.unmount() }) it('renders tx with destination tag', () => { @@ -76,6 +74,5 @@ describe('PaymentChannelCreate: Simple', () => { '.channel', '5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx index 015b1330b..146f1a700 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx @@ -20,7 +20,6 @@ describe('PaymentChannelCreate: TableDetail', () => { 'destinationrUXYat4hW2M87gHoqKK7fC4cqrT9C6V7d7', ) expect(wrapper.find('[data-testid="amount"]')).toHaveText('\uE9001.00 XRP') - wrapper.unmount() }) it('renders failed tx', () => { @@ -32,7 +31,6 @@ describe('PaymentChannelCreate: TableDetail', () => { 'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) expect(wrapper.find('[data-testid="amount"]')).toHaveText('\uE90010.00 XRP') - wrapper.unmount() }) it('renders tx with destination tag', () => { @@ -46,6 +44,5 @@ describe('PaymentChannelCreate: TableDetail', () => { expect(wrapper.find('[data-testid="amount"]')).toHaveText( '\uE900100.00 XRP', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx index 32bbaecbe..f904ec17d 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx @@ -1,6 +1,7 @@ import i18n from '../../../../../../i18n/testConfigEnglish' import { createDescriptionRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' import mockPaymentChannelFund from './mock_data/PaymentChannelFund.json' import mockPaymentChannelFundFailed from './mock_data/PaymentChannelFundFailed.json' import { Description } from '../Description' @@ -17,7 +18,6 @@ describe('PaymentChannelFund: Description', () => { expect(wrapper.find('[data-testid="amount-line"]')).toHaveText( `It will increase the channel amount by \uE9001.00 XRP from \uE90074.00 XRP to \uE90075.00 XRP`, ) - wrapper.unmount() }) it('renders failed tx', () => { @@ -28,6 +28,5 @@ describe('PaymentChannelFund: Description', () => { expect(wrapper.find('[data-testid="amount-line"]')).toHaveText( `It will increase the channel amount by \uE90020.00 XRP`, ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx index 43947ee55..6fd930256 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx @@ -2,6 +2,7 @@ import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createSimpleRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockPaymentChannelFund from './mock_data/PaymentChannelFund.json' import mockPaymentChannelFundFailed from './mock_data/PaymentChannelFundFailed.json' @@ -41,7 +42,6 @@ describe('PaymentChannelFund: Simple', () => { '.channel', '4BEAC9E4C10674AB698EAC0F2D78A4FF507428370578A59B04883E7EB8D82260', ) - wrapper.unmount() }) it('renders failed tx', () => { @@ -58,6 +58,5 @@ describe('PaymentChannelFund: Simple', () => { '.channel', '933F93F7113A2F94B7838D64D0D2A244C57EFD6411C16FFF5FA293D200EF5876', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx b/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx index 16887a098..f25fd1e08 100644 --- a/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx @@ -28,12 +28,10 @@ describe('SetFee: Description', () => { it('renders Description for transaction before XRPFees amendment', () => { renderComponent(SetFeePreAmendment) testDescription(wrapper) - wrapper.unmount() }) it('renders Description for transaction after XRPFees amendment', () => { renderComponent(SetFeePostAmendment) testDescription(wrapper) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx b/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx index 9dd7a28f3..fda8587d3 100644 --- a/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx @@ -26,12 +26,10 @@ describe('SetFee: Simple', () => { it('renders Simple for transaction before XRPFees amendment', () => { renderComponent(SetFeePreAmendment) testSimple(wrapper) - wrapper.unmount() }) it('renders Simple for transaction after XRPFees amendment', () => { renderComponent(SetFeePostAmendment) testSimple(wrapper) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx b/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx index 7e9662982..f09919332 100644 --- a/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx @@ -1,4 +1,5 @@ import { createSimpleRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockSetHook from './mock_data/SetHook.json' import mockSetHook2 from './mock_data/SetHook2.json' diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx index 30ce5cde4..aee9294a1 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx @@ -14,13 +14,11 @@ describe('SetRegularKey: Description', () => { expect(wrapper.html()).toBe( `
set_regular_key_description rULyyLRoZ47P33Vapew67VoiRqPrZ2ejbp
`, ) - wrapper.unmount() }) it('renders description for transaction that unsets key', () => { renderComponent(SetRegularKeyUnset) expect(wrapper.html()).toBe(`
unset_regular_key_description
`) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx index 0c7f4b342..f7e8b3cd0 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import SetRegularKey from './mock_data/SetRegularKey.json' import SetRegularKeyUnset from './mock_data/SetRegularKeyUnsetKey.json' import { Simple } from '../Simple' @@ -16,7 +17,6 @@ describe('SetRegularKey: Simple', () => { expect(keyRow.find('.value').text()).toBe( `rULyyLRoZ47P33Vapew67VoiRqPrZ2ejbp`, ) - wrapper.unmount() }) it('renders Simple for transaction that unsets key', () => { @@ -25,6 +25,5 @@ describe('SetRegularKey: Simple', () => { expect(keyRow.prop('label')).toBe('') expect(keyRow.find('.unset').hostNodes().text()).toBe(`unset_regular_key`) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx index a78dc9926..035ed6875 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx @@ -15,7 +15,6 @@ describe('SetRegularKeyTable: Detail', () => { expect(wrapper.find('.key').text()).toBe( `rULyyLRoZ47P33Vapew67VoiRqPrZ2ejbp`, ) - wrapper.unmount() }) it('renders Simple for transaction that unsets key', () => { @@ -23,6 +22,5 @@ describe('SetRegularKeyTable: Detail', () => { expect(wrapper.find('.unset')).toExist() expect(wrapper.text()).toBe(`unset_regular_key`) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx index b1d07b4b1..a96277dc6 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx @@ -30,6 +30,5 @@ describe('SignerListSet: Description', () => { it('renders when signer list is cleared', () => { renderComponent(mockSignerListSetClear) expect(wrapper).toHaveText('unset_signer_list_description') - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx index 869089210..40903b129 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx @@ -1,3 +1,4 @@ +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockSignerListSetClear from './mock_data/SignerListSetClear.json' import mockSignerListSet from './mock_data/SignerListSet.json' @@ -25,12 +26,10 @@ describe('SignerListSet: Simple', () => { expect(signers.at(2)).toHaveText( 'rL6SsrxyVp1JLNEZsX1hFWHcP2iJcZJ2dy weight: 1', ) - wrapper.unmount() }) it('renders when signer list is cleared', () => { renderComponent(mockSignerListSetClear) expect(wrapper.find(SimpleRow)).toHaveText('unset_signer_list') - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx index 8fb4246ba..4241675fd 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx @@ -12,12 +12,10 @@ describe('SignerListSet: TableDetail', () => { it('renders', () => { renderComponent(mockSignerListSet) expect(wrapper).toHaveText('signers: 3 - quorum: 3/4') - wrapper.unmount() }) it('renders when signer list is cleared', () => { renderComponent(mockSignerListSetClear) expect(wrapper).toHaveText('unset_signer_list') - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateSimple.test.tsx b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateSimple.test.tsx index 02558e539..402171b44 100644 --- a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateSimple.test.tsx @@ -10,6 +10,5 @@ describe('TicketCreate: Simple', () => { it('renders ticket count', () => { renderComponent(TicketCreate) expectSimpleRowText(wrapper, 'ticket-count', '1') - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx index 4c8be6bdd..e12b13597 100644 --- a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx @@ -10,6 +10,5 @@ describe('TicketCreate: TableDetail', () => { it('renders', () => { renderComponent(TicketCreate) expect(wrapper).toHaveText('ticket_count: 1') - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx index 47318be53..5f30e30a9 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx @@ -15,6 +15,5 @@ describe('TrustSet: Description', () => { expect(wrapper.html()).toBe( `
It establishes CNÂ¥1,000,000,000.00 as the maximum amount of CNY from that is willing to hold
`, ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetSimple.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetSimple.test.tsx index e7a5a9960..5374452e7 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetSimple.test.tsx @@ -2,6 +2,7 @@ import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createSimpleRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockTrustSet from './mock_data/TrustSet.json' import { expectSimpleRowLabel, expectSimpleRowText } from '../../test' @@ -18,6 +19,5 @@ describe('TrustSet: Simple', () => { 'amount', `CN¥1,000,000,000.00 CNY.razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA`, ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx index 6fc7a6941..d0b8e81c1 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx @@ -14,6 +14,5 @@ describe('TrustSet: TableDetail', () => { expect(wrapper.find('Amount')).toHaveText( 'CN¥1,000,000,000.00 CNY.razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA', ) - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx index 9dc720ce5..3ceafee75 100644 --- a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx +++ b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx @@ -25,7 +25,6 @@ describe('UNLModify: Simple', () => { ) expectSimpleRowLabel(wrapper, 'action', 'action') expectSimpleRowText(wrapper, 'action', 'ENABLE') - wrapper.unmount() }) it('renders tx that disables a validator', () => { @@ -38,7 +37,6 @@ describe('UNLModify: Simple', () => { ) expectSimpleRowLabel(wrapper, 'action', 'action') expectSimpleRowText(wrapper, 'action', 'DISABLE') - wrapper.unmount() }) it('renders tx with correct account and sequence', () => { @@ -56,7 +54,5 @@ describe('UNLModify: Simple', () => { expect(wrapper.find('[data-testid="account"]')).not.toExist() expectSimpleRowLabel(wrapper, 'sequence', 'Sequence Number') expectSimpleRowText(wrapper, 'sequence', '0') - - wrapper.unmount() }) }) diff --git a/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx index 5dc04f7bb..f0b887509 100644 --- a/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx @@ -1,4 +1,5 @@ import { createSimpleRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockXChainAccountCreateCommit from './mock_data/XChainAccountCreateCommit.json' import mockXChainAccountCreateCommitInsufficientFunds from './mock_data/XChainAccountCreateCommitInsufficientFunds.json' diff --git a/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx index 3266df1b4..a8ba8d094 100644 --- a/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx @@ -1,4 +1,5 @@ import { createSimpleRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockXChainAddAccountCreateAttestation from './mock_data/XChainAddAccountCreateAttestation.json' import mockXChainAddAccountCreateAttestationFailed from './mock_data/XChainAddAccountCreateAttestationFailed.json' diff --git a/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx index 211aa0348..9df54096f 100644 --- a/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx @@ -1,4 +1,5 @@ import { createSimpleRenderFactory } from '../../test/createRenderFactory' +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockXChainAddClaimAttestation from './mock_data/XChainAddClaimAttestation.json' import mockXChainAddClaimAttestationFailed from './mock_data/XChainAddClaimAttestationFailed.json' diff --git a/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx b/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx index e7500ac16..d2e16e212 100644 --- a/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx +++ b/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx @@ -25,7 +25,6 @@ describe('DefaultSimple', () => { expect(wrapper.find(`[data-testid="Destination"] a`)).toExist() expectSimpleRowText(wrapper, 'Amount', '\uE9001.00 XRP') expectSimpleRowText(wrapper, 'FinishAfter', '736447590') - wrapper.unmount() }) it('renders Simple for more complex transaction', () => { @@ -55,8 +54,6 @@ describe('DefaultSimple', () => { expect(wrapper.find(`[data-testid="HookOn"] .value`).at(0)).toHaveText( 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFFFFFFFFFBFFFFF', ) - - wrapper.unmount() }) it('renders Simple for more complex transaction', () => { @@ -97,8 +94,6 @@ describe('DefaultSimple', () => { `[data-testid="HookParameters"] .subgroup [data-testid="HookParameterValue"]`, ), ).toHaveText('HookParameterValue: 76616C756531') - - wrapper.unmount() }) it('renders Simple for amount', () => { @@ -119,6 +114,5 @@ describe('DefaultSimple', () => { 'AmountOther', '$33.00 USD.rnz5f1MFcgbVxzYhU5hUKbKquEJHJady5K', ) - wrapper.unmount() }) }) From fd8d50c0f91eec2749067d6b1fb73f88ff1bb760 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 9 May 2024 10:33:43 -0400 Subject: [PATCH 06/55] wrapper -> screen --- .../Transaction/AMMBid/test/AMMBid.test.tsx | 8 +- .../AMMCreate/test/AMMCreate.test.tsx | 8 +- .../test/AMMDeleteDescription.test.tsx | 4 +- .../AMMDelete/test/AMMDeleteSimple.test.tsx | 5 +- .../test/AMMDeleteTableDetail.test.tsx | 6 +- .../AMMDeposit/test/AMMDeposit.test.tsx | 36 +++---- .../Transaction/AMMVote/test/AMMVote.test.tsx | 4 +- .../AMMWithdraw/test/AMMWithdraw.test.tsx | 24 ++--- .../test/AccountDeleteSimple.test.tsx | 10 +- .../test/AccountSetDescription.test.tsx | 16 +-- .../AccountSet/test/AccountSetSimple.test.tsx | 33 +++---- .../test/AccountSetTableDetail.test.tsx | 16 +-- .../test/ClawbackDescription.test.tsx | 4 +- .../Clawback/test/ClawbackSimple.test.tsx | 8 +- .../test/ClawbackTableDetail.test.tsx | 2 +- .../DIDSet/test/DIDSetTableDetail.test.tsx | 2 +- .../test/EnableAmendmentSimple.test.tsx | 98 +++++++++---------- .../test/EscrowCancelDescription.test.tsx | 2 +- .../test/EscrowCancelSimple.test.tsx | 6 +- .../test/EscrowCancelTableDetail.test.tsx | 2 +- .../test/EscrowCreateDescription.test.tsx | 2 +- .../test/EscrowCreateSimple.test.tsx | 12 +-- .../test/EscrowCreateTableDetail.test.tsx | 10 +- .../test/EscrowFinishDescription.test.tsx | 2 +- .../test/EscrowFinishSimple.test.tsx | 6 +- .../test/EscrowFinishTableDetail.test.tsx | 6 +- .../test/NFTokenAcceptOfferSimple.test.tsx | 41 ++++---- .../test/NFTokenBurnSimple.test.tsx | 8 +- .../test/NFTokenCancelOfferSimple.test.tsx | 10 +- .../test/NFTokenCreateOfferSimple.test.tsx | 38 +++---- .../test/NFTokenMintSimple.test.tsx | 70 ++++++------- .../test/OfferCreateDescription.test.tsx | 2 +- .../test/OfferCreateSimple.test.tsx | 2 +- .../test/OfferCreateTableDetail.test.tsx | 2 +- .../test/OfferCreateDescription.test.tsx | 4 +- .../test/OfferCreateSimple.test.tsx | 16 +-- .../test/OfferCreateTableDetail.test.tsx | 18 ++-- .../Payment/test/PaymentDescription.test.tsx | 54 +++++----- .../Payment/test/PaymentSimple.test.tsx | 40 ++++---- .../Payment/test/PaymentTableDetail.test.tsx | 12 +-- .../PaymentChannelClaimDescription.test.tsx | 34 +++---- .../test/PaymentChannelClaimSimple.test.tsx | 85 ++++++++-------- .../PaymentChannelClaimTableDetail.test.tsx | 58 +++++------ .../PaymentChannelCreateDescription.test.tsx | 30 +++--- .../test/PaymentChannelCreateSimple.test.tsx | 40 ++++---- .../PaymentChannelCreateTableDetail.test.tsx | 20 ++-- .../PaymentChannelFundDescription.test.tsx | 10 +- .../test/PaymentChannelFundSimple.test.tsx | 41 ++++---- .../SetFee/test/SetFeeDescription.test.tsx | 12 +-- .../SetFee/test/SetFeeSimple.test.tsx | 18 ++-- .../SetHook/test/SetHookSimple.test.tsx | 14 +-- .../test/SetRegularKeyDescription.test.tsx | 4 +- .../test/SetRegularKeySimple.test.tsx | 4 +- .../test/SetRegularKeyTableDetail.test.tsx | 10 +- .../test/SignerListSetDescription.test.tsx | 6 +- .../test/SignerListSetSimple.test.tsx | 6 +- .../test/SignerListSetTableDetail.test.tsx | 4 +- .../test/TicketCreateSimple.test.tsx | 2 +- .../test/TicketCreateTableDetail.test.tsx | 2 +- .../test/TrustSetDescription.test.tsx | 2 +- .../TrustSet/test/TrustSetSimple.test.tsx | 5 +- .../test/TrustSetTableDetail.test.tsx | 4 +- .../UNLModify/test/UNLModifySimple.test.tsx | 24 ++--- .../XChainAccountCreateCommitSimple.test.tsx | 38 +++---- ...AddAccountCreateAttestationSimple.test.tsx | 40 ++++---- .../XChainAddClaimAttestationSimple.test.tsx | 44 ++++----- .../test/XChainClaimSimple.test.tsx | 36 +++---- .../test/XChainCommitSimple.test.tsx | 36 +++---- .../test/XChainCreateBridgeSimple.test.tsx | 48 ++++----- .../test/XChainCreateClaimIDSimple.test.tsx | 36 +++---- .../test/XChainModifyBridgeSimple.test.tsx | 46 ++++----- .../Transaction/test/DefaultSimple.test.tsx | 66 ++++++------- 72 files changed, 727 insertions(+), 747 deletions(-) diff --git a/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx b/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx index 08cfee2b6..86d67aea0 100644 --- a/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx +++ b/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx @@ -9,22 +9,22 @@ describe('AMM Bid Tests', () => { it('renders from transaction', () => { renderComponent(bidMock) expectSimpleRowText( - wrapper, + screen, 'min_slot_price', '100.00 LP.rMEdVzU8mtEArzjrN9avm3kA675GX7ez8W', ) expectSimpleRowText( - wrapper, + screen, 'max_slot_price', '500.00 LP.rMEdVzU8mtEArzjrN9avm3kA675GX7ez8W', ) expectSimpleRowText( - wrapper, + screen, 'account_id', 'rMEdVzU8mtEArzjrN9avm3kA675GX7ez8W', ) expectSimpleRowText( - wrapper, + screen, 'auth_accounts', 'ra8uHq2Qme5j19TqvPzTE2nqT12Zc3xJmKrU6o2YguZi847RaiH2QGTkL4eZWZjbxZvk', ) diff --git a/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx b/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx index c63923570..2ac92aa55 100644 --- a/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx +++ b/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx @@ -8,15 +8,15 @@ describe('AMM Create Tests', () => { it('renders from transaction', () => { renderComponent(createMock) - expectSimpleRowText(wrapper, 'asset1', '\uE90010,000.00 XRP') - expectSimpleRowText(wrapper, 'trading_fee', '0.001%') + expectSimpleRowText(screen, 'asset1', '\uE90010,000.00 XRP') + expectSimpleRowText(screen, 'trading_fee', '0.001%') expectSimpleRowText( - wrapper, + screen, 'asset2', '$10,000.00 USD.rhpHaFggC92ELty3n3yDEtuFgWxXWkUFET', ) expectSimpleRowText( - wrapper, + screen, 'account_id', 'rMEdVzU8mtEArzjrN9avm3kA675GX7ez8W', ) diff --git a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx index f520abffa..ebe153196 100644 --- a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx @@ -11,10 +11,10 @@ describe('AMMDelete: Description', () => { it('renders description for AMMDelete transaction', () => { renderComponent(mockAMMDelete) - expect(wrapper.find('[data-testid="amm-delete-description"]')).toHaveText( + expect(screen.find('[data-testid="amm-delete-description"]')).toHaveText( 'Attempted to delete the AMM for \uE900 XRP and FOO.rm5c42Crqpdch5fbuCdHmSMV1wrL9arV9.If there were more than 512 trustlines, this only removes 512 trustlines instead.', ) - expect(wrapper.find('a')).toHaveProp( + expect(screen.find('a')).toHaveProp( 'href', '/token/FOO.rm5c42Crqpdch5fbuCdHmSMV1wrL9arV9', ) diff --git a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteSimple.test.tsx b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteSimple.test.tsx index a7cd86e27..f1fc2ae2d 100644 --- a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteSimple.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteSimple.test.tsx @@ -3,7 +3,6 @@ import i18n from '../../../../../../i18n/testConfigEnglish' import { expectSimpleRowText } from '../../test' import { createSimpleRenderFactory } from '../../test/createRenderFactory' -import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockAMMDelete from './mock_data/AMMDelete.json' @@ -13,9 +12,9 @@ describe('AMMDelete: Simple', () => { afterEach(cleanup) it('renders', () => { renderComponent(mockAMMDelete) // TOOD: - Make this look up asset 1 / asset 2 currency codes - expectSimpleRowText(wrapper, 'asset1', '\uE900 XRP') + expectSimpleRowText(screen, 'asset1', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'asset2', 'FOO.rm5c42Crqpdch5fbuCdHmSMV1wrL9arV9', ) diff --git a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx index ffda46118..8461f01ce 100644 --- a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx @@ -11,10 +11,8 @@ describe('AMMDelete: TableDetail', () => { it('renders with an expiration and offer', () => { renderComponent(mockAMMDelete) - expect(wrapper.find('[data-testid="asset"]')).toHaveText( - 'Asset 1\uE900 XRP', - ) - expect(wrapper.find('[data-testid="asset2"]')).toHaveText( + expect(screen.find('[data-testid="asset"]')).toHaveText('Asset 1\uE900 XRP') + expect(screen.find('[data-testid="asset2"]')).toHaveText( 'Asset 2FOO.rm5c42Crqpdch5fbuCdHmSMV1wrL9arV9', ) }) diff --git a/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx b/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx index 53cd17206..51348bbec 100644 --- a/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx @@ -17,14 +17,14 @@ describe('AMM Deposit Tests', () => { it('renders with both assets', () => { renderComponent(depositBothAssets) - expectSimpleRowText(wrapper, 'asset1', '\uE90010,997.290462 XRP') + expectSimpleRowText(screen, 'asset1', '\uE90010,997.290462 XRP') expectSimpleRowText( - wrapper, + screen, 'asset2', '$10,000.00 USD.rhpHaFggC92ELty3n3yDEtuFgWxXWkUFET', ) expectSimpleRowText( - wrapper, + screen, 'account_id', 'rMEdVzU8mtEArzjrN9avm3kA675GX7ez8W', ) @@ -32,14 +32,14 @@ describe('AMM Deposit Tests', () => { it('renders only with USD', () => { renderComponent(depositUSD) - expectSimpleRowNotToExist(wrapper, 'asset1') + expectSimpleRowNotToExist(screen, 'asset1') expectSimpleRowText( - wrapper, + screen, 'asset2', '$2,000.00 USD.rhpHaFggC92ELty3n3yDEtuFgWxXWkUFET', ) expectSimpleRowText( - wrapper, + screen, 'account_id', 'rMEdVzU8mtEArzjrN9avm3kA675GX7ez8W', ) @@ -47,9 +47,9 @@ describe('AMM Deposit Tests', () => { it('renders only with XRP', () => { renderComponent(depositXRP) - expectSimpleRowText(wrapper, 'asset1', '\uE9001,000.00 XRP') + expectSimpleRowText(screen, 'asset1', '\uE9001,000.00 XRP') expectSimpleRowText( - wrapper, + screen, 'account_id', 'rMEdVzU8mtEArzjrN9avm3kA675GX7ez8W', ) @@ -57,19 +57,19 @@ describe('AMM Deposit Tests', () => { it('renders with eprice', () => { renderComponent(depositEprice) - expectSimpleRowNotToExist(wrapper, 'asset1') + expectSimpleRowNotToExist(screen, 'asset1') expectSimpleRowText( - wrapper, + screen, 'asset2', '$1,000.00 USD.rA3nNmhWKRZvcsA89DxTRbV62JiaSZWdy', ) expectSimpleRowText( - wrapper, + screen, 'effective_price', '$0.10 USD.rA3nNmhWKRZvcsA89DxTRbV62JiaSZWdy', ) expectSimpleRowText( - wrapper, + screen, 'account_id', 'rHrzrzVHSyunKzW3JLgSaLcsxfwVLPVV97', ) @@ -78,17 +78,17 @@ describe('AMM Deposit Tests', () => { it('renders with both assets non XRP', () => { renderComponent(depositNonXRP) expectSimpleRowText( - wrapper, + screen, 'asset1', '€500.00 EUR.rEaiyQKvxYWmh7q9mvSm11kZmKx92HZdmr', ) expectSimpleRowText( - wrapper, + screen, 'asset2', '$500.00 USD.rEaiyQKvxYWmh7q9mvSm11kZmKx92HZdmr', ) expectSimpleRowText( - wrapper, + screen, 'account_id', 'rEJ1X5BoSmHqa5h6TSVvYrHAzFmyxGqNic', ) @@ -96,8 +96,8 @@ describe('AMM Deposit Tests', () => { it('deposit shouldnt crash with tx that changes fee', () => { renderComponent(depositFail) - expectSimpleRowNotToExist(wrapper, 'asset1') - expectSimpleRowNotToExist(wrapper, 'asset2') - expectSimpleRowNotToExist(wrapper, 'account_id') + expectSimpleRowNotToExist(screen, 'asset1') + expectSimpleRowNotToExist(screen, 'asset2') + expectSimpleRowNotToExist(screen, 'account_id') }) }) diff --git a/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx b/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx index 495458d17..2ce3e9207 100644 --- a/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx +++ b/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx @@ -8,9 +8,9 @@ describe('AMM Vote Tests', () => { it('renders from transaction', () => { renderComponent(voteMock) - expectSimpleRowText(wrapper, 'trading_fee', '0.001%') + expectSimpleRowText(screen, 'trading_fee', '0.001%') expectSimpleRowText( - wrapper, + screen, 'account_id', 'rMEdVzU8mtEArzjrN9avm3kA675GX7ez8W', ) diff --git a/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx b/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx index f3c9278c6..c997e1d7a 100644 --- a/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx +++ b/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx @@ -15,14 +15,14 @@ describe('AMM Withdraw Tests', () => { it('renders from transaction', () => { renderComponent(withdrawMock) - expectSimpleRowText(wrapper, 'asset1', '\uE9003,666.580862 XRP') + expectSimpleRowText(screen, 'asset1', '\uE9003,666.580862 XRP') expectSimpleRowText( - wrapper, + screen, 'asset2', '$4,000.00 USD.rhpHaFggC92ELty3n3yDEtuFgWxXWkUFET', ) expectSimpleRowText( - wrapper, + screen, 'account_id', 'rMEdVzU8mtEArzjrN9avm3kA675GX7ez8W', ) @@ -30,24 +30,24 @@ describe('AMM Withdraw Tests', () => { it('renders transaction from usd only', () => { renderComponent(withdrawUSDMock) - expectSimpleRowNotToExist(wrapper, 'asset1') + expectSimpleRowNotToExist(screen, 'asset1') expectSimpleRowText( - wrapper, + screen, 'asset2', '$100.00 USD.rA3nNmhWKRZvcsA89DxTRbV62JiaSZWdy', ) expectSimpleRowText( - wrapper, + screen, 'account_id', 'rHrzrzVHSyunKzW3JLgSaLcsxfwVLPVV97', ) }) it('renders transaction from XRP only', () => { renderComponent(withdrawXRPMock) - expectSimpleRowNotToExist(wrapper, 'asset2') - expectSimpleRowText(wrapper, 'asset1', '\uE90099.99998 XRP') + expectSimpleRowNotToExist(screen, 'asset2') + expectSimpleRowText(screen, 'asset1', '\uE90099.99998 XRP') expectSimpleRowText( - wrapper, + screen, 'account_id', 'rHrzrzVHSyunKzW3JLgSaLcsxfwVLPVV97', ) @@ -55,14 +55,14 @@ describe('AMM Withdraw Tests', () => { it('renders transaction from eprice', () => { renderComponent(withdrawEpriceMock) - expectSimpleRowNotToExist(wrapper, 'asset1') + expectSimpleRowNotToExist(screen, 'asset1') expectSimpleRowText( - wrapper, + screen, 'asset2', '$1,639.41097028 USD.rA3nNmhWKRZvcsA89DxTRbV62JiaSZWdy', ) expectSimpleRowText( - wrapper, + screen, 'account_id', 'rHrzrzVHSyunKzW3JLgSaLcsxfwVLPVV97', ) diff --git a/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx b/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx index 372d315c9..da579333a 100644 --- a/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx +++ b/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx @@ -1,7 +1,7 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createSimpleRenderFactory } from '../../test/createRenderFactory' -import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockAccountDelete from './mock_data/AccountDelete.json' import mockAccountDeleteWithDestinationTag from './mock_data/AccountDeleteWithDestinationTag.json' @@ -12,16 +12,16 @@ describe('AccountDelete: Simple', () => { afterEach(cleanup) it('renders', () => { renderComponent(mockAccountDelete) - expect(wrapper.find('.label')).toHaveText('destination') - expect(wrapper.find('.value')).toHaveText( + expect(screen.find('.label')).toHaveText('destination') + expect(screen.find('.value')).toHaveText( 'raT74sdzpxJUaubcBAQNS8aLqFMU85Rr5J', ) }) it('renders with destination tag', () => { renderComponent(mockAccountDeleteWithDestinationTag) - expect(wrapper.find('.label')).toHaveText('destination') - expect(wrapper.find('.value')).toHaveText( + expect(screen.find('.label')).toHaveText('destination') + expect(screen.find('.value')).toHaveText( 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn:123123', ) }) diff --git a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx index 99bb2f00a..31be25dd4 100644 --- a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx @@ -15,7 +15,7 @@ describe('AccountSet: Description', () => { afterEach(cleanup) it('renders tx that sets the domain', () => { renderComponent(mockAccountSetWithDomain) - expect(wrapper).toHaveText('It sets the account domain as mduo13.com') + expect(screen).toHaveText('It sets the account domain as mduo13.com') }) it('renders tx that sets the email hash', () => { @@ -27,19 +27,19 @@ describe('AccountSet: Description', () => { EmailHash: '7AC3878BF42A5329698F468A6AAA03B9', }, }) - expect(wrapper).toHaveText( + expect(screen).toHaveText( 'It sets the account email hash as 7AC3878BF42A5329698F468A6AAA03B9', ) }) it('renders tx that clears a flag', () => { renderComponent(mockAccountSetWithClearFlag) - expect(wrapper).toHaveText('It clears the account flag asfGlobalFreeze') + expect(screen).toHaveText('It clears the account flag asfGlobalFreeze') }) it('renders tx that sets a flag', () => { renderComponent(mockAccountSetWithSetFlag) - expect(wrapper).toHaveText('It sets the account flag asfRequireDest') + expect(screen).toHaveText('It sets the account flag asfRequireDest') }) it('renders tx that clears a flag that is not defined', () => { @@ -47,7 +47,7 @@ describe('AccountSet: Description', () => { ...mockAccountSetWithClearFlag, tx: { ...mockAccountSetWithClearFlag.tx, ClearFlag: 45 }, }) - expect(wrapper).toHaveText('It clears the account flag 45') + expect(screen).toHaveText('It clears the account flag 45') }) it('renders tx that sets a flag that is not defined', () => { @@ -55,19 +55,19 @@ describe('AccountSet: Description', () => { ...mockAccountSetWithSetFlag, tx: { ...mockAccountSetWithSetFlag.tx, SetFlag: 45 }, }) - expect(wrapper).toHaveText('It sets the account flag 45') + expect(screen).toHaveText('It sets the account flag 45') }) it('renders tx that sets a message', () => { renderComponent(mockAccountSetWithMessageKey) - expect(wrapper.find('[data-testid="message-key"]')).toHaveText( + expect(screen.find('[data-testid="message-key"]')).toHaveText( 'It sets the account message key as 020000000000000000000000000941C216565D33C8A8ACD1A33C359E84D652D1DA', ) }) it('renders tx that sets a minter', () => { renderComponent(mockAccountSetWithNFTokenMinter) - expect(wrapper.find('[data-testid="minter"]')).toHaveText( + expect(screen.find('[data-testid="minter"]')).toHaveText( 'It sets rXMART8usFd5kABXCayoP6ZfB35b4v43t as the authorized minter for this account', ) }) diff --git a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetSimple.test.tsx b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetSimple.test.tsx index 84f9d81f2..90a26d26a 100644 --- a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetSimple.test.tsx @@ -2,7 +2,6 @@ import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createSimpleRenderFactory } from '../../test/createRenderFactory' -import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockAccountSetWithDomain from './mock_data/AccountSetWithDomain.json' import mockAccountSetWithClearFlag from './mock_data/AccountSetWithClearFlag.json' @@ -17,8 +16,8 @@ describe('AccountSet: Simple', () => { afterEach(cleanup) it('renders tx that sets the domain', () => { renderComponent(mockAccountSetWithDomain) - expectSimpleRowLabel(wrapper, 'domain', 'domain') - expectSimpleRowText(wrapper, 'domain', 'mduo13.com') + expectSimpleRowLabel(screen, 'domain', 'domain') + expectSimpleRowText(screen, 'domain', 'mduo13.com') }) it('renders tx that sets the email hash', () => { @@ -31,20 +30,20 @@ describe('AccountSet: Simple', () => { }, }) - expectSimpleRowLabel(wrapper, 'email', 'email hash') - expectSimpleRowText(wrapper, 'email', '7AC3878BF42A5329698F468A6AAA03B9') + expectSimpleRowLabel(screen, 'email', 'email hash') + expectSimpleRowText(screen, 'email', '7AC3878BF42A5329698F468A6AAA03B9') }) it('renders tx that clears a flag', () => { renderComponent(mockAccountSetWithClearFlag) - expectSimpleRowLabel(wrapper, 'clear-flag', 'clear flag') - expectSimpleRowText(wrapper, 'clear-flag', 'asfGlobalFreeze') + expectSimpleRowLabel(screen, 'clear-flag', 'clear flag') + expectSimpleRowText(screen, 'clear-flag', 'asfGlobalFreeze') }) it('renders tx that sets a flag', () => { renderComponent(mockAccountSetWithSetFlag) - expectSimpleRowLabel(wrapper, 'set-flag', 'set flag') - expectSimpleRowText(wrapper, 'set-flag', 'asfRequireDest') + expectSimpleRowLabel(screen, 'set-flag', 'set flag') + expectSimpleRowText(screen, 'set-flag', 'asfRequireDest') }) it('renders tx that clears a flag without a defined flag', () => { @@ -52,8 +51,8 @@ describe('AccountSet: Simple', () => { ...mockAccountSetWithClearFlag, tx: { ...mockAccountSetWithClearFlag.tx, ClearFlag: 45 }, }) - expectSimpleRowLabel(wrapper, 'clear-flag', 'clear flag') - expectSimpleRowText(wrapper, 'clear-flag', '45') + expectSimpleRowLabel(screen, 'clear-flag', 'clear flag') + expectSimpleRowText(screen, 'clear-flag', '45') }) it('renders tx that sets a flag without a defined flag', () => { @@ -61,15 +60,15 @@ describe('AccountSet: Simple', () => { ...mockAccountSetWithSetFlag, tx: { ...mockAccountSetWithSetFlag.tx, SetFlag: 45 }, }) - expectSimpleRowLabel(wrapper, 'set-flag', 'set flag') - expectSimpleRowText(wrapper, 'set-flag', '45') + expectSimpleRowLabel(screen, 'set-flag', 'set flag') + expectSimpleRowText(screen, 'set-flag', '45') }) it('renders tx that sets a message', () => { renderComponent(mockAccountSetWithMessageKey) - expectSimpleRowLabel(wrapper, 'message', 'message key') + expectSimpleRowLabel(screen, 'message', 'message key') expectSimpleRowText( - wrapper, + screen, 'message', '020000000000000000000000000941C216565D33C8A8ACD1A33C359E84D652D1DA', ) @@ -77,7 +76,7 @@ describe('AccountSet: Simple', () => { it('renders tx that sets a minter', () => { renderComponent(mockAccountSetWithNFTokenMinter) - expectSimpleRowLabel(wrapper, 'minter', 'NFT Minter') - expectSimpleRowText(wrapper, 'minter', 'rXMART8usFd5kABXCayoP6ZfB35b4v43t') + expectSimpleRowLabel(screen, 'minter', 'NFT Minter') + expectSimpleRowText(screen, 'minter', 'rXMART8usFd5kABXCayoP6ZfB35b4v43t') }) }) diff --git a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx index ae7d41457..f765ae0c5 100644 --- a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx @@ -15,7 +15,7 @@ describe('AccountSet: TableDetail', () => { afterEach(cleanup) it('renders tx that sets the domain', () => { renderComponent(mockAccountSetWithDomain) - expect(wrapper).toHaveText('domain: mduo13.com') + expect(screen).toHaveText('domain: mduo13.com') }) it('renders tx that sets the email hash', () => { @@ -27,17 +27,17 @@ describe('AccountSet: TableDetail', () => { EmailHash: '7AC3878BF42A5329698F468A6AAA03B9', }, }) - expect(wrapper).toHaveText('email hash: 7AC3878BF42A5329698F468A6AAA03B9') + expect(screen).toHaveText('email hash: 7AC3878BF42A5329698F468A6AAA03B9') }) it('renders tx that clears a flag', () => { renderComponent(mockAccountSetWithClearFlag) - expect(wrapper).toHaveText('clear flag: asfGlobalFreeze') + expect(screen).toHaveText('clear flag: asfGlobalFreeze') }) it('renders tx that sets a flag', () => { renderComponent(mockAccountSetWithSetFlag) - expect(wrapper).toHaveText('set flag: asfRequireDest') + expect(screen).toHaveText('set flag: asfRequireDest') }) it('renders tx that clears a flag that is not defined', () => { @@ -45,7 +45,7 @@ describe('AccountSet: TableDetail', () => { ...mockAccountSetWithClearFlag, tx: { ...mockAccountSetWithClearFlag.tx, ClearFlag: 45 }, }) - expect(wrapper).toHaveText('clear flag: 45') + expect(screen).toHaveText('clear flag: 45') }) it('renders tx that sets a flag that is not defined', () => { @@ -53,19 +53,19 @@ describe('AccountSet: TableDetail', () => { ...mockAccountSetWithSetFlag, tx: { ...mockAccountSetWithSetFlag.tx, SetFlag: 45 }, }) - expect(wrapper).toHaveText('set flag: 45') + expect(screen).toHaveText('set flag: 45') }) it('renders tx that sets a message', () => { renderComponent(mockAccountSetWithMessageKey) - expect(wrapper).toHaveText( + expect(screen).toHaveText( 'message key: 020000000000000000000000000941C216565D33C8A8ACD1A33C359E84D652D1DA', ) }) it('renders tx that sets a minter', () => { renderComponent(mockAccountSetWithNFTokenMinter) - expect(wrapper.find('[data-testid="minter"]')).toHaveText( + expect(screen.find('[data-testid="minter"]')).toHaveText( 'NFT Minter: rXMART8usFd5kABXCayoP6ZfB35b4v43t', ) }) diff --git a/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx b/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx index 5c5548c7f..a6121da3c 100644 --- a/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx +++ b/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx @@ -9,10 +9,10 @@ const renderComponent = createDescriptionRenderFactory(Description, i18n) describe('Clawback', () => { it('handles Clawback Description ', () => { renderComponent(transaction) - expect(wrapper.find('[data-testid="from-to-line"]')).toHaveText( + expect(screen.find('[data-testid="from-to-line"]')).toHaveText( `rDZ713igKfedN4hhY6SjQse4Mv3ZrBxnn9 claws back from rscBWQpyZEmQvupeB1quu7Ky8YX4f5CHDP`, ) - expect(wrapper.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.find('[data-testid="amount-line"]')).toHaveText( `The max clawback amount is 4,840.00 FOO.rDZ713igKfedN4hhY6SjQse4Mv3ZrBxnn9`, ) }) diff --git a/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx b/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx index e04ebc1f7..50e025742 100644 --- a/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx +++ b/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx @@ -17,9 +17,9 @@ const renderComponent = createSimpleRenderFactory(Simple) describe('Clawback', () => { it('handles Clawback simple view ', () => { renderComponent(transaction) - expectSimpleRowText(wrapper, 'holder', 'rscBWQpyZEmQvupeB1quu7Ky8YX4f5CHDP') + expectSimpleRowText(screen, 'holder', 'rscBWQpyZEmQvupeB1quu7Ky8YX4f5CHDP') expectSimpleRowText( - wrapper, + screen, 'amount', '3,840.00 FOO.rDZ713igKfedN4hhY6SjQse4Mv3ZrBxnn9', ) @@ -47,9 +47,9 @@ describe('Clawback', () => { it('handles failed Clawback simple view ', () => { renderComponent(transactionFailure) - expectSimpleRowText(wrapper, 'holder', 'rDZ713igKfedN4hhY6SjQse4Mv3ZrBxnn9') + expectSimpleRowText(screen, 'holder', 'rDZ713igKfedN4hhY6SjQse4Mv3ZrBxnn9') expectSimpleRowText( - wrapper, + screen, 'amount', '4,840.00 FOO.rscBWQpyZEmQvupeB1quu7Ky8YX4f5CHDP', ) diff --git a/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx b/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx index fabcff15a..a01814d4e 100644 --- a/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx @@ -8,7 +8,7 @@ const renderComponent = createTableDetailRenderFactory(TableDetail) describe('Clawback', () => { it('handles Clawback TableDetail ', () => { renderComponent(transaction) - expect(wrapper.find('.clawback')).toHaveText( + expect(screen.find('.clawback')).toHaveText( `claws_back3,840.00 FOO.rDZ713igKfedN4hhY6SjQse4Mv3ZrBxnn9fromrscBWQpyZEmQvupeB1quu7Ky8YX4f5CHDP`, ) }) diff --git a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx index d9d29b93b..873ad7cc4 100644 --- a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx @@ -10,6 +10,6 @@ describe('DIDSet: TableDetail', () => { it('renders', () => { renderComponent(DIDSet) // eslint-disable-next-line no-useless-concat -- easier to read this way - expect(wrapper).toHaveText('uri: did_example' + 'did_document: doc') + expect(screen).toHaveText('uri: did_example' + 'did_document: doc') }) }) diff --git a/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx b/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx index 7ae0495b5..f5aaa4bd7 100644 --- a/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx @@ -54,19 +54,18 @@ describe('EnableAmendment: Simple', () => { Promise.resolve(mockFeatureExpandedSignerList), ) renderComponent(mockEnableAmendmentWithMinority) - expectSimpleRowLabel(wrapper, 'name', 'Amendment Name') - expectSimpleRowText(wrapper, 'name', 'Loading') - expectSimpleRowLabel(wrapper, 'status', 'Amendment Status') - expectSimpleRowText(wrapper, 'status', 'Lost Majority') - expectSimpleRowLabel(wrapper, 'version', 'Introduced In') - expectSimpleRowText(wrapper, 'version', 'Loading') - expect(wrapper.find('[data-testid="date"]')).not.toExist() + expectSimpleRowLabel(screen, 'name', 'Amendment Name') + expectSimpleRowText(screen, 'name', 'Loading') + expectSimpleRowLabel(screen, 'status', 'Amendment Status') + expectSimpleRowText(screen, 'status', 'Lost Majority') + expectSimpleRowLabel(screen, 'version', 'Introduced In') + expectSimpleRowText(screen, 'version', 'Loading') + expect(screen.find('[data-testid="date"]')).not.toExist() await flushPromises() - wrapper.update() - expectSimpleRowText(wrapper, 'name', 'ExpandedSignerList') - expectSimpleRowText(wrapper, 'version', 'v1.9.1') + expectSimpleRowText(screen, 'name', 'ExpandedSignerList') + expectSimpleRowText(screen, 'version', 'v1.9.1') }) it('renders tx that causes an amendment to gain majority', async () => { @@ -75,21 +74,20 @@ describe('EnableAmendment: Simple', () => { Promise.resolve(mockFeatureExpandedSignerList), ) renderComponent(mockEnableAmendmentWithMajority) - expectSimpleRowLabel(wrapper, 'name', 'Amendment Name') - expectSimpleRowText(wrapper, 'name', 'Loading') - expectSimpleRowLabel(wrapper, 'status', 'Amendment Status') - expectSimpleRowText(wrapper, 'status', 'Got Majority') - expectSimpleRowLabel(wrapper, 'version', 'Introduced In') - expectSimpleRowText(wrapper, 'version', 'Loading') - expectSimpleRowLabel(wrapper, 'date', 'Expected Date') - expectSimpleRowText(wrapper, 'date', '10/13/2022, 3:28:31 PM') + expectSimpleRowLabel(screen, 'name', 'Amendment Name') + expectSimpleRowText(screen, 'name', 'Loading') + expectSimpleRowLabel(screen, 'status', 'Amendment Status') + expectSimpleRowText(screen, 'status', 'Got Majority') + expectSimpleRowLabel(screen, 'version', 'Introduced In') + expectSimpleRowText(screen, 'version', 'Loading') + expectSimpleRowLabel(screen, 'date', 'Expected Date') + expectSimpleRowText(screen, 'date', '10/13/2022, 3:28:31 PM') await flushPromises() - wrapper.update() - expectSimpleRowText(wrapper, 'name', 'ExpandedSignerList') - expectSimpleRowText(wrapper, 'version', 'v1.9.1') - expect(wrapper.find('[data-testid="name"] .value a')).toHaveProp( + expectSimpleRowText(screen, 'name', 'ExpandedSignerList') + expectSimpleRowText(screen, 'version', 'v1.9.1') + expect(screen.find('[data-testid="name"] .value a')).toHaveProp( 'href', '/amendment/B2A4DB846F0891BF2C76AB2F2ACC8F5B4EC64437135C6E56F3F859DE5FFD5856', ) @@ -101,18 +99,17 @@ describe('EnableAmendment: Simple', () => { Promise.resolve(mockFeatureNegativeUNL), ) renderComponent(mockEnableAmendmentWithEnabled) - expectSimpleRowLabel(wrapper, 'name', 'Amendment Name') - expectSimpleRowText(wrapper, 'name', 'Loading') - expectSimpleRowLabel(wrapper, 'status', 'Amendment Status') - expectSimpleRowText(wrapper, 'status', 'Enabled') - expectSimpleRowLabel(wrapper, 'version', 'Introduced In') - expectSimpleRowText(wrapper, 'version', 'Loading') + expectSimpleRowLabel(screen, 'name', 'Amendment Name') + expectSimpleRowText(screen, 'name', 'Loading') + expectSimpleRowLabel(screen, 'status', 'Amendment Status') + expectSimpleRowText(screen, 'status', 'Enabled') + expectSimpleRowLabel(screen, 'version', 'Introduced In') + expectSimpleRowText(screen, 'version', 'Loading') await flushPromises() - wrapper.update() - expectSimpleRowText(wrapper, 'name', 'NegativeUNL') - expectSimpleRowText(wrapper, 'version', 'v1.7.3') + expectSimpleRowText(screen, 'name', 'NegativeUNL') + expectSimpleRowText(screen, 'version', 'v1.7.3') }) it('renders tx that cannot determine version or name', async () => { @@ -120,16 +117,15 @@ describe('EnableAmendment: Simple', () => { mockedGetFeature.mockImplementation(() => Promise.resolve(null)) renderComponent(mockEnableAmendmentWithEnabled) renderComponent(mockEnableAmendmentWithEnabled) - expectSimpleRowLabel(wrapper, 'name', 'Amendment Name') - expectSimpleRowText(wrapper, 'name', 'Loading') - expectSimpleRowLabel(wrapper, 'version', 'Introduced In') - expectSimpleRowText(wrapper, 'version', 'Loading') + expectSimpleRowLabel(screen, 'name', 'Amendment Name') + expectSimpleRowText(screen, 'name', 'Loading') + expectSimpleRowLabel(screen, 'version', 'Introduced In') + expectSimpleRowText(screen, 'version', 'Loading') await flushPromises() - wrapper.update() - expectSimpleRowText(wrapper, 'name', 'Unknown') - expectSimpleRowText(wrapper, 'version', 'Unknown') + expectSimpleRowText(screen, 'name', 'Unknown') + expectSimpleRowText(screen, 'version', 'Unknown') }) it('renders tx that cannot determine version', async () => { @@ -138,31 +134,29 @@ describe('EnableAmendment: Simple', () => { Promise.resolve(mockFeatureNegativeUNL), ) renderComponent(mockEnableAmendmentWithEnabled) - expectSimpleRowLabel(wrapper, 'name', 'Amendment Name') - expectSimpleRowText(wrapper, 'name', 'Loading') - expectSimpleRowLabel(wrapper, 'version', 'Introduced In') - expectSimpleRowText(wrapper, 'version', 'Loading') + expectSimpleRowLabel(screen, 'name', 'Amendment Name') + expectSimpleRowText(screen, 'name', 'Loading') + expectSimpleRowLabel(screen, 'version', 'Introduced In') + expectSimpleRowText(screen, 'version', 'Loading') await flushPromises() - wrapper.update() - expectSimpleRowText(wrapper, 'name', 'NegativeUNL') - expectSimpleRowText(wrapper, 'version', 'Unknown') + expectSimpleRowText(screen, 'name', 'NegativeUNL') + expectSimpleRowText(screen, 'version', 'Unknown') }) it('renders tx that cannot determine name', async () => { mockedGetRippledVersion.mockImplementation(() => Promise.resolve('v1.7.3')) mockedGetFeature.mockImplementation(() => Promise.resolve(null)) renderComponent(mockEnableAmendmentWithEnabled) - expectSimpleRowLabel(wrapper, 'name', 'Amendment Name') - expectSimpleRowText(wrapper, 'name', 'Loading') - expectSimpleRowLabel(wrapper, 'version', 'Introduced In') - expectSimpleRowText(wrapper, 'version', 'Loading') + expectSimpleRowLabel(screen, 'name', 'Amendment Name') + expectSimpleRowText(screen, 'name', 'Loading') + expectSimpleRowLabel(screen, 'version', 'Introduced In') + expectSimpleRowText(screen, 'version', 'Loading') await flushPromises() - wrapper.update() - expectSimpleRowText(wrapper, 'name', 'Unknown') - expectSimpleRowText(wrapper, 'version', 'v1.7.3') + expectSimpleRowText(screen, 'name', 'Unknown') + expectSimpleRowText(screen, 'version', 'v1.7.3') }) }) diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx index 818b47451..4cd6b63c0 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx @@ -8,7 +8,7 @@ const renderComponent = createDescriptionRenderFactory(Description) describe('EscrowCancelDescription', () => { it('renders description for EscrowCancel', () => { renderComponent(EscrowCancel) - expect(wrapper.html()).toBe( + expect(screen.html()).toBe( '
escrow_cancellation_desc
The escrowed amount of\uE900135.79XRPwas returned to (\uE900135.78999XRP escrow_after_transaction_cost)
The escrow was created bywith transactionA979AD...', ) }) diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx index 74713d3a3..7194c2396 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx @@ -8,13 +8,13 @@ const renderComponent = createSimpleRenderFactory(Simple) describe('EscrowCancelSimple', () => { it('renders with an expiration and offer', () => { renderComponent(mockEscrowCancel) - expect(wrapper.find('[data-testid="escrow-amount"] .value')).toHaveText( + expect(screen.find('[data-testid="escrow-amount"] .value')).toHaveText( `\uE900135.79 XRP`, ) - expect(wrapper.find('[data-testid="escrow-cancel"] .value')).toHaveText( + expect(screen.find('[data-testid="escrow-cancel"] .value')).toHaveText( 'rpmqbo5FWoydTL2Ufh5YdtzmRjbeLyxt56 - 9', ) - expect(wrapper.find('[data-testid="escrow-cancel-tx"] .value')).toHaveText( + expect(screen.find('[data-testid="escrow-cancel-tx"] .value')).toHaveText( `A979AD5C6A6C844913DA51D71BF5F0B8E254D9A211FA837C4B322C4A8FD358E6`, ) }) diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx index 3f803be91..c4a49aac9 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx @@ -12,7 +12,7 @@ const renderComponent = createTableDetailRenderFactory( describe('EscrowCancelTableDetail', () => { it('renders EscrowCancel without crashing', () => { renderComponent(mockEscrowCancel) - expect(wrapper).toHaveText( + expect(screen).toHaveText( 'cancel escrow rpmqbo5FWoydTL2Ufh5YdtzmRjbeLyxt56 - 9', ) }) diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx index b4324b28e..8ee258639 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx @@ -8,7 +8,7 @@ const renderComponent = createDescriptionRenderFactory(Description) describe('EscrowCreateDescription', () => { it('renders description for EscrowCreate', () => { renderComponent(EscrowCreate) - expect(wrapper.html()).toBe( + expect(screen.html()).toBe( 'The escrow is fromto
escrow_condition A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120
escrowed_amount \uE900997.50XRP
describe_cancel_after March 1, 2020 at 8:54:20 AM UTC
describe_finish_after March 1, 2020 at 9:01:00 AM UTC
', ) }) diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx index 1988d0d14..1ed7b8a16 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx @@ -1,20 +1,20 @@ +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockEscrowCreate from './mock_data/EscrowCreate.json' import { createSimpleRenderFactory } from '../../test/createRenderFactory' -import { cleanup, screen } from '@testing-library/react' const renderComponent = createSimpleRenderFactory(Simple) describe('EscrowCreateSimple', () => { it('renders with an expiration and offer', () => { renderComponent(mockEscrowCreate) - expect(wrapper.find('[data-testid="escrow-amount"] .value')).toHaveText( + expect(screen.find('[data-testid="escrow-amount"] .value')).toHaveText( `\uE900997.50 XRP`, ) - expect( - wrapper.find('[data-testid="escrow-destination"] .value'), - ).toHaveText(`rLbgNAngLq3HABBXK4uPGCHrqeZwgaYi7q`) - expect(wrapper.find('[data-testid="escrow-condition"] .value')).toHaveText( + expect(screen.find('[data-testid="escrow-destination"] .value')).toHaveText( + `rLbgNAngLq3HABBXK4uPGCHrqeZwgaYi7q`, + ) + expect(screen.find('[data-testid="escrow-condition"] .value')).toHaveText( `A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120`, ) }) diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx index d939a89ff..c9246d767 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx @@ -8,17 +8,17 @@ const renderComponent = createTableDetailRenderFactory(TableDetail) describe('EscrowCreateTableDetail', () => { it('renders EscrowCreate without crashing', () => { renderComponent(mockEscrowCreate) - expect(wrapper.find('[data-testid="account"]')).toHaveText( + expect(screen.find('[data-testid="account"]')).toHaveText( ` rLbgNAngLq3HABBXK4uPGCHrqeZwgaYi7q `, ) - expect(wrapper.find('[data-testid="amount"]')).toHaveText(`997.50 XRP`) - expect(wrapper.find('[data-testid="condition"]')).toHaveText( + expect(screen.find('[data-testid="amount"]')).toHaveText(`997.50 XRP`) + expect(screen.find('[data-testid="condition"]')).toHaveText( ` A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120 `, ) - expect(wrapper.find('[data-testid="finish_after"]')).toHaveText( + expect(screen.find('[data-testid="finish_after"]')).toHaveText( `March 1, 2020 at 9:01:00 AM UTC`, ) - expect(wrapper.find('[data-testid="cancel_after"]')).toHaveText( + expect(screen.find('[data-testid="cancel_after"]')).toHaveText( `March 1, 2020 at 8:54:20 AM UTC`, ) }) diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx index f3fee9796..da89428e1 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx @@ -8,7 +8,7 @@ const renderComponent = createDescriptionRenderFactory(Description) describe('EscrowFinishDescription', () => { it('renders description for EscrowFinish', () => { renderComponent(EscrowFinish) - expect(wrapper.html()).toBe( + expect(screen.html()).toBe( '
escrow_completion_desc
The escrowed amount of\uE9000.0154XRPwas delivered to (\uE9000.015388XRP escrow_after_transaction_cost)
The escrow was created bywith transaction3E2E75...
escrow_finish_fullfillment_desc Fulfillment
', ) }) diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx index 409bcc189..43c927d26 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx @@ -1,5 +1,5 @@ -import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { cleanup, screen } from '@testing-library/react' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockEscrowFinish from './mock_data/EscrowFinish.json' @@ -8,10 +8,10 @@ const renderComponent = createSimpleRenderFactory(Simple) describe('EscrowFinishSimple', () => { it('renders with an expiration and offer', () => { renderComponent(mockEscrowFinish) - expect(wrapper.find('[data-testid="escrow-amount"] .value')).toHaveText( + expect(screen.find('[data-testid="escrow-amount"] .value')).toHaveText( `\uE9000.0154 XRP`, ) - expect(wrapper.find('[data-testid="escrow-tx"] .value')).toHaveText( + expect(screen.find('[data-testid="escrow-tx"] .value')).toHaveText( `3E2E755FA75FF1020C39E2ECC407E9F1C0E49A7229EDD15FF93B9F869878F1CC`, ) }) diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx index b6182475e..7fbacc8eb 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx @@ -8,13 +8,13 @@ const renderComponent = createTableDetailRenderFactory(TableDetail) describe('EscrowFinishTableDetail', () => { it('renders EscrowFinish without crashing', () => { renderComponent(mockEscrowFinish) - expect(wrapper.find('[data-testid="escrow-account"]')).toHaveText( + expect(screen.find('[data-testid="escrow-account"]')).toHaveText( `finish_escrowr4UDXF4nL7Tgss8uQxn39cCocd8GnGyXS8 -28`, ) - expect(wrapper.find('[data-testid="escrow-amount"]')).toHaveText( + expect(screen.find('[data-testid="escrow-amount"]')).toHaveText( `\uE9000.0154 XRP`, ) - expect(wrapper.find('[data-testid="escrow-fullfillment"]')).toHaveText( + expect(screen.find('[data-testid="escrow-fullfillment"]')).toHaveText( `fulfillment Fulfillment `, ) }) diff --git a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx index c350e9876..4034264ea 100644 --- a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx @@ -1,6 +1,5 @@ import { cleanup, screen } from '@testing-library/react' import { createSimpleRenderFactory } from '../../test/createRenderFactory' -import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import transactionBuy from './mock_data/NFTokenAcceptOffer_Buy.json' import transactionSell from './mock_data/NFTokenAcceptOffer_Sell.json' @@ -15,61 +14,61 @@ describe('NFTokenAcceptOffer', () => { renderComponent(transactionBuy) expectSimpleRowText( - wrapper, + screen, 'token-id', '000800006203F49C21D5D6E022CB16DE3538F248662FC73C29ABA6A90000000D', ) expectSimpleRowText( - wrapper, + screen, 'offer-id', '8278760A246D4464EE701D503091B9DB0D9790DD2BBE9CAABCA45B04A1A25B6B', ) - expectSimpleRowText(wrapper, 'amount', '\uE9000.0001 XRP') - expectSimpleRowText(wrapper, 'buyer', 'rfFRmXUR1yfxeUfXj7WwKhETrtToYx1hYh') - expectSimpleRowText(wrapper, 'seller', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g') + expectSimpleRowText(screen, 'amount', '\uE9000.0001 XRP') + expectSimpleRowText(screen, 'buyer', 'rfFRmXUR1yfxeUfXj7WwKhETrtToYx1hYh') + expectSimpleRowText(screen, 'seller', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g') }) it('handles NFTokenAcceptOffer Sell simple view ', () => { renderComponent(transactionSell) expectSimpleRowText( - wrapper, + screen, 'token-id', '000800006203F49C21D5D6E022CB16DE3538F248662FC73C216B9CBF00000023', ) expectSimpleRowText( - wrapper, + screen, 'offer-id', '505E7F1E1EA989C0B0196AB7F503ACACAC7A9640C27B58A5E3C9DD31E88848D4', ) - expectSimpleRowText(wrapper, 'amount', '\uE9000.000102 XRP') - expectSimpleRowText(wrapper, 'buyer', 'rfFRmXUR1yfxeUfXj7WwKhETrtToYx1hYh') - expectSimpleRowText(wrapper, 'seller', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g') + expectSimpleRowText(screen, 'amount', '\uE9000.000102 XRP') + expectSimpleRowText(screen, 'buyer', 'rfFRmXUR1yfxeUfXj7WwKhETrtToYx1hYh') + expectSimpleRowText(screen, 'seller', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g') }) it('handles NFTokenAcceptOffer Sell Failure simple view ', () => { renderComponent(transactionFailure) expectSimpleRowText( - wrapper, + screen, 'offer-id', '17AFFE8C8D94554EB3A31A517B05C16085777FAEA9ACEDDCDE9D7CFD7B988D01', ) - expectSimpleRowNotToExist(wrapper, 'token-id') - expectSimpleRowNotToExist(wrapper, 'amount') - expectSimpleRowNotToExist(wrapper, 'buyer') - expectSimpleRowNotToExist(wrapper, 'seller') + expectSimpleRowNotToExist(screen, 'token-id') + expectSimpleRowNotToExist(screen, 'amount') + expectSimpleRowNotToExist(screen, 'buyer') + expectSimpleRowNotToExist(screen, 'seller') }) it('handles NFTokenAcceptOffer from Broker simple view ', () => { renderComponent(transactionBroker) expectSimpleRowText( - wrapper, + screen, 'token-id', '00081B581189F5687DBB7516339D6CCB5593D96622AD82DF08CFDA8600000A17', ) - expect(wrapper.find('[data-testid="offer-id"] .value').length).toBe(2) - expectSimpleRowText(wrapper, 'amount', '\uE9002,500.00 XRP') - expectSimpleRowText(wrapper, 'buyer', 'rNYKGnHrjSnKXQGgACciyCLg4xRcwWZixN') - expectSimpleRowText(wrapper, 'seller', 'rnp9DA6H2tLH7YFkgpjoVREB2yccYv56Sg') + expect(screen.find('[data-testid="offer-id"] .value').length).toBe(2) + expectSimpleRowText(screen, 'amount', '\uE9002,500.00 XRP') + expectSimpleRowText(screen, 'buyer', 'rNYKGnHrjSnKXQGgACciyCLg4xRcwWZixN') + expectSimpleRowText(screen, 'seller', 'rnp9DA6H2tLH7YFkgpjoVREB2yccYv56Sg') }) }) diff --git a/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx index e5268ed84..1c05dfd69 100644 --- a/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx @@ -14,20 +14,20 @@ describe('NFTokenBurn', () => { it('handles NFTokenBurn simple view ', () => { renderComponent(transaction) expectSimpleRowText( - wrapper, + screen, 'token-id', '000800006203F49C21D5D6E022CB16DE3538F248662FC73C29ABA6A90000000D', ) - expectSimpleRowNotToExist(wrapper, 'owner') + expectSimpleRowNotToExist(screen, 'owner') }) it('handles NFTokenBurn when the burner is not the owner', () => { renderComponent(transactionByIssuer) expectSimpleRowText( - wrapper, + screen, 'token-id', '00090000DF7682C6F61329B887798E2ABB518BF1C923F4010000099B00000000', ) - expectSimpleRowText(wrapper, 'owner', 'rH3Jr1zwADrokm2niuJLEAD5NuoVwBvzpk') + expectSimpleRowText(screen, 'owner', 'rH3Jr1zwADrokm2niuJLEAD5NuoVwBvzpk') }) }) diff --git a/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx index d8bebf33e..9c32d4e5f 100644 --- a/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx @@ -10,7 +10,7 @@ import { queryClient } from '../../../../QueryClient' describe('NFTokenCancelOffer', () => { it.only('handles NFTokenCancelOffer simple view ', () => { - const wrapper = mount( + const screen = mount( @@ -21,16 +21,16 @@ describe('NFTokenCancelOffer', () => { , ) - expect(wrapper.find('[data-testid="token-id"] .value')).toHaveText( + expect(screen.find('[data-testid="token-id"] .value')).toHaveText( '000800006203F49C21D5D6E022CB16DE3538F248662FC73C258BA1B200000018', ) - expect(wrapper.find('[data-testid="offer-id"] .value')).toHaveText( + expect(screen.find('[data-testid="offer-id"] .value')).toHaveText( '35F3D6D99548FA5F5315580FBF8BA6B15CAA2CAE93023D5CE4FDC130602BC5C3', ) - expect(wrapper.find('[data-testid="amount"] .value')).toHaveText( + expect(screen.find('[data-testid="amount"] .value')).toHaveText( '$100.00 USD.r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g', ) - expect(wrapper.find('[data-testid="offerer"] .value')).toHaveText( + expect(screen.find('[data-testid="offerer"] .value')).toHaveText( 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g', ) }) diff --git a/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx index 09b8559b0..b840ec306 100644 --- a/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx @@ -12,73 +12,73 @@ describe('NFTokenCreateOffer', () => { it('handles NFTokenCreateOffer buy simple view ', () => { renderComponent(transactionBuy) expectSimpleRowText( - wrapper, + screen, 'token-id', '000800006203F49C21D5D6E022CB16DE3538F248662FC73C2DCBAB9D00000002', ) expectSimpleRowText( - wrapper, + screen, 'offer-id', '3D1C297DA5B831267CCF692F8A023688D6A4BD5AFAE9A746D5C4E0B15D256B29', ) - expectSimpleRowText(wrapper, 'owner', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g') - expectSimpleRowText(wrapper, 'amount', '\uE9000.0001 XRP') - expect(wrapper.find('[data-testid="buyer-or-seller"] .label')).toHaveText( + expectSimpleRowText(screen, 'owner', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g') + expectSimpleRowText(screen, 'amount', '\uE9000.0001 XRP') + expect(screen.find('[data-testid="buyer-or-seller"] .label')).toHaveText( 'buyer', ) expectSimpleRowText( - wrapper, + screen, 'buyer-or-seller', 'rfFRmXUR1yfxeUfXj7WwKhETrtToYx1hYh', ) - expect(wrapper.find('[data-testid="destination"] .value')).not.toExist() + expect(screen.find('[data-testid="destination"] .value')).not.toExist() }) it('handles NFTokenCreateOffer sell simple view ', () => { renderComponent(transactionSell) expectSimpleRowText( - wrapper, + screen, 'token-id', '000800006203F49C21D5D6E022CB16DE3538F248662FC73C29ABA6A90000000D', ) expectSimpleRowText( - wrapper, + screen, 'offer-id', 'F660CA62E16B8067649052E8FCE947049FC6EF0D8B42EF7E5819997EC5AE45B6', ) - expect(wrapper.find('[data-testid="owner"] .value')).not.toExist() + expect(screen.find('[data-testid="owner"] .value')).not.toExist() expectSimpleRowText( - wrapper, + screen, 'amount', '$100.00 USD.r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g', ) - expect(wrapper.find('[data-testid="buyer-or-seller"] .label')).toHaveText( + expect(screen.find('[data-testid="buyer-or-seller"] .label')).toHaveText( 'seller', ) expectSimpleRowText( - wrapper, + screen, 'buyer-or-seller', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g', ) - expect(wrapper.find('[data-testid="destination"] .value')).not.toExist() + expect(screen.find('[data-testid="destination"] .value')).not.toExist() }) it('handles failed NFTokenCreateOffer transaction', () => { renderComponent(transactionFailed) expectSimpleRowText( - wrapper, + screen, 'token-id', '00080000AC7377C74DD53E77C8161537F5EBF56B0CE8FD3BD392C2B800001702', ) - expect(wrapper.find('[data-testid="offer-id"] .value')).not.toExist() - expect(wrapper.find('[data-testid="owner"] .value')).not.toExist() - expectSimpleRowText(wrapper, 'amount', '\uE900500.00 XRP') + expect(screen.find('[data-testid="offer-id"] .value')).not.toExist() + expect(screen.find('[data-testid="owner"] .value')).not.toExist() + expectSimpleRowText(screen, 'amount', '\uE900500.00 XRP') }) it('handles NFTokenCreateOffer with destination', () => { renderComponent(transactionDestination) expectSimpleRowText( - wrapper, + screen, 'destination', 'rpdUbED32X3YXRPBGzSv8gMTJE66t3sji9', ) diff --git a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx index 0142dd54a..19cb7f8a2 100644 --- a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx @@ -17,7 +17,7 @@ import { expectSimpleRowText, expectSimpleRowNotToExist } from '../../test' describe('NFTokenMint', () => { it('handles NFTokenMint that modified 2 nodes', () => { - const wrapper = mount( + const screen = mount( { ) expectSimpleRowText( - wrapper, + screen, 'token-id', '000800006203F49C21D5D6E022CB16DE3538F248662FC73C535743B40000001A', ) - expectSimpleRowText(wrapper, 'token-taxon', '1') - expectSimpleRowText(wrapper, 'token-uri', 'https://gregweisbrod.com') - expectSimpleRowNotToExist(wrapper, 'token-fee') - expectSimpleRowNotToExist(wrapper, 'token-issuer') + expectSimpleRowText(screen, 'token-taxon', '1') + expectSimpleRowText(screen, 'token-uri', 'https://gregweisbrod.com') + expectSimpleRowNotToExist(screen, 'token-fee') + expectSimpleRowNotToExist(screen, 'token-issuer') }) it('handles NFTokenMint that modified 1 node and created 1 node', () => { - const wrapper = mount( + const screen = mount( { ) expectSimpleRowText( - wrapper, + screen, 'token-id', '0008000085D33F9C5481D3515029C9904D16F0109414D3A00000099A00000000', ) - expectSimpleRowText(wrapper, 'token-taxon', '1') - expectSimpleRowText(wrapper, 'token-uri', 'https://gregweisbrod.com') - expectSimpleRowNotToExist(wrapper, 'token-fee') - expectSimpleRowNotToExist(wrapper, 'token-issuer') + expectSimpleRowText(screen, 'token-taxon', '1') + expectSimpleRowText(screen, 'token-uri', 'https://gregweisbrod.com') + expectSimpleRowNotToExist(screen, 'token-fee') + expectSimpleRowNotToExist(screen, 'token-issuer') }) it('handles NFTokenMint that modified 2 nodes and created 1 node', () => { - const wrapper = mount( + const screen = mount( { ) expectSimpleRowText( - wrapper, + screen, 'token-id', '0008000085D33F9C5481D3515029C9904D16F0109414D3A0DCBA29BA00000020', ) - expectSimpleRowText(wrapper, 'token-taxon', '1') - expectSimpleRowText(wrapper, 'token-uri', 'https://gregweisbrod.com') - expectSimpleRowNotToExist(wrapper, 'token-fee') - expectSimpleRowNotToExist(wrapper, 'token-issuer') + expectSimpleRowText(screen, 'token-taxon', '1') + expectSimpleRowText(screen, 'token-uri', 'https://gregweisbrod.com') + expectSimpleRowNotToExist(screen, 'token-fee') + expectSimpleRowNotToExist(screen, 'token-issuer') }) it('handles NFTokenMint with issuer', () => { - const wrapper = mount( + const screen = mount( { , ) - expect(wrapper.find('[data-testid="token-issuer"] .value')).toExist() + expect(screen.find('[data-testid="token-issuer"] .value')).toExist() expectSimpleRowText( - wrapper, + screen, 'token-id', '000861A8A99B4460C2A4CCC90634FD9C7F51940AD9450BE30000099B00000000', ) - expectSimpleRowText(wrapper, 'token-taxon', '0') + expectSimpleRowText(screen, 'token-taxon', '0') expectSimpleRowText( - wrapper, + screen, 'token-uri', 'ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi', ) - expectSimpleRowText(wrapper, 'token-fee', '25.000%') + expectSimpleRowText(screen, 'token-fee', '25.000%') expectSimpleRowText( - wrapper, + screen, 'token-issuer', 'rGToUZ1JjRUdv1wXNXKMFn2o4wTM2DLkpg', ) }) it('handles NFTokenMint that modified 3 nodes', () => { - const wrapper = mount( + const screen = mount( { ) expectSimpleRowText( - wrapper, + screen, 'token-id', '000D0000B9BD7D214128A91ECECE5FCFF9BDB0D043567C51CFBEC443000063A7', ) - expectSimpleRowText(wrapper, 'token-taxon', '1') + expectSimpleRowText(screen, 'token-taxon', '1') expectSimpleRowText( - wrapper, + screen, 'token-uri', convertHexToString( '516D5071416B3677777577796A71654C476F64665253375156774677394346736A6D363375485661556438387463', @@ -146,7 +146,7 @@ describe('NFTokenMint', () => { }) it('handles NFTokenMint that has null URI', () => { - const wrapper = mount( + const screen = mount( { , ) - expectSimpleRowNotToExist(wrapper, 'token-uri') + expectSimpleRowNotToExist(screen, 'token-uri') }) it('handles NFTokenMint that failed', () => { - const wrapper = mount( + const screen = mount( { , ) - expectSimpleRowNotToExist(wrapper, 'token-id') - expectSimpleRowText(wrapper, 'token-taxon', '19') + expectSimpleRowNotToExist(screen, 'token-id') + expectSimpleRowText(screen, 'token-taxon', '19') expectSimpleRowText( - wrapper, + screen, 'token-uri', convertHexToString( '516D5071416B3677777577796A71654C476F64665253375156774677394346736A6D363375485661556438387463', diff --git a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx index bce27f634..6d22d2259 100644 --- a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx @@ -10,7 +10,7 @@ describe('OfferCancel: Description', () => { it('renders', () => { renderComponent(offerCancel) - expect(wrapper.find('[data-testid="cancel-line"]')).toHaveText( + expect(screen.find('[data-testid="cancel-line"]')).toHaveText( 'offer_cancel_description15239384', ) }) diff --git a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateSimple.test.tsx b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateSimple.test.tsx index 1f94935ba..4fa443a6e 100644 --- a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateSimple.test.tsx @@ -10,6 +10,6 @@ describe('OfferCancel: Simple', () => { it('renders', () => { renderComponent(offerCancel) - expectSimpleRowText(wrapper, 'cancel', '#15239384') + expectSimpleRowText(screen, 'cancel', '#15239384') }) }) diff --git a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx index 8270131e5..c8cf75cfa 100644 --- a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx @@ -10,6 +10,6 @@ describe('OfferCancel: TableDetail', () => { it('renders', () => { renderComponent(offerCancel) - expect(wrapper).toHaveText('cancel_offer #15239384') + expect(screen).toHaveText('cancel_offer #15239384') }) }) diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx index 3e31893a5..b0900966a 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx @@ -11,7 +11,7 @@ describe('OfferCreate: Description', () => { it('renders description for transaction with cancel and expiration', () => { renderComponent(OfferCreate) - expect(wrapper.html()).toBe( + expect(screen.html()).toBe( '
The accountoffered to pay1,080,661.95882CSCin order to receive\uE9001,764.293151XRP
offer_create_desc_line_2 612.52XRP/CSC
offer_create_desc_line_3 44866443
The offer expiresMay 18, 2022 at 5:28:16 PM UTCunless cancelled before', ) }) @@ -19,7 +19,7 @@ describe('OfferCreate: Description', () => { it('renders description for transaction with inverted currencies', () => { renderComponent(OfferCreateInvertedCurrencies) - expect(wrapper.html()).toBe( + expect(screen.html()).toBe( '
The accountoffered to pay\uE90017,588.363594XRPin order to receive$6,101.33033905USD
offer_create_desc_line_2 0.34690XRP/USD
offer_create_desc_line_3 80543309
', ) }) diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx index 4ecadf54b..385a32a9e 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx @@ -1,8 +1,8 @@ +import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockOfferCreateWithCancel from './mock_data/OfferCreateWithExpirationAndCancel.json' import mockOfferCreate from './mock_data/OfferCreate.json' import { createSimpleRenderFactory } from '../../test/createRenderFactory' -import { cleanup, screen } from '@testing-library/react' const renderComponent = createSimpleRenderFactory(Simple) @@ -10,16 +10,16 @@ describe('OfferCreate: Simple', () => { afterEach(cleanup) it('renders with an expiration and offer', () => { renderComponent(mockOfferCreateWithCancel) - expect(wrapper.find('[data-testid="amount"] .one-line')).toHaveText( + expect(screen.find('[data-testid="amount"] .one-line')).toHaveText( '\uE900 XRP/CSC.rCSC', ) - expect(wrapper.find('[data-testid="cancel-id"] .value')).toHaveText( + expect(screen.find('[data-testid="cancel-id"] .value')).toHaveText( '#44866443', ) - expect(wrapper.find('[data-testid="amount-buy"] .value')).toHaveText( + expect(screen.find('[data-testid="amount-buy"] .value')).toHaveText( `\uE9001,764.293151 XRP`, ) - expect(wrapper.find('[data-testid="amount-sell"] .value')).toHaveText( + expect(screen.find('[data-testid="amount-sell"] .value')).toHaveText( `1,080,661.95882 CSC.rCSCManTZ8ME9EoLrSHHYKW8PPwWMgkwr`, ) }) @@ -27,11 +27,11 @@ describe('OfferCreate: Simple', () => { it('renders', () => { renderComponent(mockOfferCreate) - expect(wrapper.find('[data-testid="offer-id"] .value')).not.toExist() - expect(wrapper.find('[data-testid="amount-buy"] .value')).toHaveText( + expect(screen.find('[data-testid="offer-id"] .value')).not.toExist() + expect(screen.find('[data-testid="amount-buy"] .value')).toHaveText( `\uE90024,755.081083 XRP`, ) - expect(wrapper.find('[data-testid="amount-sell"] .value')).toHaveText( + expect(screen.find('[data-testid="amount-sell"] .value')).toHaveText( `51.41523894 BCH.rcyS4CeCZVYvTiKcxj6Sx32ibKwcDHLds`, ) }) diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx index 03a47b6a3..109d363e7 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx @@ -12,16 +12,16 @@ describe('OfferCreate: TableDetail', () => { it('renders with an expiration and offer', () => { renderComponent(mockOfferCreateWithCancel) - expect(wrapper.find('[data-testid="pair"]')).toHaveText( + expect(screen.find('[data-testid="pair"]')).toHaveText( 'price:612.518 \uE900 XRP/CSC.rCSC', ) - expect(wrapper.find('[data-testid="cancel-id"]')).toHaveText( + expect(screen.find('[data-testid="cancel-id"]')).toHaveText( 'cancel_offer #44866443', ) - expect(wrapper.find('[data-testid="amount-buy"]')).toHaveText( + expect(screen.find('[data-testid="amount-buy"]')).toHaveText( `\uE9001,764.293151 XRP`, ) - expect(wrapper.find('[data-testid="amount-sell"]')).toHaveText( + expect(screen.find('[data-testid="amount-sell"]')).toHaveText( `1,080,661.95882 CSC.rCSCManTZ8ME9EoLrSHHYKW8PPwWMgkwr`, ) }) @@ -29,14 +29,14 @@ describe('OfferCreate: TableDetail', () => { it('renders', () => { renderComponent(mockOfferCreate) - expect(wrapper.find('[data-testid="pair"]')).toHaveText( + expect(screen.find('[data-testid="pair"]')).toHaveText( 'price:0.00207696 \uE900 XRP/BCH.rcyS', ) - expect(wrapper.find('[data-testid="offer-id"]')).not.toExist() - expect(wrapper.find('[data-testid="amount-buy"]')).toHaveText( + expect(screen.find('[data-testid="offer-id"]')).not.toExist() + expect(screen.find('[data-testid="amount-buy"]')).toHaveText( `\uE90024,755.081083 XRP`, ) - expect(wrapper.find('[data-testid="amount-sell"]')).toHaveText( + expect(screen.find('[data-testid="amount-sell"]')).toHaveText( `51.41523894 BCH.rcyS4CeCZVYvTiKcxj6Sx32ibKwcDHLds`, ) }) @@ -44,7 +44,7 @@ describe('OfferCreate: TableDetail', () => { it('renders inverted currencies', () => { renderComponent(mockOfferCreateInvertedCurrencies) - expect(wrapper.find('[data-testid="pair"]')).toHaveText( + expect(screen.find('[data-testid="pair"]')).toHaveText( 'price:0.346896 \uE900 XRP/USD.rvYA', ) }) diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx index f99864812..7fab9daa8 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx @@ -17,15 +17,15 @@ describe('Payment: Description', () => { it('renders', () => { renderComponent(mockPayment) - expect(wrapper.find('[data-testid="from-to-line"]')).toHaveText( + expect(screen.find('[data-testid="from-to-line"]')).toHaveText( `The payment is from rNQEMJA4PsoSrZRn9J6RajAYhcDzzhf8ok to rHoPwMC75KVUhBMeV3uDMybKG5JND74teh`, ) - expect(wrapper.find('[data-testid="source-tag-line"]')).not.toExist() - expect(wrapper.find('[data-testid="destination-tag-line"]')).not.toExist() - expect(wrapper.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.find('[data-testid="source-tag-line"]')).not.toExist() + expect(screen.find('[data-testid="destination-tag-line"]')).not.toExist() + expect(screen.find('[data-testid="amount-line"]')).toHaveText( `It was instructed to deliver \uE9002,421.8268 XRP`, ) - expect(wrapper.find('[data-testid="delivered-line"]')).toHaveText( + expect(screen.find('[data-testid="delivered-line"]')).toHaveText( `The actual amount delivered was \uE9002,421.8268 XRP`, ) }) @@ -33,31 +33,31 @@ describe('Payment: Description', () => { it('renders with failed partial conversion', () => { renderComponent(mockPaymentConvert) - expect(wrapper.find('[data-testid="from-to-line"]')).toHaveText( + expect(screen.find('[data-testid="from-to-line"]')).toHaveText( `The payment is from r9x5PHDiwuvbpYB3uvGAqEUVV5wxHayQEx to r9x5PHDiwuvbpYB3uvGAqEUVV5wxHayQEx`, ) - expect(wrapper.find('[data-testid="source-tag-line"]')).not.toExist() - expect(wrapper.find('[data-testid="destination-tag-line"]')).not.toExist() - expect(wrapper.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.find('[data-testid="source-tag-line"]')).not.toExist() + expect(screen.find('[data-testid="destination-tag-line"]')).not.toExist() + expect(screen.find('[data-testid="amount-line"]')).toHaveText( `It was instructed to deliver up to 1,140.00 YCN.r8HgVGenRTAiNSM5iqt9PX2D2EczFZhZr by spending up to \uE9001,140.00 XRP`, ) - expect(wrapper.find('[data-testid="delivered-line"]')).not.toExist() + expect(screen.find('[data-testid="delivered-line"]')).not.toExist() }) it('renders with destination tag', () => { renderComponent(mockPaymentDestinationTag) - expect(wrapper.find('[data-testid="from-to-line"]')).toHaveText( + expect(screen.find('[data-testid="from-to-line"]')).toHaveText( `The payment is from rDAE53VfMvftPB4ogpWGWvzkQxfht6JPxr to rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt`, ) - expect(wrapper.find('[data-testid="source-tag-line"]')).not.toExist() - expect(wrapper.find('[data-testid="destination-tag-line"]')).toHaveText( + expect(screen.find('[data-testid="source-tag-line"]')).not.toExist() + expect(screen.find('[data-testid="destination-tag-line"]')).toHaveText( `The destination tag is 381702`, ) - expect(wrapper.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.find('[data-testid="amount-line"]')).toHaveText( `It was instructed to deliver \uE9001,531.267 XRP`, ) - expect(wrapper.find('[data-testid="delivered-line"]')).toHaveText( + expect(screen.find('[data-testid="delivered-line"]')).toHaveText( `The actual amount delivered was \uE9001,531.267 XRP`, ) }) @@ -65,17 +65,17 @@ describe('Payment: Description', () => { it('renders with send max', () => { renderComponent(mockPaymentSendMax) - expect(wrapper.find('[data-testid="from-to-line"]')).toHaveText( + expect(screen.find('[data-testid="from-to-line"]')).toHaveText( `The payment is from r3RaNVLvWjqqtFAawC6jbRhgKyFH7HvRS8 to rprcTynT68nYdKzDTefAZG9HjSHiYcnP4b`, ) - expect(wrapper.find('[data-testid="destination-tag-line"]')).toHaveText( + expect(screen.find('[data-testid="destination-tag-line"]')).toHaveText( `The destination tag is 0`, ) - expect(wrapper.find('[data-testid="source-tag-line"]')).not.toExist() - expect(wrapper.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.find('[data-testid="source-tag-line"]')).not.toExist() + expect(screen.find('[data-testid="amount-line"]')).toHaveText( `It was instructed to deliver 17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA by spending up to 17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA`, ) - expect(wrapper.find('[data-testid="delivered-line"]')).toHaveText( + expect(screen.find('[data-testid="delivered-line"]')).toHaveText( `The actual amount delivered was 17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA`, ) }) @@ -83,17 +83,17 @@ describe('Payment: Description', () => { it('renders with partial', () => { renderComponent(mockPaymentPartial) - expect(wrapper.find('[data-testid="from-to-line"]')).toHaveText( + expect(screen.find('[data-testid="from-to-line"]')).toHaveText( `The payment is from rGTurN94Nn3RkJGSqy9MwmQCLpXZkELbnq to rMQ4oGC8fasuJwfdrfknFTttDbf8cR3D2j`, ) - expect(wrapper.find('[data-testid="destination-tag-line"]')).toHaveText( + expect(screen.find('[data-testid="destination-tag-line"]')).toHaveText( `The destination tag is 0`, ) - expect(wrapper.find('[data-testid="source-tag-line"]')).not.toExist() - expect(wrapper.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.find('[data-testid="source-tag-line"]')).not.toExist() + expect(screen.find('[data-testid="amount-line"]')).toHaveText( `It was instructed to deliver up to 0.001043 xCoin.rXCoYSUnkpygdtfpz3Df8dKQuRZjM9UFi`, ) - expect(wrapper.find('[data-testid="delivered-line"]')).toHaveText( + expect(screen.find('[data-testid="delivered-line"]')).toHaveText( `The actual amount delivered was 0.00104196 xCoin.rXCoYSUnkpygdtfpz3Df8dKQuRZjM9UFi`, ) }) @@ -101,10 +101,10 @@ describe('Payment: Description', () => { it('renders with SourceTag', () => { renderComponent(mockPaymentSourceTag) - expect(wrapper.find('[data-testid="source-tag-line"]')).toHaveText( + expect(screen.find('[data-testid="source-tag-line"]')).toHaveText( `The source tag is 20648`, ) - expect(wrapper.find('[data-testid="destination-tag-line"]')).toHaveText( + expect(screen.find('[data-testid="destination-tag-line"]')).toHaveText( `The destination tag is 412453880`, ) }) diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx index 061b3ed30..ca2ccc606 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx @@ -26,11 +26,11 @@ describe('Payment: Simple', () => { it('renders', () => { renderComponent(mockPayment) - expectSimpleRowText(wrapper, 'amount', `\uE9002,421.8268 XRP`) - expectSimpleRowLabel(wrapper, 'amount', `send`) + expectSimpleRowText(screen, 'amount', `\uE9002,421.8268 XRP`) + expectSimpleRowLabel(screen, 'amount', `send`) expectSimpleRowText( - wrapper, + screen, 'destination', `rHoPwMC75KVUhBMeV3uDMybKG5JND74teh`, ) @@ -39,27 +39,27 @@ describe('Payment: Simple', () => { it('renders with failed partial conversion', () => { renderComponent(mockPaymentConvert) - expectSimpleRowLabel(wrapper, 'max', `convert_maximum`) - expectSimpleRowText(wrapper, 'max', `\uE9001,140.00 XRP`) + expectSimpleRowLabel(screen, 'max', `convert_maximum`) + expectSimpleRowText(screen, 'max', `\uE9001,140.00 XRP`) - expectSimpleRowLabel(wrapper, 'amount', `convert_to`) + expectSimpleRowLabel(screen, 'amount', `convert_to`) expectSimpleRowText( - wrapper, + screen, 'amount', `0.00 YCN.r8HgVGenRTAiNSM5iqt9PX2D2EczFZhZrpartial_payment_allowed`, ) - expect(wrapper.find('[data-testid="destination"]')).not.toExist() + expect(screen.find('[data-testid="destination"]')).not.toExist() }) it('renders with destination tag', () => { renderComponent(mockPaymentDestinationTag) - expectSimpleRowText(wrapper, 'amount', `\uE9001,531.267 XRP`) - expectSimpleRowLabel(wrapper, 'amount', `send`) + expectSimpleRowText(screen, 'amount', `\uE9001,531.267 XRP`) + expectSimpleRowLabel(screen, 'amount', `send`) expectSimpleRowText( - wrapper, + screen, 'destination', `rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt:381702`, ) @@ -69,21 +69,21 @@ describe('Payment: Simple', () => { renderComponent(mockPaymentSendMax) expectSimpleRowText( - wrapper, + screen, 'max', `17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA`, ) - expectSimpleRowLabel(wrapper, 'max', `using_at_most`) + expectSimpleRowLabel(screen, 'max', `using_at_most`) expectSimpleRowText( - wrapper, + screen, 'amount', `17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA`, ) - expectSimpleRowLabel(wrapper, 'amount', `send`) + expectSimpleRowLabel(screen, 'amount', `send`) expectSimpleRowText( - wrapper, + screen, 'destination', `rprcTynT68nYdKzDTefAZG9HjSHiYcnP4b:0`, ) @@ -93,14 +93,14 @@ describe('Payment: Simple', () => { renderComponent(mockPaymentPartial) expectSimpleRowText( - wrapper, + screen, 'amount', `0.00104196 xCoin.rXCoYSUnkpygdtfpz3Df8dKQuRZjM9UFipartial_payment_allowed`, ) - expectSimpleRowLabel(wrapper, 'amount', `delivered`) + expectSimpleRowLabel(screen, 'amount', `delivered`) expectSimpleRowText( - wrapper, + screen, 'destination', `rMQ4oGC8fasuJwfdrfknFTttDbf8cR3D2j:0`, ) @@ -109,7 +109,7 @@ describe('Payment: Simple', () => { it('renders with SourceTag', () => { renderComponent(mockPaymentSourceTag) - expectSimpleRowText(wrapper, 'source-tag', `20648`) + expectSimpleRowText(screen, 'source-tag', `20648`) }) it('renders direct MPT payment', () => { diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx index 3bd5fea65..fa2c49b2c 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx @@ -16,7 +16,7 @@ describe('Payment: TableDetail', () => { renderComponent(mockPayment) // styling makes this look okay - expect(wrapper.find('.payment')).toHaveText( + expect(screen.find('.payment')).toHaveText( `send\uE9002,421.8268 XRPtorHoPwMC75KVUhBMeV3uDMybKG5JND74teh`, ) }) @@ -25,7 +25,7 @@ describe('Payment: TableDetail', () => { renderComponent(mockPaymentConvert) // styling makes this look okay - expect(wrapper.find('.payment')).toHaveText( + expect(screen.find('.payment')).toHaveText( `convert_maximum1,140.00 XRPto0.00 YCN.r8HgVGenRTAiNSM5iqt9PX2D2EczFZhZrpartial_payment_allowed`, ) }) @@ -34,7 +34,7 @@ describe('Payment: TableDetail', () => { renderComponent(mockPaymentDestinationTag) // styling makes this look okay - expect(wrapper.find('.payment')).toHaveText( + expect(screen.find('.payment')).toHaveText( `send1,531.267 XRPtorHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt:381702`, ) }) @@ -43,7 +43,7 @@ describe('Payment: TableDetail', () => { renderComponent(mockPaymentSendMax) // styling makes this look okay - expect(wrapper.find('.payment')).toHaveText( + expect(screen.find('.payment')).toHaveText( `send17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjAtorprcTynT68nYdKzDTefAZG9HjSHiYcnP4b:0`, ) }) @@ -52,7 +52,7 @@ describe('Payment: TableDetail', () => { renderComponent(mockPaymentPartial) // styling makes this look okay - expect(wrapper.find('.payment')).toHaveText( + expect(screen.find('.payment')).toHaveText( `send0.00104196 xCoin.rXCoYSUnkpygdtfpz3Df8dKQuRZjM9UFitorMQ4oGC8fasuJwfdrfknFTttDbf8cR3D2j:0partial_payment_allowed`, ) }) @@ -60,6 +60,6 @@ describe('Payment: TableDetail', () => { it('renders with SourceTag', () => { renderComponent(mockPaymentSourceTag) - expect(wrapper.find('.st')).toHaveText('source_tag: 20648') + expect(screen.find('.st')).toHaveText('source_tag: 20648') }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx index 4710094ad..8dcedb091 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx @@ -1,7 +1,7 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createDescriptionRenderFactory } from '../../test/createRenderFactory' -import { cleanup, screen } from '@testing-library/react' import mockPaymentChannelClaim from './mock_data/PaymentChannelClaim.json' import mockPaymentChannelClaimClosed from './mock_data/PaymentChannelClaimClosed.json' import mockPaymentChannelClaimCloseDenied from './mock_data/PaymentChannelClaimCloseDenied.json' @@ -14,55 +14,55 @@ describe('PaymentChannelClaim: Description', () => { afterEach(cleanup) it('renders a claim', () => { renderComponent(mockPaymentChannelClaim) - expect(wrapper.find('[data-testid="account-line"]')).toHaveText( + expect(screen.find('[data-testid="account-line"]')).toHaveText( `The transaction was initiated by rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN`, ) - expect(wrapper.find('[data-testid="channel-line"]')).toHaveText( + expect(screen.find('[data-testid="channel-line"]')).toHaveText( `It will update the payment channel 50107651E7163E294CE0EAD8A20BF7CC046304480FCC9C74A49FFAB3F46FB98E`, ) - expect(wrapper.find('[data-testid="balance-line"]')).toHaveText( + expect(screen.find('[data-testid="balance-line"]')).toHaveText( `The channel balance claimed is \uE90049.65716XRP (increased by \uE9000.01XRP)`, ) - expect(wrapper.find('[data-testid="closed-line"]')).not.toExist() + expect(screen.find('[data-testid="closed-line"]')).not.toExist() }) it('renders tx with channel being closed', () => { renderComponent(mockPaymentChannelClaimClosed) - expect(wrapper.find('[data-testid="account-line"]')).toHaveText( + expect(screen.find('[data-testid="account-line"]')).toHaveText( `The transaction was initiated by rH11fDGhbVH5NVXNXkGAMTmfWhUHjCtA3B`, ) - expect(wrapper.find('[data-testid="channel-line"]')).toHaveText( + expect(screen.find('[data-testid="channel-line"]')).toHaveText( `It will update the payment channel 3BDB4F92432BCEB2385D3BAA60E8AAEC9B552890A240AEE4AA9E88C9E6C517E8`, ) - expect(wrapper.find('[data-testid="balance-line"]')).not.toExist() - expect(wrapper.find('[data-testid="closed-line"]')).toHaveText( + expect(screen.find('[data-testid="balance-line"]')).not.toExist() + expect(screen.find('[data-testid="closed-line"]')).toHaveText( `The payment channel will be closed, any remaining balance will be returned to the source account`, ) }) it('renders tx requesting channel be closed but not closing it', () => { renderComponent(mockPaymentChannelClaimCloseDenied) - expect(wrapper.find('[data-testid="account-line"]')).toHaveText( + expect(screen.find('[data-testid="account-line"]')).toHaveText( `The transaction was initiated by rH11fDGhbVH5NVXNXkGAMTmfWhUHjCtA3B`, ) - expect(wrapper.find('[data-testid="channel-line"]')).toHaveText( + expect(screen.find('[data-testid="channel-line"]')).toHaveText( `It will update the payment channel 3BDB4F92432BCEB2385D3BAA60E8AAEC9B552890A240AEE4AA9E88C9E6C517E8`, ) - expect(wrapper.find('[data-testid="balance-line"]')).not.toExist() - expect(wrapper.find('[data-testid="closed-line"]')).not.toExist() + expect(screen.find('[data-testid="balance-line"]')).not.toExist() + expect(screen.find('[data-testid="closed-line"]')).not.toExist() }) it('renders tx with destination tag', () => { renderComponent(mockPaymentChannelClaimWithDestinationTag) - expect(wrapper.find('[data-testid="account-line"]')).toHaveText( + expect(screen.find('[data-testid="account-line"]')).toHaveText( `The transaction was initiated by rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn`, ) - expect(wrapper.find('[data-testid="channel-line"]')).toHaveText( + expect(screen.find('[data-testid="channel-line"]')).toHaveText( `It will update the payment channel 5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3`, ) - expect(wrapper.find('[data-testid="balance-line"]')).toHaveText( + expect(screen.find('[data-testid="balance-line"]')).toHaveText( `The channel balance claimed is \uE9001.00XRP (increased by \uE9001.00XRP)`, ) - expect(wrapper.find('[data-testid="closed-line"]')).not.toExist() + expect(screen.find('[data-testid="closed-line"]')).not.toExist() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx index de34f8581..71bc7e7c4 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx @@ -2,7 +2,6 @@ import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createSimpleRenderFactory } from '../../test/createRenderFactory' -import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockPaymentChannelClaim from './mock_data/PaymentChannelClaim.json' import mockPaymentChannelClaimClosed from './mock_data/PaymentChannelClaimClosed.json' @@ -20,103 +19,103 @@ describe('PaymentChannelClaim: Simple', () => { afterEach(cleanup) it('renders a claim', () => { renderComponent(mockPaymentChannelClaim) - expectSimpleRowLabel(wrapper, 'amount', 'channel amount') - expectSimpleRowText(wrapper, 'amount', '\uE90070.00 XRP') - expectSimpleRowLabel(wrapper, 'claimed', 'amount claimed') - expectSimpleRowText(wrapper, 'claimed', '\uE9000.01 XRP') - expectSimpleRowLabel(wrapper, 'total', 'total claimed') - expectSimpleRowText(wrapper, 'total', '\uE90049.65716 XRP') - expectSimpleRowLabel(wrapper, 'source', 'source') + expectSimpleRowLabel(screen, 'amount', 'channel amount') + expectSimpleRowText(screen, 'amount', '\uE90070.00 XRP') + expectSimpleRowLabel(screen, 'claimed', 'amount claimed') + expectSimpleRowText(screen, 'claimed', '\uE9000.01 XRP') + expectSimpleRowLabel(screen, 'total', 'total claimed') + expectSimpleRowText(screen, 'total', '\uE90049.65716 XRP') + expectSimpleRowLabel(screen, 'source', 'source') expectSimpleRowText( - wrapper, + screen, 'source', 'rnNzy3iPc7gPEAJbAdXwxY1UTBamBqTYhR:1002539517', ) - expectSimpleRowLabel(wrapper, 'destination', 'destination') + expectSimpleRowLabel(screen, 'destination', 'destination') expectSimpleRowText( - wrapper, + screen, 'destination', 'rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) - expectSimpleRowLabel(wrapper, '.channel', 'Channel ID') + expectSimpleRowLabel(screen, '.channel', 'Channel ID') expectSimpleRowText( - wrapper, + screen, '.channel', '50107651E7163E294CE0EAD8A20BF7CC046304480FCC9C74A49FFAB3F46FB98E', ) - expectSimpleRowNotToExist(wrapper, 'renew') - expectSimpleRowNotToExist(wrapper, 'close-request') - expectSimpleRowNotToExist(wrapper, 'closed') + expectSimpleRowNotToExist(screen, 'renew') + expectSimpleRowNotToExist(screen, 'close-request') + expectSimpleRowNotToExist(screen, 'closed') }) it('renders tx with channel being closed', () => { renderComponent(mockPaymentChannelClaimClosed) - expectSimpleRowText(wrapper, 'amount', '\uE90010.00 XRP') - expectSimpleRowNotToExist(wrapper, 'claimed') - expectSimpleRowText(wrapper, 'total', '\uE9000.34 XRP') + expectSimpleRowText(screen, 'amount', '\uE90010.00 XRP') + expectSimpleRowNotToExist(screen, 'claimed') + expectSimpleRowText(screen, 'total', '\uE9000.34 XRP') expectSimpleRowText( - wrapper, + screen, 'source', 'rH11fDGhbVH5NVXNXkGAMTmfWhUHjCtA3B:2647131528', ) expectSimpleRowText( - wrapper, + screen, 'destination', 'rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) expectSimpleRowText( - wrapper, + screen, '.channel', '3BDB4F92432BCEB2385D3BAA60E8AAEC9B552890A240AEE4AA9E88C9E6C517E8', ) - expectSimpleRowNotToExist(wrapper, 'renew') - expectSimpleRowText(wrapper, 'close-request', 'close channel request') - expectSimpleRowText(wrapper, 'closed', 'payment channel closed') + expectSimpleRowNotToExist(screen, 'renew') + expectSimpleRowText(screen, 'close-request', 'close channel request') + expectSimpleRowText(screen, 'closed', 'payment channel closed') }) it('renders tx requesting channel be closed but not closing it', () => { renderComponent(mockPaymentChannelClaimCloseDenied) - expectSimpleRowText(wrapper, 'amount', '\uE90010.00 XRP') - expectSimpleRowNotToExist(wrapper, 'claimed') - expectSimpleRowNotToExist(wrapper, 'total') + expectSimpleRowText(screen, 'amount', '\uE90010.00 XRP') + expectSimpleRowNotToExist(screen, 'claimed') + expectSimpleRowNotToExist(screen, 'total') expectSimpleRowText( - wrapper, + screen, 'source', 'rH11fDGhbVH5NVXNXkGAMTmfWhUHjCtA3B:2647131528', ) expectSimpleRowText( - wrapper, + screen, 'destination', 'rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) expectSimpleRowText( - wrapper, + screen, '.channel', '3BDB4F92432BCEB2385D3BAA60E8AAEC9B552890A240AEE4AA9E88C9E6C517E8', ) - expectSimpleRowNotToExist(wrapper, 'renew') - expectSimpleRowText(wrapper, 'close-request', 'close channel request') - expectSimpleRowNotToExist(wrapper, 'closed') + expectSimpleRowNotToExist(screen, 'renew') + expectSimpleRowText(screen, 'close-request', 'close channel request') + expectSimpleRowNotToExist(screen, 'closed') }) it('renders tx with destination tag', () => { renderComponent(mockPaymentChannelClaimWithDestinationTag) - expectSimpleRowText(wrapper, 'amount', '\uE900100.00 XRP') - expectSimpleRowText(wrapper, 'claimed', '\uE9001.00 XRP') - expectSimpleRowText(wrapper, 'total', '\uE9001.00 XRP') - expectSimpleRowText(wrapper, 'source', 'rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH') + expectSimpleRowText(screen, 'amount', '\uE900100.00 XRP') + expectSimpleRowText(screen, 'claimed', '\uE9001.00 XRP') + expectSimpleRowText(screen, 'total', '\uE9001.00 XRP') + expectSimpleRowText(screen, 'source', 'rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH') expectSimpleRowText( - wrapper, + screen, 'destination', 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn:20170428', ) expectSimpleRowText( - wrapper, + screen, '.channel', '5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3', ) - expectSimpleRowNotToExist(wrapper, 'renew') - expectSimpleRowNotToExist(wrapper, 'close-request') - expectSimpleRowNotToExist(wrapper, 'closed') + expectSimpleRowNotToExist(screen, 'renew') + expectSimpleRowNotToExist(screen, 'close-request') + expectSimpleRowNotToExist(screen, 'closed') }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx index 1897fca58..ebea4ee98 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx @@ -1,7 +1,7 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createTableDetailRenderFactory } from '../../test/createRenderFactory' -import { cleanup, screen } from '@testing-library/react' import { TableDetail } from '../TableDetail' import mockPaymentChannelClaim from './mock_data/PaymentChannelClaim.json' import mockPaymentChannelClaimClosed from './mock_data/PaymentChannelClaimClosed.json' @@ -14,75 +14,75 @@ describe('PaymentChannelClaim: TableDetail', () => { afterEach(cleanup) it('renders a claim', () => { renderComponent(mockPaymentChannelClaim) - expect(wrapper.find('[data-testid="source"]')).toHaveText( + expect(screen.find('[data-testid="source"]')).toHaveText( 'sourcernNzy3iPc7gPEAJbAdXwxY1UTBamBqTYhR:1002539517', ) - expect(wrapper.find('[data-testid="destination"]')).toHaveText( + expect(screen.find('[data-testid="destination"]')).toHaveText( 'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) - expect(wrapper.find('[data-testid="claimed"]')).toHaveText( + expect(screen.find('[data-testid="claimed"]')).toHaveText( 'claimed\uE9000.01 XRP (\uE90020.34284 XRP of \uE90070.00 XRP remaining)', ) - expect(wrapper.find('[data-testid="channel-amount"]')).not.toExist() - expect(wrapper.find('[data-testid="renew"]')).not.toExist() - expect(wrapper.find('[data-testid="close-request"]')).not.toExist() - expect(wrapper.find('[data-testid="closed"]')).not.toExist() + expect(screen.find('[data-testid="channel-amount"]')).not.toExist() + expect(screen.find('[data-testid="renew"]')).not.toExist() + expect(screen.find('[data-testid="close-request"]')).not.toExist() + expect(screen.find('[data-testid="closed"]')).not.toExist() }) it('renders tx with channel being closed', () => { renderComponent(mockPaymentChannelClaimClosed) - expect(wrapper.find('[data-testid="source"]')).toHaveText( + expect(screen.find('[data-testid="source"]')).toHaveText( 'sourcerH11fDGhbVH5NVXNXkGAMTmfWhUHjCtA3B:2647131528', ) - expect(wrapper.find('[data-testid="destination"]')).toHaveText( + expect(screen.find('[data-testid="destination"]')).toHaveText( 'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) - expect(wrapper.find('[data-testid="claimed"]')).not.toExist() - expect(wrapper.find('[data-testid="channel-amount"]')).toHaveText( + expect(screen.find('[data-testid="claimed"]')).not.toExist() + expect(screen.find('[data-testid="channel-amount"]')).toHaveText( 'channel amount\uE90010.00 XRP', ) - expect(wrapper.find('[data-testid="renew"]')).not.toExist() - expect(wrapper.find('[data-testid="close-request"]')).toHaveText( + expect(screen.find('[data-testid="renew"]')).not.toExist() + expect(screen.find('[data-testid="close-request"]')).toHaveText( 'close channel request', ) - expect(wrapper.find('[data-testid="closed"]')).toHaveText( + expect(screen.find('[data-testid="closed"]')).toHaveText( 'payment channel closed', ) }) it('renders tx requesting channel be closed but not closing it', () => { renderComponent(mockPaymentChannelClaimCloseDenied) - expect(wrapper.find('[data-testid="source"]')).toHaveText( + expect(screen.find('[data-testid="source"]')).toHaveText( 'sourcerH11fDGhbVH5NVXNXkGAMTmfWhUHjCtA3B:2647131528', ) - expect(wrapper.find('[data-testid="destination"]')).toHaveText( + expect(screen.find('[data-testid="destination"]')).toHaveText( 'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) - expect(wrapper.find('[data-testid="claimed"]')).not.toExist() - expect(wrapper.find('[data-testid="channel-amount"]')).toHaveText( + expect(screen.find('[data-testid="claimed"]')).not.toExist() + expect(screen.find('[data-testid="channel-amount"]')).toHaveText( 'channel amount\uE90010.00 XRP', ) - expect(wrapper.find('[data-testid="renew"]')).not.toExist() - expect(wrapper.find('[data-testid="close-request"]')).toHaveText( + expect(screen.find('[data-testid="renew"]')).not.toExist() + expect(screen.find('[data-testid="close-request"]')).toHaveText( 'close channel request', ) - expect(wrapper.find('[data-testid="closed"]')).not.toExist() + expect(screen.find('[data-testid="closed"]')).not.toExist() }) it('renders tx with destination tag', () => { renderComponent(mockPaymentChannelClaimWithDestinationTag) - expect(wrapper.find('[data-testid="source"]')).toHaveText( + expect(screen.find('[data-testid="source"]')).toHaveText( 'sourcerN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH', ) - expect(wrapper.find('[data-testid="destination"]')).toHaveText( + expect(screen.find('[data-testid="destination"]')).toHaveText( 'destinationrf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn:20170428', ) - expect(wrapper.find('[data-testid="claimed"]')).toHaveText( + expect(screen.find('[data-testid="claimed"]')).toHaveText( 'claimed\uE9001.00 XRP (\uE90099.00 XRP of \uE900100.00 XRP remaining)', ) - expect(wrapper.find('[data-testid="channel-amount"]')).not.toExist() - expect(wrapper.find('[data-testid="renew"]')).not.toExist() - expect(wrapper.find('[data-testid="close-request"]')).not.toExist() - expect(wrapper.find('[data-testid="closed"]')).not.toExist() + expect(screen.find('[data-testid="channel-amount"]')).not.toExist() + expect(screen.find('[data-testid="renew"]')).not.toExist() + expect(screen.find('[data-testid="close-request"]')).not.toExist() + expect(screen.find('[data-testid="closed"]')).not.toExist() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx index a3c7bfcd6..d87c7810b 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx @@ -13,50 +13,50 @@ describe('PaymentChannelCreate: Description', () => { afterEach(cleanup) it('renders', () => { renderComponent(mockPaymentChannelCreate) - expect(wrapper.find('[data-testid="accounts-line"]')).toHaveText( + expect(screen.find('[data-testid="accounts-line"]')).toHaveText( `The account rJnQrhRTXutuSwtrwxYiTkHn4Dtp8sF2LM:2460331042 will create a payment channel to rUXYat4hW2M87gHoqKK7fC4cqrT9C6V7d7`, ) - expect(wrapper.find('[data-testid="channel-line"]')).toHaveText( + expect(screen.find('[data-testid="channel-line"]')).toHaveText( `The channel ID is 15AB9EE9344C42C05164E6A1F2F08B35F35D7B9D66CCB9697452B0995C8F8242`, ) - expect(wrapper.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.find('[data-testid="amount-line"]')).toHaveText( `The channel amount is \uE9001.00 XRP`, ) - expect(wrapper.find('[data-testid="delay-line"]')).toHaveText( + expect(screen.find('[data-testid="delay-line"]')).toHaveText( `The channel has a settlement delay of 3,600 seconds`, ) - expect(wrapper.find('[data-testid="cancel-line"]')).not.toExist() + expect(screen.find('[data-testid="cancel-line"]')).not.toExist() }) it('renders failed tx', () => { renderComponent(mockPaymentChannelCreateFailed) - expect(wrapper.find('[data-testid="accounts-line"]')).toHaveText( + expect(screen.find('[data-testid="accounts-line"]')).toHaveText( `The account rMphibGfHpLDU4DzVCspzLYVuMNpmzN6n8:2810223114 will create a payment channel to rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN`, ) - expect(wrapper.find('[data-testid="channel-line"]')).not.toExist() - expect(wrapper.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.find('[data-testid="channel-line"]')).not.toExist() + expect(screen.find('[data-testid="amount-line"]')).toHaveText( `The channel amount is \uE90010.00 XRP`, ) - expect(wrapper.find('[data-testid="delay-line"]')).toHaveText( + expect(screen.find('[data-testid="delay-line"]')).toHaveText( `The channel has a settlement delay of 3,600 seconds`, ) - expect(wrapper.find('[data-testid="cancel-line"]')).not.toExist() + expect(screen.find('[data-testid="cancel-line"]')).not.toExist() }) it('renders tx with destination tag', () => { renderComponent(mockPaymentChannelCreateWithDestinationTag) - expect(wrapper.find('[data-testid="accounts-line"]')).toHaveText( + expect(screen.find('[data-testid="accounts-line"]')).toHaveText( `The account rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH will create a payment channel to rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn:20170428`, ) - expect(wrapper.find('[data-testid="channel-line"]')).toHaveText( + expect(screen.find('[data-testid="channel-line"]')).toHaveText( `The channel ID is 5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3`, ) - expect(wrapper.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.find('[data-testid="amount-line"]')).toHaveText( `The channel amount is \uE900100.00 XRP`, ) - expect(wrapper.find('[data-testid="delay-line"]')).toHaveText( + expect(screen.find('[data-testid="delay-line"]')).toHaveText( `The channel has a settlement delay of 86,400 seconds`, ) - expect(wrapper.find('[data-testid="cancel-line"]')).not.toExist() + expect(screen.find('[data-testid="cancel-line"]')).not.toExist() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx index 5594f06b2..c2125c4fd 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx @@ -18,25 +18,25 @@ describe('PaymentChannelCreate: Simple', () => { afterEach(cleanup) it('renders', () => { renderComponent(mockPaymentChannelCreate) - expectSimpleRowLabel(wrapper, 'amount', 'Amount') - expectSimpleRowText(wrapper, 'amount', '\uE9001.00 XRP') - expectSimpleRowLabel(wrapper, 'source', 'source') + expectSimpleRowLabel(screen, 'amount', 'Amount') + expectSimpleRowText(screen, 'amount', '\uE9001.00 XRP') + expectSimpleRowLabel(screen, 'source', 'source') expectSimpleRowText( - wrapper, + screen, 'source', 'rJnQrhRTXutuSwtrwxYiTkHn4Dtp8sF2LM:2460331042', ) - expectSimpleRowLabel(wrapper, 'destination', 'destination') + expectSimpleRowLabel(screen, 'destination', 'destination') expectSimpleRowText( - wrapper, + screen, 'destination', 'rUXYat4hW2M87gHoqKK7fC4cqrT9C6V7d7', ) - expectSimpleRowLabel(wrapper, 'delay', 'Settlement Delay') - expectSimpleRowText(wrapper, 'delay', '3,600 sec.') - expectSimpleRowLabel(wrapper, '.channel', 'Channel ID') + expectSimpleRowLabel(screen, 'delay', 'Settlement Delay') + expectSimpleRowText(screen, 'delay', '3,600 sec.') + expectSimpleRowLabel(screen, '.channel', 'Channel ID') expectSimpleRowText( - wrapper, + screen, '.channel', '15AB9EE9344C42C05164E6A1F2F08B35F35D7B9D66CCB9697452B0995C8F8242', ) @@ -44,33 +44,33 @@ describe('PaymentChannelCreate: Simple', () => { it('renders failed tx', () => { renderComponent(mockPaymentChannelCreateFailed) - expectSimpleRowText(wrapper, 'amount', '\uE90010.00 XRP') + expectSimpleRowText(screen, 'amount', '\uE90010.00 XRP') expectSimpleRowText( - wrapper, + screen, 'source', 'rMphibGfHpLDU4DzVCspzLYVuMNpmzN6n8:2810223114', ) expectSimpleRowText( - wrapper, + screen, 'destination', 'rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) - expectSimpleRowText(wrapper, 'delay', '3,600 sec.') - expectSimpleRowNotToExist(wrapper, '.channel') + expectSimpleRowText(screen, 'delay', '3,600 sec.') + expectSimpleRowNotToExist(screen, '.channel') }) it('renders tx with destination tag', () => { renderComponent(mockPaymentChannelCreateWithDestinationTag) - expectSimpleRowText(wrapper, 'amount', '\uE900100.00 XRP') - expectSimpleRowText(wrapper, 'source', 'rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH') + expectSimpleRowText(screen, 'amount', '\uE900100.00 XRP') + expectSimpleRowText(screen, 'source', 'rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH') expectSimpleRowText( - wrapper, + screen, 'destination', 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn:20170428', ) - expectSimpleRowText(wrapper, 'delay', '86,400 sec.') + expectSimpleRowText(screen, 'delay', '86,400 sec.') expectSimpleRowText( - wrapper, + screen, '.channel', '5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3', ) diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx index 146f1a700..1825706df 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx @@ -13,36 +13,34 @@ describe('PaymentChannelCreate: TableDetail', () => { afterEach(cleanup) it('renders', () => { renderComponent(mockPaymentChannelCreate) - expect(wrapper.find('[data-testid="source"]')).toHaveText( + expect(screen.find('[data-testid="source"]')).toHaveText( 'sourcerJnQrhRTXutuSwtrwxYiTkHn4Dtp8sF2LM:2460331042', ) - expect(wrapper.find('[data-testid="destination"]')).toHaveText( + expect(screen.find('[data-testid="destination"]')).toHaveText( 'destinationrUXYat4hW2M87gHoqKK7fC4cqrT9C6V7d7', ) - expect(wrapper.find('[data-testid="amount"]')).toHaveText('\uE9001.00 XRP') + expect(screen.find('[data-testid="amount"]')).toHaveText('\uE9001.00 XRP') }) it('renders failed tx', () => { renderComponent(mockPaymentChannelCreateFailed) - expect(wrapper.find('[data-testid="source"]')).toHaveText( + expect(screen.find('[data-testid="source"]')).toHaveText( 'sourcerMphibGfHpLDU4DzVCspzLYVuMNpmzN6n8:2810223114', ) - expect(wrapper.find('[data-testid="destination"]')).toHaveText( + expect(screen.find('[data-testid="destination"]')).toHaveText( 'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) - expect(wrapper.find('[data-testid="amount"]')).toHaveText('\uE90010.00 XRP') + expect(screen.find('[data-testid="amount"]')).toHaveText('\uE90010.00 XRP') }) it('renders tx with destination tag', () => { renderComponent(mockPaymentChannelCreateWithDestinationTag) - expect(wrapper.find('[data-testid="source"]')).toHaveText( + expect(screen.find('[data-testid="source"]')).toHaveText( 'sourcerN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH', ) - expect(wrapper.find('[data-testid="destination"]')).toHaveText( + expect(screen.find('[data-testid="destination"]')).toHaveText( 'destinationrf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn:20170428', ) - expect(wrapper.find('[data-testid="amount"]')).toHaveText( - '\uE900100.00 XRP', - ) + expect(screen.find('[data-testid="amount"]')).toHaveText('\uE900100.00 XRP') }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx index f904ec17d..98f098acc 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx @@ -1,7 +1,7 @@ +import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createDescriptionRenderFactory } from '../../test/createRenderFactory' -import { cleanup, screen } from '@testing-library/react' import mockPaymentChannelFund from './mock_data/PaymentChannelFund.json' import mockPaymentChannelFundFailed from './mock_data/PaymentChannelFundFailed.json' import { Description } from '../Description' @@ -12,20 +12,20 @@ describe('PaymentChannelFund: Description', () => { afterEach(cleanup) it('renders a Fund', () => { renderComponent(mockPaymentChannelFund) - expect(wrapper.find('[data-testid="channel-line"]')).toHaveText( + expect(screen.find('[data-testid="channel-line"]')).toHaveText( `It will update the payment channel 4BEAC9E4C10674AB698EAC0F2D78A4FF507428370578A59B04883E7EB8D82260`, ) - expect(wrapper.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.find('[data-testid="amount-line"]')).toHaveText( `It will increase the channel amount by \uE9001.00 XRP from \uE90074.00 XRP to \uE90075.00 XRP`, ) }) it('renders failed tx', () => { renderComponent(mockPaymentChannelFundFailed) - expect(wrapper.find('[data-testid="channel-line"]')).toHaveText( + expect(screen.find('[data-testid="channel-line"]')).toHaveText( `It will update the payment channel 933F93F7113A2F94B7838D64D0D2A244C57EFD6411C16FFF5FA293D200EF5876`, ) - expect(wrapper.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.find('[data-testid="amount-line"]')).toHaveText( `It will increase the channel amount by \uE90020.00 XRP`, ) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx index 6fd930256..642a758c9 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx @@ -2,7 +2,6 @@ import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createSimpleRenderFactory } from '../../test/createRenderFactory' -import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockPaymentChannelFund from './mock_data/PaymentChannelFund.json' import mockPaymentChannelFundFailed from './mock_data/PaymentChannelFundFailed.json' @@ -18,27 +17,27 @@ describe('PaymentChannelFund: Simple', () => { afterEach(cleanup) it('renders a fund', () => { renderComponent(mockPaymentChannelFund) - expectSimpleRowLabel(wrapper, 'increase', 'channel amount increase') - expectSimpleRowText(wrapper, 'increase', '+\uE9001.00 XRP') - expectSimpleRowLabel(wrapper, 'channel-amount', 'channel amount') - expectSimpleRowText(wrapper, 'channel-amount', '\uE90075.00 XRP') - expectSimpleRowLabel(wrapper, 'total', 'total claimed') - expectSimpleRowText(wrapper, 'total', '\uE90061.859345 XRP') - expectSimpleRowLabel(wrapper, 'source', 'source') + expectSimpleRowLabel(screen, 'increase', 'channel amount increase') + expectSimpleRowText(screen, 'increase', '+\uE9001.00 XRP') + expectSimpleRowLabel(screen, 'channel-amount', 'channel amount') + expectSimpleRowText(screen, 'channel-amount', '\uE90075.00 XRP') + expectSimpleRowLabel(screen, 'total', 'total claimed') + expectSimpleRowText(screen, 'total', '\uE90061.859345 XRP') + expectSimpleRowLabel(screen, 'source', 'source') expectSimpleRowText( - wrapper, + screen, 'source', 'rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN:3839231768', ) - expectSimpleRowLabel(wrapper, 'destination', 'destination') + expectSimpleRowLabel(screen, 'destination', 'destination') expectSimpleRowText( - wrapper, + screen, 'destination', 'rBFpf3YQQrcR1HnCt5AhYpNVvXUh4W89Dr', ) - expectSimpleRowLabel(wrapper, '.channel', 'Channel ID') + expectSimpleRowLabel(screen, '.channel', 'Channel ID') expectSimpleRowText( - wrapper, + screen, '.channel', '4BEAC9E4C10674AB698EAC0F2D78A4FF507428370578A59B04883E7EB8D82260', ) @@ -46,15 +45,15 @@ describe('PaymentChannelFund: Simple', () => { it('renders failed tx', () => { renderComponent(mockPaymentChannelFundFailed) - expectSimpleRowLabel(wrapper, 'increase', 'channel amount increase') - expectSimpleRowText(wrapper, 'increase', '+\uE90020.00 XRP') - expectSimpleRowNotToExist(wrapper, 'channel-amount') - expectSimpleRowNotToExist(wrapper, 'total') - expectSimpleRowNotToExist(wrapper, 'source') - expectSimpleRowNotToExist(wrapper, 'destination') - expectSimpleRowNotToExist(wrapper, 'source') + expectSimpleRowLabel(screen, 'increase', 'channel amount increase') + expectSimpleRowText(screen, 'increase', '+\uE90020.00 XRP') + expectSimpleRowNotToExist(screen, 'channel-amount') + expectSimpleRowNotToExist(screen, 'total') + expectSimpleRowNotToExist(screen, 'source') + expectSimpleRowNotToExist(screen, 'destination') + expectSimpleRowNotToExist(screen, 'source') expectSimpleRowText( - wrapper, + screen, '.channel', '933F93F7113A2F94B7838D64D0D2A244C57EFD6411C16FFF5FA293D200EF5876', ) diff --git a/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx b/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx index f25fd1e08..b69f04577 100644 --- a/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx @@ -11,14 +11,14 @@ const renderComponent = createDescriptionRenderFactory( i18nTestConfigEnUS, ) -function testDescription(wrapper) { - expect(wrapper.find('[data-testid="fees-line"]')).toHaveText( +function testDescription(screen) { + expect(screen.find('[data-testid="fees-line"]')).toHaveText( `Future transactions will require a minimum fee of \uE9000.00001 XRP.`, ) - expect(wrapper.find('[data-testid="reserves-line"]')).toHaveText( + expect(screen.find('[data-testid="reserves-line"]')).toHaveText( `Accounts must now hold a base of \uE90010.00 XRP and an additional \uE9002.00 XRP for each additional object that account owns.`, ) - expect(wrapper.find('[data-testid="documentation-line"]')).toHaveText( + expect(screen.find('[data-testid="documentation-line"]')).toHaveText( `Visit the docs: Fees`, ) } @@ -27,11 +27,11 @@ describe('SetFee: Description', () => { afterEach(cleanup) it('renders Description for transaction before XRPFees amendment', () => { renderComponent(SetFeePreAmendment) - testDescription(wrapper) + testDescription(screen) }) it('renders Description for transaction after XRPFees amendment', () => { renderComponent(SetFeePostAmendment) - testDescription(wrapper) + testDescription(screen) }) }) diff --git a/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx b/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx index fda8587d3..3d23cfcde 100644 --- a/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx @@ -12,24 +12,24 @@ import SetFeePostAmendment from './mock_data/SetFee_PostAmendment.json' const renderComponent = createSimpleRenderFactory(Simple, i18nTestConfigEnUS) -function testSimple(wrapper) { - expectSimpleRowLabel(wrapper, `base-fee`, 'Base Fee') - expectSimpleRowText(wrapper, `base-fee`, `\uE9000.00001 XRP`) - expectSimpleRowLabel(wrapper, `reserve`, 'Reserve') - expectSimpleRowText(wrapper, `reserve`, `\uE90010.00 XRP`) - expectSimpleRowLabel(wrapper, `reserve-increment`, 'Reserve Increment') - expectSimpleRowText(wrapper, `reserve-increment`, `\uE9002.00 XRP`) +function testSimple(screen) { + expectSimpleRowLabel(screen, `base-fee`, 'Base Fee') + expectSimpleRowText(screen, `base-fee`, `\uE9000.00001 XRP`) + expectSimpleRowLabel(screen, `reserve`, 'Reserve') + expectSimpleRowText(screen, `reserve`, `\uE90010.00 XRP`) + expectSimpleRowLabel(screen, `reserve-increment`, 'Reserve Increment') + expectSimpleRowText(screen, `reserve-increment`, `\uE9002.00 XRP`) } describe('SetFee: Simple', () => { afterEach(cleanup) it('renders Simple for transaction before XRPFees amendment', () => { renderComponent(SetFeePreAmendment) - testSimple(wrapper) + testSimple(screen) }) it('renders Simple for transaction after XRPFees amendment', () => { renderComponent(SetFeePostAmendment) - testSimple(wrapper) + testSimple(screen) }) }) diff --git a/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx b/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx index f09919332..54519336f 100644 --- a/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx @@ -12,10 +12,10 @@ describe('SetHookSimple', () => { it('renders', () => { renderComponent(mockSetHook) - expect(wrapper.find('.group')).toHaveLength(2) + expect(screen.find('.group')).toHaveLength(2) - const hook1 = wrapper.find('.group').at(0) - const hook2 = wrapper.find('.group').at(1) + const hook1 = screen.find('.group').at(0) + const hook2 = screen.find('.group').at(1) expectSimpleRowText( hook1, @@ -49,9 +49,9 @@ describe('SetHookSimple', () => { it('renders a different SetHook tx', () => { renderComponent(mockSetHook2) - expect(wrapper.find('.group')).toHaveLength(1) + expect(screen.find('.group')).toHaveLength(1) - const hook = wrapper.find('.group').at(0) + const hook = screen.find('.group').at(0) expectSimpleRowText( hook, @@ -84,9 +84,9 @@ describe('SetHookSimple', () => { it('renders a failed SetHook tx', () => { renderComponent(mockSetHookFailure) - expect(wrapper.find('.group')).toHaveLength(1) + expect(screen.find('.group')).toHaveLength(1) - const hook = wrapper.find('.group').at(0) + const hook = screen.find('.group').at(0) expectSimpleRowText(hook, 'hook-hash', 'undefined') diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx index aee9294a1..40aca0e54 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx @@ -11,7 +11,7 @@ describe('SetRegularKey: Description', () => { it('renders description for transaction', () => { renderComponent(SetRegularKey) - expect(wrapper.html()).toBe( + expect(screen.html()).toBe( `
set_regular_key_description rULyyLRoZ47P33Vapew67VoiRqPrZ2ejbp
`, ) }) @@ -19,6 +19,6 @@ describe('SetRegularKey: Description', () => { it('renders description for transaction that unsets key', () => { renderComponent(SetRegularKeyUnset) - expect(wrapper.html()).toBe(`
unset_regular_key_description
`) + expect(screen.html()).toBe(`
unset_regular_key_description
`) }) }) diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx index f7e8b3cd0..0961280c1 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx @@ -11,7 +11,7 @@ describe('SetRegularKey: Simple', () => { afterEach(cleanup) it('renders Simple for transaction', () => { renderComponent(SetRegularKey) - const keyRow = wrapper.find(SimpleRow) + const keyRow = screen.find(SimpleRow) expect(keyRow.prop('label')).toBe(`regular_key`) expect(keyRow.find('.value').text()).toBe( @@ -21,7 +21,7 @@ describe('SetRegularKey: Simple', () => { it('renders Simple for transaction that unsets key', () => { renderComponent(SetRegularKeyUnset) - const keyRow = wrapper.find(SimpleRow) + const keyRow = screen.find(SimpleRow) expect(keyRow.prop('label')).toBe('') expect(keyRow.find('.unset').hostNodes().text()).toBe(`unset_regular_key`) diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx index 035ed6875..89e6f7d82 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx @@ -10,9 +10,9 @@ describe('SetRegularKeyTable: Detail', () => { it('renders Simple for transaction', () => { renderComponent(SetRegularKey) - expect(wrapper.find('.setregularkey')).toExist() - expect(wrapper.find('.label').text()).toBe(`regular_key`) - expect(wrapper.find('.key').text()).toBe( + expect(screen.find('.setregularkey')).toExist() + expect(screen.find('.label').text()).toBe(`regular_key`) + expect(screen.find('.key').text()).toBe( `rULyyLRoZ47P33Vapew67VoiRqPrZ2ejbp`, ) }) @@ -20,7 +20,7 @@ describe('SetRegularKeyTable: Detail', () => { it('renders Simple for transaction that unsets key', () => { renderComponent(SetRegularKeyUnset) - expect(wrapper.find('.unset')).toExist() - expect(wrapper.text()).toBe(`unset_regular_key`) + expect(screen.find('.unset')).toExist() + expect(screen.text()).toBe(`unset_regular_key`) }) }) diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx index a96277dc6..e3f3e2bf5 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx @@ -11,11 +11,11 @@ describe('SignerListSet: Description', () => { it('renders', () => { renderComponent(mockSignerListSet) - expect(wrapper.find('div').at(0).text()).toEqual( + expect(screen.find('div').at(0).text()).toEqual( 'set_signer_list_description:', ) - const signers = wrapper.find('.signers li') + const signers = screen.find('.signers li') expect(signers.at(0)).toHaveText( 'rK8MWkYVgHR6VmPH6WpWcvVce9evvMpKSv - weight: 2', ) @@ -29,6 +29,6 @@ describe('SignerListSet: Description', () => { it('renders when signer list is cleared', () => { renderComponent(mockSignerListSetClear) - expect(wrapper).toHaveText('unset_signer_list_description') + expect(screen).toHaveText('unset_signer_list_description') }) }) diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx index 40903b129..20f512c29 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx @@ -12,11 +12,11 @@ describe('SignerListSet: Simple', () => { it('renders', () => { renderComponent(mockSignerListSet) - expect(wrapper.find('[data-testid="quorum"] .value').text()).toEqual( + expect(screen.find('[data-testid="quorum"] .value').text()).toEqual( '3 out_of 4', ) - const signers = wrapper.find('[data-testid="signers"] .value li') + const signers = screen.find('[data-testid="signers"] .value li') expect(signers.at(0)).toHaveText( 'rK8MWkYVgHR6VmPH6WpWcvVce9evvMpKSv weight: 2', ) @@ -30,6 +30,6 @@ describe('SignerListSet: Simple', () => { it('renders when signer list is cleared', () => { renderComponent(mockSignerListSetClear) - expect(wrapper.find(SimpleRow)).toHaveText('unset_signer_list') + expect(screen.find(SimpleRow)).toHaveText('unset_signer_list') }) }) diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx index 4241675fd..e85ab6ed1 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx @@ -11,11 +11,11 @@ describe('SignerListSet: TableDetail', () => { afterEach(cleanup) it('renders', () => { renderComponent(mockSignerListSet) - expect(wrapper).toHaveText('signers: 3 - quorum: 3/4') + expect(screen).toHaveText('signers: 3 - quorum: 3/4') }) it('renders when signer list is cleared', () => { renderComponent(mockSignerListSetClear) - expect(wrapper).toHaveText('unset_signer_list') + expect(screen).toHaveText('unset_signer_list') }) }) diff --git a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateSimple.test.tsx b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateSimple.test.tsx index 402171b44..d5b6d9c45 100644 --- a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateSimple.test.tsx @@ -9,6 +9,6 @@ describe('TicketCreate: Simple', () => { afterEach(cleanup) it('renders ticket count', () => { renderComponent(TicketCreate) - expectSimpleRowText(wrapper, 'ticket-count', '1') + expectSimpleRowText(screen, 'ticket-count', '1') }) }) diff --git a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx index e12b13597..2c2c5759f 100644 --- a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx @@ -9,6 +9,6 @@ describe('TicketCreate: TableDetail', () => { afterEach(cleanup) it('renders', () => { renderComponent(TicketCreate) - expect(wrapper).toHaveText('ticket_count: 1') + expect(screen).toHaveText('ticket_count: 1') }) }) diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx index 5f30e30a9..9341aa48a 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx @@ -12,7 +12,7 @@ describe('TrustSet: Description', () => { afterEach(cleanup) it('renders description for authorize', () => { renderComponent(mockTrustSet) - expect(wrapper.html()).toBe( + expect(screen.html()).toBe( `
It establishes CNÂ¥1,000,000,000.00 as the maximum amount of CNY from that is willing to hold
`, ) }) diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetSimple.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetSimple.test.tsx index 5374452e7..df303689f 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetSimple.test.tsx @@ -2,7 +2,6 @@ import { cleanup, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { createSimpleRenderFactory } from '../../test/createRenderFactory' -import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockTrustSet from './mock_data/TrustSet.json' import { expectSimpleRowLabel, expectSimpleRowText } from '../../test' @@ -13,9 +12,9 @@ describe('TrustSet: Simple', () => { afterEach(cleanup) it('renders', () => { renderComponent(mockTrustSet) - expectSimpleRowLabel(wrapper, 'amount', 'Set Trust Limit') + expectSimpleRowLabel(screen, 'amount', 'Set Trust Limit') expectSimpleRowText( - wrapper, + screen, 'amount', `CN¥1,000,000,000.00 CNY.razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA`, ) diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx index d0b8e81c1..0b1ebfb43 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx @@ -10,8 +10,8 @@ describe('TrustSet: TableDetail', () => { afterEach(cleanup) it('renders', () => { renderComponent(mockTrustSet) - expect(wrapper.find('.label')).toHaveText('Set Trust Limit') - expect(wrapper.find('Amount')).toHaveText( + expect(screen.find('.label')).toHaveText('Set Trust Limit') + expect(screen.find('Amount')).toHaveText( 'CN¥1,000,000,000.00 CNY.razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA', ) }) diff --git a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx index 3ceafee75..edc080e24 100644 --- a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx +++ b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx @@ -17,30 +17,30 @@ describe('UNLModify: Simple', () => { afterEach(cleanup) it('renders tx that enables a validator', () => { renderComponent(mockUNLModifyEnable) - expectSimpleRowLabel(wrapper, 'validator', 'Validator') + expectSimpleRowLabel(screen, 'validator', 'Validator') expectSimpleRowText( - wrapper, + screen, 'validator', 'nHUXeusfwk61c4xJPneb9Lgy7Ga6DVaVLEyB29ftUdt9k2KxD6Hw', ) - expectSimpleRowLabel(wrapper, 'action', 'action') - expectSimpleRowText(wrapper, 'action', 'ENABLE') + expectSimpleRowLabel(screen, 'action', 'action') + expectSimpleRowText(screen, 'action', 'ENABLE') }) it('renders tx that disables a validator', () => { renderComponent(mockUNLModifyDisable) - expectSimpleRowLabel(wrapper, 'validator', 'Validator') + expectSimpleRowLabel(screen, 'validator', 'Validator') expectSimpleRowText( - wrapper, + screen, 'validator', 'nHUXeusfwk61c4xJPneb9Lgy7Ga6DVaVLEyB29ftUdt9k2KxD6Hw', ) - expectSimpleRowLabel(wrapper, 'action', 'action') - expectSimpleRowText(wrapper, 'action', 'DISABLE') + expectSimpleRowLabel(screen, 'action', 'action') + expectSimpleRowText(screen, 'action', 'DISABLE') }) it('renders tx with correct account and sequence', () => { - const wrapper = mount( + const screen = mount( { /> , ) - expect(wrapper.find('[data-testid="account"]')).not.toExist() - expectSimpleRowLabel(wrapper, 'sequence', 'Sequence Number') - expectSimpleRowText(wrapper, 'sequence', '0') + expect(screen.find('[data-testid="account"]')).not.toExist() + expectSimpleRowLabel(screen, 'sequence', 'Sequence Number') + expectSimpleRowText(screen, 'sequence', '0') }) }) diff --git a/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx index f0b887509..f5388c222 100644 --- a/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx @@ -1,5 +1,5 @@ -import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { cleanup, screen } from '@testing-library/react' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockXChainAccountCreateCommit from './mock_data/XChainAccountCreateCommit.json' import mockXChainAccountCreateCommitInsufficientFunds from './mock_data/XChainAccountCreateCommitInsufficientFunds.json' @@ -13,27 +13,27 @@ describe('XChainAccountCreateCommitSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText(wrapper, 'send', '\uE90010.00 XRP') + expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') expectSimpleRowText( - wrapper, + screen, 'destination', 'raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym', ) - expect(wrapper.find(`[data-testid="destination"] a`)).not.toExist() + expect(screen.find(`[data-testid="destination"] a`)).not.toExist() }) it('renders failed transaction', () => { @@ -41,26 +41,26 @@ describe('XChainAccountCreateCommitSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText(wrapper, 'send', '\uE9001,000.00 XRP') + expectSimpleRowText(screen, 'send', '\uE9001,000.00 XRP') expectSimpleRowText( - wrapper, + screen, 'destination', 'raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym', ) - expect(wrapper.find(`[data-testid="destination"] a`)).not.toExist() + expect(screen.find(`[data-testid="destination"] a`)).not.toExist() }) }) diff --git a/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx index a8ba8d094..6f36bb2a3 100644 --- a/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx @@ -13,32 +13,32 @@ describe('XChainAddAccountCreateAttestationSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'rDPwN6dz3shffxodeUC9Qf5y1mEHYySKLJ', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText(wrapper, 'send', '\uE90010.00 XRP') + expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') expectSimpleRowText( - wrapper, + screen, 'other_chain_source', 'raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym', ) expectSimpleRowText( - wrapper, + screen, 'destination', 'rLbKhMNskUBYRShdbbQcFm9YhumEeUJfPK', ) - expect(wrapper.find(`[data-testid="destination"] a`)).toExist() + expect(screen.find(`[data-testid="destination"] a`)).toExist() }) it('renders failed transaction', () => { @@ -46,31 +46,31 @@ describe('XChainAddAccountCreateAttestationSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'rNFrsx478pH42Vy5w4KN9Hcyh8SDrVmCfd', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText(wrapper, 'send', '\uE90010.00 XRP') + expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') expectSimpleRowText( - wrapper, + screen, 'other_chain_source', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) expectSimpleRowText( - wrapper, + screen, 'destination', 'rPy1F9bQ7dNn2T3QAFRM6dFz6ygHa3MDDi', ) - expect(wrapper.find(`[data-testid="destination"] a`)).toExist() + expect(screen.find(`[data-testid="destination"] a`)).toExist() }) }) diff --git a/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx index 9df54096f..d4f815b49 100644 --- a/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx @@ -13,33 +13,33 @@ describe('XChainAddClaimAttestationSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'r3ZsJYkBao2qiwUCvmjfgEUquKueLAwPxQ', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText(wrapper, 'send', '\uE90010.00 XRP') + expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') expectSimpleRowText( - wrapper, + screen, 'other_chain_source', 'raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym', ) expectSimpleRowText( - wrapper, + screen, 'destination', 'rJdTJRJZ6GXCCRaamHJgEqVzB7Zy4557Pi', ) - expect(wrapper.find(`[data-testid="destination"] a`)).toExist() - expectSimpleRowText(wrapper, 'xchain-claim-id', '1') + expect(screen.find(`[data-testid="destination"] a`)).toExist() + expectSimpleRowText(screen, 'xchain-claim-id', '1') }) it('renders failed transaction', () => { @@ -47,32 +47,32 @@ describe('XChainAddClaimAttestationSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'rNFrsx478pH42Vy5w4KN9Hcyh8SDrVmCfd', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText(wrapper, 'send', '\uE90010.00 XRP') + expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') expectSimpleRowText( - wrapper, + screen, 'other_chain_source', 'raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym', ) expectSimpleRowText( - wrapper, + screen, 'destination', 'rJdTJRJZ6GXCCRaamHJgEqVzB7Zy4557Pi', ) - expect(wrapper.find(`[data-testid="destination"] a`)).toExist() - expectSimpleRowText(wrapper, 'xchain-claim-id', '3') + expect(screen.find(`[data-testid="destination"] a`)).toExist() + expectSimpleRowText(screen, 'xchain-claim-id', '3') }) }) diff --git a/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx b/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx index 44e12fd50..5c8778e24 100644 --- a/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx @@ -12,27 +12,27 @@ describe('XChainClaimSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText(wrapper, 'amount', '\uE90010.00 XRP') + expectSimpleRowText(screen, 'amount', '\uE90010.00 XRP') expectSimpleRowText( - wrapper, + screen, 'destination', 'rJdTJRJZ6GXCCRaamHJgEqVzB7Zy4557Pi', ) - expectSimpleRowText(wrapper, 'claim-id', '5') + expectSimpleRowText(screen, 'claim-id', '5') }) it('renders failed tx', () => { @@ -40,26 +40,26 @@ describe('XChainClaimSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText(wrapper, 'amount', '\uE9000.01 XRP') + expectSimpleRowText(screen, 'amount', '\uE9000.01 XRP') expectSimpleRowText( - wrapper, + screen, 'destination', 'rpwoKyUQn5uGDKeF6LhxK8HWS25ZMhFpaB', ) - expectSimpleRowText(wrapper, 'claim-id', '492') + expectSimpleRowText(screen, 'claim-id', '492') }) }) diff --git a/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx index 44bffd65b..ec7982bda 100644 --- a/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx @@ -13,23 +13,23 @@ describe('XChainCommitSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText(wrapper, 'send', '\uE90010.00 XRP') - expectSimpleRowText(wrapper, 'claim-id', '4') - expect(wrapper.find(`[data-testid="destination"]`)).not.toExist() + expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') + expectSimpleRowText(screen, 'claim-id', '4') + expect(screen.find(`[data-testid="destination"]`)).not.toExist() }) it('renders failed tx', () => { @@ -37,24 +37,24 @@ describe('XChainCommitSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText(wrapper, 'send', '\uE90010,000.00 XRP') - expectSimpleRowText(wrapper, 'claim-id', '3') + expectSimpleRowText(screen, 'send', '\uE90010,000.00 XRP') + expectSimpleRowText(screen, 'claim-id', '3') expectSimpleRowText( - wrapper, + screen, 'destination', 'rJdTJRJZ6GXCCRaamHJgEqVzB7Zy4557Pi', ) diff --git a/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx index 47e16d882..26167308c 100644 --- a/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx @@ -13,23 +13,23 @@ describe('XChainCreateBridgeSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText(wrapper, 'signature-reward', '\uE9000.0001 XRP') + expectSimpleRowText(screen, 'signature-reward', '\uE9000.0001 XRP') expect( - wrapper.find(`[data-testid="min-create-account-amount"]`), + screen.find(`[data-testid="min-create-account-amount"]`), ).not.toExist() }) @@ -38,30 +38,30 @@ describe('XChainCreateBridgeSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'ratAutb3katzezbXX3LsX4sk4vmvhNucac', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() expectSimpleRowText( - wrapper, + screen, 'locking-chain-issue', 'USD.rNhm2aTLEnSdcWQ7d6PZ5F7TX5skM7wkAS', ) expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rBkRN2VHVWJVKqfnh1TovLkXo7vLP7oBcq', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).toExist() + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).toExist() expectSimpleRowText( - wrapper, + screen, 'issuing-chain-issue', 'USD.rBkRN2VHVWJVKqfnh1TovLkXo7vLP7oBcq', ) - expectSimpleRowText(wrapper, 'signature-reward', '\uE9000.0001 XRP') - expectSimpleRowText(wrapper, 'min-account-create-amount', '\uE9005.00 XRP') + expectSimpleRowText(screen, 'signature-reward', '\uE9000.0001 XRP') + expectSimpleRowText(screen, 'min-account-create-amount', '\uE9005.00 XRP') }) it('renders failed tx', () => { @@ -69,21 +69,21 @@ describe('XChainCreateBridgeSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'rNFrsx478pH42Vy5w4KN9Hcyh8SDrVmCfd', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText(wrapper, 'signature-reward', '\uE9000.0001 XRP') - expectSimpleRowText(wrapper, 'min-account-create-amount', '\uE9005.00 XRP') + expectSimpleRowText(screen, 'signature-reward', '\uE9000.0001 XRP') + expectSimpleRowText(screen, 'min-account-create-amount', '\uE9005.00 XRP') }) }) diff --git a/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx index 95b08a5a1..3ebc66587 100644 --- a/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx @@ -12,27 +12,27 @@ describe('XChainCreateClaimIDSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'rNe5NbD1hqCSZPz9KM5PHm5Bf8jjHfezPE', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText(wrapper, 'signature-reward', '\uE9000.0001 XRP') + expectSimpleRowText(screen, 'signature-reward', '\uE9000.0001 XRP') expectSimpleRowText( - wrapper, + screen, 'other-chain-source', 'raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym', ) - expectSimpleRowText(wrapper, 'claim-id', '1') + expectSimpleRowText(screen, 'claim-id', '1') }) it('renders failed transaction', () => { @@ -40,26 +40,26 @@ describe('XChainCreateClaimIDSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText(wrapper, 'signature-reward', '\uE9000.0001 XRP') + expectSimpleRowText(screen, 'signature-reward', '\uE9000.0001 XRP') expectSimpleRowText( - wrapper, + screen, 'other-chain-source', 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W', ) - expect(wrapper.find(`[data-testid="claim-id"]`)).not.toExist() + expect(screen.find(`[data-testid="claim-id"]`)).not.toExist() }) }) diff --git a/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx b/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx index 5986d11e5..c7fbfee82 100644 --- a/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx @@ -13,21 +13,21 @@ describe('XChainModifyBridgeSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText(wrapper, 'signature-reward', '\uE9000.01 XRP') + expectSimpleRowText(screen, 'signature-reward', '\uE9000.01 XRP') }) it('renders MinAccountCreateAmount', () => { @@ -35,25 +35,21 @@ describe('XChainModifyBridgeSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'rnBnyot2gCJywLxLzfHQX2dUJqZ6oghUFp', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText( - wrapper, - 'min-account-create-amount', - '\uE900100.00 XRP', - ) + expectSimpleRowText(screen, 'min-account-create-amount', '\uE900100.00 XRP') }) it('renders failed transaction', () => { @@ -61,20 +57,20 @@ describe('XChainModifyBridgeSimple', () => { // check XChainBridge parts expectSimpleRowText( - wrapper, + screen, 'locking-chain-door', 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W', ) - expect(wrapper.find(`[data-testid="locking-chain-door"] a`)).not.toExist() - expectSimpleRowText(wrapper, 'locking-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( - wrapper, + screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="issuing-chain-door"] a`)).toExist() - expectSimpleRowText(wrapper, 'issuing-chain-issue', '\uE900 XRP') + expect(screen.find(`[data-testid="issuing-chain-door"] a`)).toExist() + expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') - expectSimpleRowText(wrapper, 'signature-reward', '\uE9000.0001 XRP') + expectSimpleRowText(screen, 'signature-reward', '\uE9000.0001 XRP') }) }) diff --git a/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx b/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx index d2e16e212..732682194 100644 --- a/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx +++ b/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx @@ -18,79 +18,79 @@ describe('DefaultSimple', () => { it('renders Simple for basic transaction', () => { renderComponent(NewEscrowCreate) expectSimpleRowText( - wrapper, + screen, 'Destination', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(wrapper.find(`[data-testid="Destination"] a`)).toExist() - expectSimpleRowText(wrapper, 'Amount', '\uE9001.00 XRP') - expectSimpleRowText(wrapper, 'FinishAfter', '736447590') + expect(screen.find(`[data-testid="Destination"] a`)).toExist() + expectSimpleRowText(screen, 'Amount', '\uE9001.00 XRP') + expectSimpleRowText(screen, 'FinishAfter', '736447590') }) it('renders Simple for more complex transaction', () => { renderComponent(SetHook) - expect(wrapper.find(`[data-testid="group"]`).length).toEqual(10) - expect(wrapper.find(`[data-testid="CreateCode"]`).length).toEqual(10) - expect(wrapper.find(`[data-testid="Flags"]`).length).toEqual(10) - expect(wrapper.find(`[data-testid="HookApiVersion"]`).length).toEqual(2) - expect(wrapper.find(`[data-testid="HookNamespace"]`).length).toEqual(2) - expect(wrapper.find(`[data-testid="HookOn"]`).length).toEqual(2) + expect(screen.find(`[data-testid="group"]`).length).toEqual(10) + expect(screen.find(`[data-testid="CreateCode"]`).length).toEqual(10) + expect(screen.find(`[data-testid="Flags"]`).length).toEqual(10) + expect(screen.find(`[data-testid="HookApiVersion"]`).length).toEqual(2) + expect(screen.find(`[data-testid="HookNamespace"]`).length).toEqual(2) + expect(screen.find(`[data-testid="HookOn"]`).length).toEqual(2) - expect(wrapper.find(`[data-testid="CreateCode"] .value`).at(0)).toHaveText( + expect(screen.find(`[data-testid="CreateCode"] .value`).at(0)).toHaveText( '0061736D0100000001420960027F7F017F60037F7F7F017E60037F7F7E017E60027F7F017E60047F' + '7F7F7F017E60017F017E6000017E60057F7F7F7F7F017E60097F7F7F7F7F7F7F7F7F017E02BC02' + '1403656E76025F67000003656E760A6F74786E5F6669656C64000103656E760661636365707400' + '0203656E7608726F6C6C6261636B000203656E760C686F6F6B5F6163636F756E...', ) - expect(wrapper.find(`[data-testid="Flags"] .value`).at(0)).toHaveText('1') + expect(screen.find(`[data-testid="Flags"] .value`).at(0)).toHaveText('1') expect( - wrapper.find(`[data-testid="HookApiVersion"] .value`).at(0), + screen.find(`[data-testid="HookApiVersion"] .value`).at(0), ).toHaveText('0') expect( - wrapper.find(`[data-testid="HookNamespace"] .value`).at(0), + screen.find(`[data-testid="HookNamespace"] .value`).at(0), ).toHaveText( '0000000000000000000000000000000000000000000000000000000000000000', ) - expect(wrapper.find(`[data-testid="HookOn"] .value`).at(0)).toHaveText( + expect(screen.find(`[data-testid="HookOn"] .value`).at(0)).toHaveText( 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFFFFFFFFFBFFFFF', ) }) it('renders Simple for more complex transaction', () => { renderComponent(SetHook2) - expect(wrapper.find(`[data-testid="group"]`).length).toEqual(1) - expect(wrapper.find(`[data-testid="CreateCode"]`).length).toEqual(1) - expect(wrapper.find(`[data-testid="Flags"]`).length).toEqual(1) - expect(wrapper.find(`[data-testid="HookApiVersion"]`).length).toEqual(1) - expect(wrapper.find(`[data-testid="HookNamespace"]`).length).toEqual(1) - expect(wrapper.find(`[data-testid="HookOn"]`).length).toEqual(1) - expect(wrapper.find(`[data-testid="HookParameters"]`).length).toEqual(1) + expect(screen.find(`[data-testid="group"]`).length).toEqual(1) + expect(screen.find(`[data-testid="CreateCode"]`).length).toEqual(1) + expect(screen.find(`[data-testid="Flags"]`).length).toEqual(1) + expect(screen.find(`[data-testid="HookApiVersion"]`).length).toEqual(1) + expect(screen.find(`[data-testid="HookNamespace"]`).length).toEqual(1) + expect(screen.find(`[data-testid="HookOn"]`).length).toEqual(1) + expect(screen.find(`[data-testid="HookParameters"]`).length).toEqual(1) - expect(wrapper.find(`[data-testid="CreateCode"] .value`).at(0)).toHaveText( + expect(screen.find(`[data-testid="CreateCode"] .value`).at(0)).toHaveText( '0061736D01000000011C0460057F7F7F7F7F017E60037F7F7E017E60027F7F017F60017F017E0223' + '0303656E76057472616365000003656E7606616363657074000103656E76025F6700020302010305' + '030100020621057F0141B088040B7F0041A6080B7F004180080B7F0041B088040B7F004180080B07' + '080104686F6F6B00030AC6800001C2800002017F017E230041106B220124...', ) - expect(wrapper.find(`[data-testid="Flags"] .value`).at(0)).toHaveText('1') + expect(screen.find(`[data-testid="Flags"] .value`).at(0)).toHaveText('1') expect( - wrapper.find(`[data-testid="HookApiVersion"] .value`).at(0), + screen.find(`[data-testid="HookApiVersion"] .value`).at(0), ).toHaveText('0') expect( - wrapper.find(`[data-testid="HookNamespace"] .value`).at(0), + screen.find(`[data-testid="HookNamespace"] .value`).at(0), ).toHaveText( '4FF9961269BF7630D32E15276569C94470174A5DA79FA567C0F62251AA9A36B9', ) - expect(wrapper.find(`[data-testid="HookOn"] .value`).at(0)).toHaveText( + expect(screen.find(`[data-testid="HookOn"] .value`).at(0)).toHaveText( 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFFFFFFFFFBFFFFF', ) expect( - wrapper.find( + screen.find( `[data-testid="HookParameters"] .subgroup [data-testid="HookParameterName"]`, ), ).toHaveText('HookParameterName: 6E616D6531') expect( - wrapper.find( + screen.find( `[data-testid="HookParameters"] .subgroup [data-testid="HookParameterValue"]`, ), ).toHaveText('HookParameterValue: 76616C756531') @@ -99,18 +99,18 @@ describe('DefaultSimple', () => { it('renders Simple for amount', () => { renderComponent(TokenSwapPropose) expectSimpleRowText( - wrapper, + screen, 'AccountOther', 'rPTScb8m3wq6r3Ys93Ec5at7LYDmWrtndi', ) - expect(wrapper.find(`[data-testid="AccountOther"] a`)).toExist() + expect(screen.find(`[data-testid="AccountOther"] a`)).toExist() expectSimpleRowText( - wrapper, + screen, 'Amount', '€12.00 EUR.rnz5f1MFcgbVxzYhU5hUKbKquEJHJady5K', ) expectSimpleRowText( - wrapper, + screen, 'AmountOther', '$33.00 USD.rnz5f1MFcgbVxzYhU5hUKbKquEJHJady5K', ) From 51691341193f9b25fd8aa32d37be7b3719321cac Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 9 May 2024 10:35:41 -0400 Subject: [PATCH 07/55] use expectSimpleRowLabel --- .../AccountDelete/test/AccountDeleteSimple.test.tsx | 13 +++++++++---- .../TrustSet/test/TrustSetTableDetail.test.tsx | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx b/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx index da579333a..68428c078 100644 --- a/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx +++ b/src/containers/shared/components/Transaction/AccountDelete/test/AccountDeleteSimple.test.tsx @@ -5,6 +5,7 @@ import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockAccountDelete from './mock_data/AccountDelete.json' import mockAccountDeleteWithDestinationTag from './mock_data/AccountDeleteWithDestinationTag.json' +import { expectSimpleRowLabel, expectSimpleRowText } from '../../test' const renderComponent = createSimpleRenderFactory(Simple, i18n) @@ -12,16 +13,20 @@ describe('AccountDelete: Simple', () => { afterEach(cleanup) it('renders', () => { renderComponent(mockAccountDelete) - expect(screen.find('.label')).toHaveText('destination') - expect(screen.find('.value')).toHaveText( + expectSimpleRowLabel(screen, 'destination', 'destination') + expectSimpleRowText( + screen, + 'destination', 'raT74sdzpxJUaubcBAQNS8aLqFMU85Rr5J', ) }) it('renders with destination tag', () => { renderComponent(mockAccountDeleteWithDestinationTag) - expect(screen.find('.label')).toHaveText('destination') - expect(screen.find('.value')).toHaveText( + expectSimpleRowLabel(screen, 'destination', 'destination') + expectSimpleRowText( + screen, + 'destination', 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn:123123', ) }) diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx index 0b1ebfb43..7d176f00d 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx @@ -10,7 +10,7 @@ describe('TrustSet: TableDetail', () => { afterEach(cleanup) it('renders', () => { renderComponent(mockTrustSet) - expect(screen.find('.label')).toHaveText('Set Trust Limit') + expectSimpleRowLabel(screen, 'Set Trust Limit') expect(screen.find('Amount')).toHaveText( 'CN¥1,000,000,000.00 CNY.razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA', ) From 2cd65cc34af64c643fe48f00f50c115adad37e92 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 9 May 2024 11:08:22 -0400 Subject: [PATCH 08/55] fix more errors --- .../Transaction/AMMBid/test/AMMBid.test.tsx | 4 +- .../AMMCreate/test/AMMCreate.test.tsx | 4 +- .../test/AMMDeleteDescription.test.tsx | 4 +- .../test/AMMDeleteTableDetail.test.tsx | 4 +- .../AMMDeposit/test/AMMDeposit.test.tsx | 4 +- .../Transaction/AMMVote/test/AMMVote.test.tsx | 4 +- .../AMMWithdraw/test/AMMWithdraw.test.tsx | 4 +- .../test/AccountSetDescription.test.tsx | 34 +++++---- .../test/AccountSetTableDetail.test.tsx | 32 +++++---- .../Transaction/Clawback/TableDetail.tsx | 2 +- .../test/ClawbackDescription.test.tsx | 7 +- .../Clawback/test/ClawbackSimple.test.tsx | 3 +- .../test/ClawbackTableDetail.test.tsx | 5 +- .../DIDDelete/test/DIDDeleteSimple.test.tsx | 2 +- .../DIDSet/test/DIDSetTableDetail.test.tsx | 8 ++- .../test/EnableAmendmentSimple.test.tsx | 4 +- .../test/EscrowCancelDescription.test.tsx | 9 +-- .../test/EscrowCancelSimple.test.tsx | 9 +-- .../test/EscrowCancelTableDetail.test.tsx | 7 +- .../test/EscrowCreateDescription.test.tsx | 7 +- .../test/EscrowCreateSimple.test.tsx | 9 +-- .../test/EscrowCreateTableDetail.test.tsx | 11 +-- .../Transaction/EscrowFinish/TableDetail.tsx | 2 +- .../test/EscrowFinishDescription.test.tsx | 9 +-- .../test/EscrowFinishSimple.test.tsx | 7 +- .../test/EscrowFinishTableDetail.test.tsx | 9 +-- .../test/NFTokenAcceptOfferSimple.test.tsx | 5 +- .../test/NFTokenBurnSimple.test.tsx | 1 + .../test/NFTokenCancelOfferSimple.test.tsx | 8 +-- .../test/NFTokenCreateOfferSimple.test.tsx | 14 ++-- .../test/NFTokenMintSimple.test.tsx | 2 +- .../test/OfferCreateDescription.test.tsx | 2 +- .../test/OfferCreateTableDetail.test.tsx | 5 +- .../test/OfferCreateDescription.test.tsx | 8 +-- .../test/OfferCreateSimple.test.tsx | 14 ++-- .../test/OfferCreateTableDetail.test.tsx | 18 ++--- .../Payment/test/PaymentDescription.test.tsx | 54 +++++++------- .../Payment/test/PaymentSimple.test.tsx | 2 +- .../Payment/test/PaymentTableDetail.test.tsx | 12 ++-- .../PaymentChannelClaimDescription.test.tsx | 32 ++++----- .../PaymentChannelClaimTableDetail.test.tsx | 56 +++++++-------- .../PaymentChannelCreateDescription.test.tsx | 30 ++++---- .../PaymentChannelCreateTableDetail.test.tsx | 18 ++--- .../PaymentChannelFundDescription.test.tsx | 8 +-- .../SetFee/test/SetFeeDescription.test.tsx | 12 ++-- .../SetFee/test/SetFeeSimple.test.tsx | 6 +- .../SetHook/test/SetHookSimple.test.tsx | 11 +-- .../test/SetRegularKeyDescription.test.tsx | 8 +-- .../test/SetRegularKeyTableDetail.test.tsx | 3 +- .../test/SignerListSetDescription.test.tsx | 10 +-- .../test/SignerListSetSimple.test.tsx | 12 ++-- .../test/SignerListSetTableDetail.test.tsx | 8 +-- .../test/TicketCreateTableDetail.test.tsx | 4 +- .../test/TrustSetDescription.test.tsx | 4 +- .../test/TrustSetTableDetail.test.tsx | 2 +- .../UNLModify/test/UNLModifySimple.test.tsx | 2 +- .../XChainAccountCreateCommitSimple.test.tsx | 13 ++-- ...AddAccountCreateAttestationSimple.test.tsx | 17 ++--- .../XChainAddClaimAttestationSimple.test.tsx | 15 ++-- .../test/XChainClaimSimple.test.tsx | 9 +-- .../test/XChainCommitSimple.test.tsx | 11 +-- .../test/XChainCreateBridgeSimple.test.tsx | 15 ++-- .../test/XChainCreateClaimIDSimple.test.tsx | 11 +-- .../test/XChainModifyBridgeSimple.test.tsx | 13 ++-- .../Transaction/test/DefaultSimple.test.tsx | 70 +++++++++---------- .../Transaction/test/createRenderFactory.tsx | 18 ++--- 66 files changed, 402 insertions(+), 365 deletions(-) diff --git a/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx b/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx index 86d67aea0..1f678297f 100644 --- a/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx +++ b/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx @@ -3,8 +3,10 @@ import { Simple } from '../Simple' import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import bidMock from './mock_data/amm_bid.json' +const renderComponent = createSimpleRenderFactory(Simple) + describe('AMM Bid Tests', () => { - const renderComponent = createSimpleRenderFactory(Simple) + afterEach(cleanup) it('renders from transaction', () => { renderComponent(bidMock) diff --git a/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx b/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx index 2ac92aa55..a762ec65f 100644 --- a/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx +++ b/src/containers/shared/components/Transaction/AMMCreate/test/AMMCreate.test.tsx @@ -3,8 +3,10 @@ import { Simple } from '../Simple' import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import createMock from './mock_data/amm_create.json' +const renderComponent = createSimpleRenderFactory(Simple) + describe('AMM Create Tests', () => { - const renderComponent = createSimpleRenderFactory(Simple) + afterEach(cleanup) it('renders from transaction', () => { renderComponent(createMock) diff --git a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx index ebe153196..cb4d3266f 100644 --- a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx @@ -11,10 +11,10 @@ describe('AMMDelete: Description', () => { it('renders description for AMMDelete transaction', () => { renderComponent(mockAMMDelete) - expect(screen.find('[data-testid="amm-delete-description"]')).toHaveText( + expect(screen.getByTestId('amm-delete-description')).toHaveTextContent( 'Attempted to delete the AMM for \uE900 XRP and FOO.rm5c42Crqpdch5fbuCdHmSMV1wrL9arV9.If there were more than 512 trustlines, this only removes 512 trustlines instead.', ) - expect(screen.find('a')).toHaveProp( + expect(screen.findByRole('link')).toHaveAttribute( 'href', '/token/FOO.rm5c42Crqpdch5fbuCdHmSMV1wrL9arV9', ) diff --git a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx index 8461f01ce..2170bceb2 100644 --- a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteTableDetail.test.tsx @@ -11,8 +11,8 @@ describe('AMMDelete: TableDetail', () => { it('renders with an expiration and offer', () => { renderComponent(mockAMMDelete) - expect(screen.find('[data-testid="asset"]')).toHaveText('Asset 1\uE900 XRP') - expect(screen.find('[data-testid="asset2"]')).toHaveText( + expect(screen.getByTestId('asset')).toHaveTextContent('Asset 1\uE900 XRP') + expect(screen.getByTestId('asset2')).toHaveTextContent( 'Asset 2FOO.rm5c42Crqpdch5fbuCdHmSMV1wrL9arV9', ) }) diff --git a/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx b/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx index 51348bbec..7b07a2c6c 100644 --- a/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDeposit/test/AMMDeposit.test.tsx @@ -12,8 +12,10 @@ import depositEprice from './mock_data/deposit_eprice.json' import depositNonXRP from './mock_data/deposit_nonxrp.json' import depositFail from './mock_data/deposit_fail.json' +const renderComponent = createSimpleRenderFactory(Simple) + describe('AMM Deposit Tests', () => { - const renderComponent = createSimpleRenderFactory(Simple) + afterEach(cleanup) it('renders with both assets', () => { renderComponent(depositBothAssets) diff --git a/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx b/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx index 2ce3e9207..9d56c8dac 100644 --- a/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx +++ b/src/containers/shared/components/Transaction/AMMVote/test/AMMVote.test.tsx @@ -3,8 +3,10 @@ import { Simple } from '../Simple' import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' import voteMock from './mock_data/amm_vote.json' +const renderComponent = createSimpleRenderFactory(Simple) + describe('AMM Vote Tests', () => { - const renderComponent = createSimpleRenderFactory(Simple) + afterEach(cleanup) it('renders from transaction', () => { renderComponent(voteMock) diff --git a/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx b/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx index c997e1d7a..07ce37a25 100644 --- a/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx +++ b/src/containers/shared/components/Transaction/AMMWithdraw/test/AMMWithdraw.test.tsx @@ -10,8 +10,10 @@ import withdrawUSDMock from './mock_data/withdraw_usd.json' import withdrawXRPMock from './mock_data/withdraw_xrp.json' import withdrawEpriceMock from './mock_data/withdraw_eprice.json' +const renderComponent = createSimpleRenderFactory(Simple) + describe('AMM Withdraw Tests', () => { - const renderComponent = createSimpleRenderFactory(Simple) + afterEach(cleanup) it('renders from transaction', () => { renderComponent(withdrawMock) diff --git a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx index 31be25dd4..4f0e3c5f7 100644 --- a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetDescription.test.tsx @@ -14,12 +14,14 @@ const renderComponent = createDescriptionRenderFactory(Description, i18n) describe('AccountSet: Description', () => { afterEach(cleanup) it('renders tx that sets the domain', () => { - renderComponent(mockAccountSetWithDomain) - expect(screen).toHaveText('It sets the account domain as mduo13.com') + const { container } = renderComponent(mockAccountSetWithDomain) + expect(container).toHaveTextContent( + 'It sets the account domain as mduo13.com', + ) }) it('renders tx that sets the email hash', () => { - renderComponent({ + const { container } = renderComponent({ ...mockAccountSetWithDomain, tx: { ...mockAccountSetWithDomain.tx, @@ -27,47 +29,51 @@ describe('AccountSet: Description', () => { EmailHash: '7AC3878BF42A5329698F468A6AAA03B9', }, }) - expect(screen).toHaveText( + expect(container).toHaveTextContent( 'It sets the account email hash as 7AC3878BF42A5329698F468A6AAA03B9', ) }) it('renders tx that clears a flag', () => { - renderComponent(mockAccountSetWithClearFlag) - expect(screen).toHaveText('It clears the account flag asfGlobalFreeze') + const { container } = renderComponent(mockAccountSetWithClearFlag) + expect(container).toHaveTextContent( + 'It clears the account flag asfGlobalFreeze', + ) }) it('renders tx that sets a flag', () => { - renderComponent(mockAccountSetWithSetFlag) - expect(screen).toHaveText('It sets the account flag asfRequireDest') + const { container } = renderComponent(mockAccountSetWithSetFlag) + expect(container).toHaveTextContent( + 'It sets the account flag asfRequireDest', + ) }) it('renders tx that clears a flag that is not defined', () => { - renderComponent({ + const { container } = renderComponent({ ...mockAccountSetWithClearFlag, tx: { ...mockAccountSetWithClearFlag.tx, ClearFlag: 45 }, }) - expect(screen).toHaveText('It clears the account flag 45') + expect(container).toHaveTextContent('It clears the account flag 45') }) it('renders tx that sets a flag that is not defined', () => { - renderComponent({ + const { container } = renderComponent({ ...mockAccountSetWithSetFlag, tx: { ...mockAccountSetWithSetFlag.tx, SetFlag: 45 }, }) - expect(screen).toHaveText('It sets the account flag 45') + expect(container).toHaveTextContent('It sets the account flag 45') }) it('renders tx that sets a message', () => { renderComponent(mockAccountSetWithMessageKey) - expect(screen.find('[data-testid="message-key"]')).toHaveText( + expect(screen.getByTestId('message-key')).toHaveTextContent( 'It sets the account message key as 020000000000000000000000000941C216565D33C8A8ACD1A33C359E84D652D1DA', ) }) it('renders tx that sets a minter', () => { renderComponent(mockAccountSetWithNFTokenMinter) - expect(screen.find('[data-testid="minter"]')).toHaveText( + expect(screen.getByTestId('minter')).toHaveTextContent( 'It sets rXMART8usFd5kABXCayoP6ZfB35b4v43t as the authorized minter for this account', ) }) diff --git a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx index f765ae0c5..b471b35e3 100644 --- a/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/AccountSet/test/AccountSetTableDetail.test.tsx @@ -14,12 +14,12 @@ const renderComponent = createTableDetailRenderFactory(TableDetail, i18n) describe('AccountSet: TableDetail', () => { afterEach(cleanup) it('renders tx that sets the domain', () => { - renderComponent(mockAccountSetWithDomain) - expect(screen).toHaveText('domain: mduo13.com') + const { container } = renderComponent(mockAccountSetWithDomain) + expect(container).toHaveTextContent('domain: mduo13.com') }) it('renders tx that sets the email hash', () => { - renderComponent({ + const { container } = renderComponent({ ...mockAccountSetWithDomain, tx: { ...mockAccountSetWithDomain.tx, @@ -27,45 +27,47 @@ describe('AccountSet: TableDetail', () => { EmailHash: '7AC3878BF42A5329698F468A6AAA03B9', }, }) - expect(screen).toHaveText('email hash: 7AC3878BF42A5329698F468A6AAA03B9') + expect(container).toHaveTextContent( + 'email hash: 7AC3878BF42A5329698F468A6AAA03B9', + ) }) it('renders tx that clears a flag', () => { - renderComponent(mockAccountSetWithClearFlag) - expect(screen).toHaveText('clear flag: asfGlobalFreeze') + const { container } = renderComponent(mockAccountSetWithClearFlag) + expect(container).toHaveTextContent('clear flag: asfGlobalFreeze') }) it('renders tx that sets a flag', () => { - renderComponent(mockAccountSetWithSetFlag) - expect(screen).toHaveText('set flag: asfRequireDest') + const { container } = renderComponent(mockAccountSetWithSetFlag) + expect(container).toHaveTextContent('set flag: asfRequireDest') }) it('renders tx that clears a flag that is not defined', () => { - renderComponent({ + const { container } = renderComponent({ ...mockAccountSetWithClearFlag, tx: { ...mockAccountSetWithClearFlag.tx, ClearFlag: 45 }, }) - expect(screen).toHaveText('clear flag: 45') + expect(container).toHaveTextContent('clear flag: 45') }) it('renders tx that sets a flag that is not defined', () => { - renderComponent({ + const { container } = renderComponent({ ...mockAccountSetWithSetFlag, tx: { ...mockAccountSetWithSetFlag.tx, SetFlag: 45 }, }) - expect(screen).toHaveText('set flag: 45') + expect(container).toHaveTextContent('set flag: 45') }) it('renders tx that sets a message', () => { - renderComponent(mockAccountSetWithMessageKey) - expect(screen).toHaveText( + const { container } = renderComponent(mockAccountSetWithMessageKey) + expect(container).toHaveTextContent( 'message key: 020000000000000000000000000941C216565D33C8A8ACD1A33C359E84D652D1DA', ) }) it('renders tx that sets a minter', () => { renderComponent(mockAccountSetWithNFTokenMinter) - expect(screen.find('[data-testid="minter"]')).toHaveText( + expect(screen.getByTestId('minter')).toHaveTextContent( 'NFT Minter: rXMART8usFd5kABXCayoP6ZfB35b4v43t', ) }) diff --git a/src/containers/shared/components/Transaction/Clawback/TableDetail.tsx b/src/containers/shared/components/Transaction/Clawback/TableDetail.tsx index 0811fe42c..18f8b5a73 100644 --- a/src/containers/shared/components/Transaction/Clawback/TableDetail.tsx +++ b/src/containers/shared/components/Transaction/Clawback/TableDetail.tsx @@ -13,7 +13,7 @@ export const TableDetail = ({ return (
{amount && holder && ( -
+
{t('claws_back')} diff --git a/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx b/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx index a6121da3c..34a4a4c2b 100644 --- a/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx +++ b/src/containers/shared/components/Transaction/Clawback/test/ClawbackDescription.test.tsx @@ -6,13 +6,14 @@ import i18n from '../../../../../../i18n/testConfigEnglish' const renderComponent = createDescriptionRenderFactory(Description, i18n) -describe('Clawback', () => { +describe('Clawback - Description', () => { + afterEach(cleanup) it('handles Clawback Description ', () => { renderComponent(transaction) - expect(screen.find('[data-testid="from-to-line"]')).toHaveText( + expect(screen.getByTestId('from-to-line')).toHaveTextContent( `rDZ713igKfedN4hhY6SjQse4Mv3ZrBxnn9 claws back from rscBWQpyZEmQvupeB1quu7Ky8YX4f5CHDP`, ) - expect(screen.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.getByTestId('amount-line')).toHaveTextContent( `The max clawback amount is 4,840.00 FOO.rDZ713igKfedN4hhY6SjQse4Mv3ZrBxnn9`, ) }) diff --git a/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx b/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx index 50e025742..f6d0e013a 100644 --- a/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx +++ b/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx @@ -14,7 +14,8 @@ jest.mock('react-query', () => ({ const renderComponent = createSimpleRenderFactory(Simple) -describe('Clawback', () => { +describe('Clawback - Simple', () => { + afterEach(cleanup) it('handles Clawback simple view ', () => { renderComponent(transaction) expectSimpleRowText(screen, 'holder', 'rscBWQpyZEmQvupeB1quu7Ky8YX4f5CHDP') diff --git a/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx b/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx index a01814d4e..770dd7f0a 100644 --- a/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/Clawback/test/ClawbackTableDetail.test.tsx @@ -5,10 +5,11 @@ import transaction from './mock_data/Clawback.json' const renderComponent = createTableDetailRenderFactory(TableDetail) -describe('Clawback', () => { +describe('Clawback - TableDetail', () => { + afterEach(cleanup) it('handles Clawback TableDetail ', () => { renderComponent(transaction) - expect(screen.find('.clawback')).toHaveText( + expect(screen.getByTestId('clawback')).toHaveTextContent( `claws_back3,840.00 FOO.rDZ713igKfedN4hhY6SjQse4Mv3ZrBxnn9fromrscBWQpyZEmQvupeB1quu7Ky8YX4f5CHDP`, ) }) diff --git a/src/containers/shared/components/Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx b/src/containers/shared/components/Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx index b79391e3b..f7936a246 100644 --- a/src/containers/shared/components/Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx +++ b/src/containers/shared/components/Transaction/DIDDelete/test/DIDDeleteSimple.test.tsx @@ -1,4 +1,4 @@ -import { cleanup, screen } from '@testing-library/react' +import { cleanup } from '@testing-library/react' import { createSimpleRenderFactory } from '../../test' import { Simple } from '../Simple' import DIDDelete from './mock_data/DIDDelete.json' diff --git a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx index 873ad7cc4..c448a5d16 100644 --- a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx @@ -1,4 +1,4 @@ -import { cleanup, screen } from '@testing-library/react' +import { cleanup } from '@testing-library/react' import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import DIDSet from './mock_data/DIDSet.json' @@ -8,8 +8,10 @@ const renderComponent = createTableDetailRenderFactory(TableDetail) describe('DIDSet: TableDetail', () => { afterEach(cleanup) it('renders', () => { - renderComponent(DIDSet) + const { container } = renderComponent(DIDSet) // eslint-disable-next-line no-useless-concat -- easier to read this way - expect(screen).toHaveText('uri: did_example' + 'did_document: doc') + expect(container).toHaveTextContent( + 'uri: did_example' + 'did_document: doc', + ) }) }) diff --git a/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx b/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx index f5aaa4bd7..e4103b248 100644 --- a/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx @@ -60,7 +60,7 @@ describe('EnableAmendment: Simple', () => { expectSimpleRowText(screen, 'status', 'Lost Majority') expectSimpleRowLabel(screen, 'version', 'Introduced In') expectSimpleRowText(screen, 'version', 'Loading') - expect(screen.find('[data-testid="date"]')).not.toExist() + expect(screen.getByTestId('date')).not.toExist() await flushPromises() @@ -87,7 +87,7 @@ describe('EnableAmendment: Simple', () => { expectSimpleRowText(screen, 'name', 'ExpandedSignerList') expectSimpleRowText(screen, 'version', 'v1.9.1') - expect(screen.find('[data-testid="name"] .value a')).toHaveProp( + expect(screen.getByTestId('name')).toHaveAttribute( 'href', '/amendment/B2A4DB846F0891BF2C76AB2F2ACC8F5B4EC64437135C6E56F3F859DE5FFD5856', ) diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx index 4cd6b63c0..b60a1559e 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx @@ -1,14 +1,15 @@ -import { cleanup, screen } from '@testing-library/react' +import { cleanup } from '@testing-library/react' import EscrowCancel from './mock_data/EscrowCancel.json' import { Description } from '../Description' import { createDescriptionRenderFactory } from '../../test' const renderComponent = createDescriptionRenderFactory(Description) -describe('EscrowCancelDescription', () => { +describe('EscrowCancel - Description', () => { + afterEach(cleanup) it('renders description for EscrowCancel', () => { - renderComponent(EscrowCancel) - expect(screen.html()).toBe( + const { container } = renderComponent(EscrowCancel) + expect(container).toHaveHTML( '
escrow_cancellation_desc
The escrowed amount of\uE900135.79XRPwas returned to (\uE900135.78999XRP escrow_after_transaction_cost)
The escrow was created bywith transactionA979AD...', ) }) diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx index 7194c2396..5fdf3c4f3 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelSimple.test.tsx @@ -5,16 +5,17 @@ import mockEscrowCancel from './mock_data/EscrowCancel.json' const renderComponent = createSimpleRenderFactory(Simple) -describe('EscrowCancelSimple', () => { +describe('EscrowCancel - Simple', () => { + afterEach(cleanup) it('renders with an expiration and offer', () => { renderComponent(mockEscrowCancel) - expect(screen.find('[data-testid="escrow-amount"] .value')).toHaveText( + expect(screen.getByTestId('escrow-amount')).toHaveTextContent( `\uE900135.79 XRP`, ) - expect(screen.find('[data-testid="escrow-cancel"] .value')).toHaveText( + expect(screen.getByTestId('escrow-cancel')).toHaveTextContent( 'rpmqbo5FWoydTL2Ufh5YdtzmRjbeLyxt56 - 9', ) - expect(screen.find('[data-testid="escrow-cancel-tx"] .value')).toHaveText( + expect(screen.getByTestId('escrow-cancel-tx')).toHaveTextContent( `A979AD5C6A6C844913DA51D71BF5F0B8E254D9A211FA837C4B322C4A8FD358E6`, ) }) diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx index c4a49aac9..0ccd01a87 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx @@ -9,10 +9,11 @@ const renderComponent = createTableDetailRenderFactory( i18nTestConfigEnUS, ) -describe('EscrowCancelTableDetail', () => { +describe('EscrowCancel - TableDetail', () => { + afterEach(cleanup) it('renders EscrowCancel without crashing', () => { - renderComponent(mockEscrowCancel) - expect(screen).toHaveText( + const { container } = renderComponent(mockEscrowCancel) + expect(container).toHaveTextContent( 'cancel escrow rpmqbo5FWoydTL2Ufh5YdtzmRjbeLyxt56 - 9', ) }) diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx index 8ee258639..914ea66fd 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx @@ -5,10 +5,11 @@ import { createDescriptionRenderFactory } from '../../test' const renderComponent = createDescriptionRenderFactory(Description) -describe('EscrowCreateDescription', () => { +describe('EscrowCreate - Description', () => { + afterEach(cleanup) it('renders description for EscrowCreate', () => { - renderComponent(EscrowCreate) - expect(screen.html()).toBe( + const { container } = renderComponent(EscrowCreate) + expect(container).toHaveHTML( 'The escrow is fromto
escrow_condition A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120
escrowed_amount \uE900997.50XRP
describe_cancel_after March 1, 2020 at 8:54:20 AM UTC
describe_finish_after March 1, 2020 at 9:01:00 AM UTC
', ) }) diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx index 1ed7b8a16..a0298da58 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateSimple.test.tsx @@ -5,16 +5,17 @@ import { createSimpleRenderFactory } from '../../test/createRenderFactory' const renderComponent = createSimpleRenderFactory(Simple) -describe('EscrowCreateSimple', () => { +describe('EscrowCreate - Simple', () => { + afterEach(cleanup) it('renders with an expiration and offer', () => { renderComponent(mockEscrowCreate) - expect(screen.find('[data-testid="escrow-amount"] .value')).toHaveText( + expect(screen.getByTestId('escrow-amount')).toHaveTextContent( `\uE900997.50 XRP`, ) - expect(screen.find('[data-testid="escrow-destination"] .value')).toHaveText( + expect(screen.getByTestId('escrow-destination')).toHaveTextContent( `rLbgNAngLq3HABBXK4uPGCHrqeZwgaYi7q`, ) - expect(screen.find('[data-testid="escrow-condition"] .value')).toHaveText( + expect(screen.getByTestId('escrow-condition')).toHaveTextContent( `A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120`, ) }) diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx index c9246d767..3c72a0ebf 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx @@ -6,19 +6,20 @@ import mockEscrowCreate from './mock_data/EscrowCreate.json' const renderComponent = createTableDetailRenderFactory(TableDetail) describe('EscrowCreateTableDetail', () => { + afterEach(cleanup) it('renders EscrowCreate without crashing', () => { renderComponent(mockEscrowCreate) - expect(screen.find('[data-testid="account"]')).toHaveText( + expect(screen.getByTestId('account')).toHaveTextContent( ` rLbgNAngLq3HABBXK4uPGCHrqeZwgaYi7q `, ) - expect(screen.find('[data-testid="amount"]')).toHaveText(`997.50 XRP`) - expect(screen.find('[data-testid="condition"]')).toHaveText( + expect(screen.getByTestId('amount')).toHaveTextContent(`997.50 XRP`) + expect(screen.getByTestId('condition')).toHaveTextContent( ` A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120 `, ) - expect(screen.find('[data-testid="finish_after"]')).toHaveText( + expect(screen.getByTestId('finish_after')).toHaveTextContent( `March 1, 2020 at 9:01:00 AM UTC`, ) - expect(screen.find('[data-testid="cancel_after"]')).toHaveText( + expect(screen.getByTestId('cancel_after')).toHaveTextContent( `March 1, 2020 at 8:54:20 AM UTC`, ) }) diff --git a/src/containers/shared/components/Transaction/EscrowFinish/TableDetail.tsx b/src/containers/shared/components/Transaction/EscrowFinish/TableDetail.tsx index 6fec08777..f9fbb6918 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/TableDetail.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/TableDetail.tsx @@ -24,7 +24,7 @@ export const TableDetail = (props: any) => {
)} {fulfillment && ( -
+
{t('fulfillment')} {fulfillment}
diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx index da89428e1..62fbe8c3a 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx @@ -1,14 +1,15 @@ -import { cleanup, screen } from '@testing-library/react' +import { cleanup } from '@testing-library/react' import EscrowFinish from './mock_data/EscrowFinish.json' import { Description } from '../Description' import { createDescriptionRenderFactory } from '../../test' const renderComponent = createDescriptionRenderFactory(Description) -describe('EscrowFinishDescription', () => { +describe('EscrowFinish - Description', () => { + afterEach(cleanup) it('renders description for EscrowFinish', () => { - renderComponent(EscrowFinish) - expect(screen.html()).toBe( + const { container } = renderComponent(EscrowFinish) + expect(container).toHaveHTML( '
escrow_completion_desc
The escrowed amount of\uE9000.0154XRPwas delivered to (\uE9000.015388XRP escrow_after_transaction_cost)
The escrow was created bywith transaction3E2E75...
escrow_finish_fullfillment_desc Fulfillment
', ) }) diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx index 43c927d26..34fa7dfa0 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishSimple.test.tsx @@ -5,13 +5,14 @@ import mockEscrowFinish from './mock_data/EscrowFinish.json' const renderComponent = createSimpleRenderFactory(Simple) -describe('EscrowFinishSimple', () => { +describe('EscrowFinish - Simple', () => { + afterEach(cleanup) it('renders with an expiration and offer', () => { renderComponent(mockEscrowFinish) - expect(screen.find('[data-testid="escrow-amount"] .value')).toHaveText( + expect(screen.getByTestId('escrow-amount')).toHaveTextContent( `\uE9000.0154 XRP`, ) - expect(screen.find('[data-testid="escrow-tx"] .value')).toHaveText( + expect(screen.getByTestId('escrow-tx')).toHaveTextContent( `3E2E755FA75FF1020C39E2ECC407E9F1C0E49A7229EDD15FF93B9F869878F1CC`, ) }) diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx index 7fbacc8eb..273e80827 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx @@ -5,16 +5,17 @@ import mockEscrowFinish from './mock_data/EscrowFinish.json' const renderComponent = createTableDetailRenderFactory(TableDetail) -describe('EscrowFinishTableDetail', () => { +describe('EscrowFinish - TableDetail', () => { + afterEach(cleanup) it('renders EscrowFinish without crashing', () => { renderComponent(mockEscrowFinish) - expect(screen.find('[data-testid="escrow-account"]')).toHaveText( + expect(screen.getByTestId('escrow-account')).toHaveTextContent( `finish_escrowr4UDXF4nL7Tgss8uQxn39cCocd8GnGyXS8 -28`, ) - expect(screen.find('[data-testid="escrow-amount"]')).toHaveText( + expect(screen.getByTestId('escrow-amount')).toHaveTextContent( `\uE9000.0154 XRP`, ) - expect(screen.find('[data-testid="escrow-fullfillment"]')).toHaveText( + expect(screen.getByTestId('escrow-fulfillment')).toHaveTextContent( `fulfillment Fulfillment `, ) }) diff --git a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx index 4034264ea..cbbd68609 100644 --- a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx @@ -9,7 +9,8 @@ import { expectSimpleRowText, expectSimpleRowNotToExist } from '../../test' const renderComponent = createSimpleRenderFactory(Simple) -describe('NFTokenAcceptOffer', () => { +describe('NFTokenAcceptOffer - Simple', () => { + afterEach(cleanup) it('handles NFTokenAcceptOffer Buy simple view ', () => { renderComponent(transactionBuy) @@ -66,7 +67,7 @@ describe('NFTokenAcceptOffer', () => { 'token-id', '00081B581189F5687DBB7516339D6CCB5593D96622AD82DF08CFDA8600000A17', ) - expect(screen.find('[data-testid="offer-id"] .value').length).toBe(2) + expect(screen.getAllByTestId('offer-id').length).toBe(2) expectSimpleRowText(screen, 'amount', '\uE9002,500.00 XRP') expectSimpleRowText(screen, 'buyer', 'rNYKGnHrjSnKXQGgACciyCLg4xRcwWZixN') expectSimpleRowText(screen, 'seller', 'rnp9DA6H2tLH7YFkgpjoVREB2yccYv56Sg') diff --git a/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx index 1c05dfd69..36458d0c7 100644 --- a/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx @@ -11,6 +11,7 @@ import transactionByIssuer from './mock_data/NFTokenBurnByIssuer.json' const renderComponent = createSimpleRenderFactory(Simple) describe('NFTokenBurn', () => { + afterEach(cleanup) it('handles NFTokenBurn simple view ', () => { renderComponent(transaction) expectSimpleRowText( diff --git a/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx index 9c32d4e5f..d7343a282 100644 --- a/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx @@ -21,16 +21,16 @@ describe('NFTokenCancelOffer', () => { , ) - expect(screen.find('[data-testid="token-id"] .value')).toHaveText( + expect(screen.getByTestId('token-id')).toHaveTextContent( '000800006203F49C21D5D6E022CB16DE3538F248662FC73C258BA1B200000018', ) - expect(screen.find('[data-testid="offer-id"] .value')).toHaveText( + expect(screen.getByTestId('offer-id')).toHaveTextContent( '35F3D6D99548FA5F5315580FBF8BA6B15CAA2CAE93023D5CE4FDC130602BC5C3', ) - expect(screen.find('[data-testid="amount"] .value')).toHaveText( + expect(screen.getByTestId('amount')).toHaveTextContent( '$100.00 USD.r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g', ) - expect(screen.find('[data-testid="offerer"] .value')).toHaveText( + expect(screen.getByTestId('offerer')).toHaveTextContent( 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g', ) }) diff --git a/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx index b840ec306..e58a7f321 100644 --- a/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx @@ -23,7 +23,7 @@ describe('NFTokenCreateOffer', () => { ) expectSimpleRowText(screen, 'owner', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g') expectSimpleRowText(screen, 'amount', '\uE9000.0001 XRP') - expect(screen.find('[data-testid="buyer-or-seller"] .label')).toHaveText( + expect(screen.getByTestId("buyer-or-seller"] .label')).toHaveTextContent( 'buyer', ) expectSimpleRowText( @@ -31,7 +31,7 @@ describe('NFTokenCreateOffer', () => { 'buyer-or-seller', 'rfFRmXUR1yfxeUfXj7WwKhETrtToYx1hYh', ) - expect(screen.find('[data-testid="destination"] .value')).not.toExist() + expect(screen.getByTestId("destination")).not.toExist() }) it('handles NFTokenCreateOffer sell simple view ', () => { @@ -46,13 +46,13 @@ describe('NFTokenCreateOffer', () => { 'offer-id', 'F660CA62E16B8067649052E8FCE947049FC6EF0D8B42EF7E5819997EC5AE45B6', ) - expect(screen.find('[data-testid="owner"] .value')).not.toExist() + expect(screen.getByTestId("owner")).not.toExist() expectSimpleRowText( screen, 'amount', '$100.00 USD.r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g', ) - expect(screen.find('[data-testid="buyer-or-seller"] .label')).toHaveText( + expect(screen.getByTestId("buyer-or-seller"] .label')).toHaveTextContent( 'seller', ) expectSimpleRowText( @@ -60,7 +60,7 @@ describe('NFTokenCreateOffer', () => { 'buyer-or-seller', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g', ) - expect(screen.find('[data-testid="destination"] .value')).not.toExist() + expect(screen.getByTestId("destination")).not.toExist() }) it('handles failed NFTokenCreateOffer transaction', () => { @@ -70,8 +70,8 @@ describe('NFTokenCreateOffer', () => { 'token-id', '00080000AC7377C74DD53E77C8161537F5EBF56B0CE8FD3BD392C2B800001702', ) - expect(screen.find('[data-testid="offer-id"] .value')).not.toExist() - expect(screen.find('[data-testid="owner"] .value')).not.toExist() + expect(screen.getByTestId("offer-id")).not.toExist() + expect(screen.getByTestId("owner")).not.toExist() expectSimpleRowText(screen, 'amount', '\uE900500.00 XRP') }) diff --git a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx index 19cb7f8a2..d1c3d5cf9 100644 --- a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx @@ -97,7 +97,7 @@ describe('NFTokenMint', () => { , ) - expect(screen.find('[data-testid="token-issuer"] .value')).toExist() + expect(screen.getByTestId('token-issuer')).toExist() expectSimpleRowText( screen, 'token-id', diff --git a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx index 6d22d2259..571811c5f 100644 --- a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx @@ -10,7 +10,7 @@ describe('OfferCancel: Description', () => { it('renders', () => { renderComponent(offerCancel) - expect(screen.find('[data-testid="cancel-line"]')).toHaveText( + expect(screen.getByTestId('cancel-line')).toHaveTextContent( 'offer_cancel_description15239384', ) }) diff --git a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx index c8cf75cfa..deb86fa67 100644 --- a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx @@ -8,8 +8,7 @@ const renderComponent = createTableDetailRenderFactory(TableDetail) describe('OfferCancel: TableDetail', () => { afterEach(cleanup) it('renders', () => { - renderComponent(offerCancel) - - expect(screen).toHaveText('cancel_offer #15239384') + const { container } = renderComponent(offerCancel) + expect(container).toHaveTextContent('cancel_offer #15239384') }) }) diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx index b0900966a..fd34bf988 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx @@ -9,17 +9,17 @@ const renderComponent = createDescriptionRenderFactory(Description) describe('OfferCreate: Description', () => { afterEach(cleanup) it('renders description for transaction with cancel and expiration', () => { - renderComponent(OfferCreate) + const { container } = renderComponent(OfferCreate) - expect(screen.html()).toBe( + expect(container).toHaveHTML( '
The accountoffered to pay1,080,661.95882CSCin order to receive\uE9001,764.293151XRP
offer_create_desc_line_2 612.52XRP/CSC
offer_create_desc_line_3 44866443
The offer expiresMay 18, 2022 at 5:28:16 PM UTCunless cancelled before', ) }) it('renders description for transaction with inverted currencies', () => { - renderComponent(OfferCreateInvertedCurrencies) + const { container } = renderComponent(OfferCreateInvertedCurrencies) - expect(screen.html()).toBe( + expect(container).toHaveHTML( '
The accountoffered to pay\uE90017,588.363594XRPin order to receive$6,101.33033905USD
offer_create_desc_line_2 0.34690XRP/USD
offer_create_desc_line_3 80543309
', ) }) diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx index 385a32a9e..2a0e80ad6 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx @@ -10,16 +10,16 @@ describe('OfferCreate: Simple', () => { afterEach(cleanup) it('renders with an expiration and offer', () => { renderComponent(mockOfferCreateWithCancel) - expect(screen.find('[data-testid="amount"] .one-line')).toHaveText( + expect(screen.getByTestId("amount"] .one-line')).toHaveTextContent( '\uE900 XRP/CSC.rCSC', ) - expect(screen.find('[data-testid="cancel-id"] .value')).toHaveText( + expect(screen.getByTestId("cancel-id")).toHaveTextContent( '#44866443', ) - expect(screen.find('[data-testid="amount-buy"] .value')).toHaveText( + expect(screen.getByTestId("amount-buy")).toHaveTextContent( `\uE9001,764.293151 XRP`, ) - expect(screen.find('[data-testid="amount-sell"] .value')).toHaveText( + expect(screen.getByTestId("amount-sell")).toHaveTextContent( `1,080,661.95882 CSC.rCSCManTZ8ME9EoLrSHHYKW8PPwWMgkwr`, ) }) @@ -27,11 +27,11 @@ describe('OfferCreate: Simple', () => { it('renders', () => { renderComponent(mockOfferCreate) - expect(screen.find('[data-testid="offer-id"] .value')).not.toExist() - expect(screen.find('[data-testid="amount-buy"] .value')).toHaveText( + expect(screen.getByTestId("offer-id")).not.toExist() + expect(screen.getByTestId("amount-buy")).toHaveTextContent( `\uE90024,755.081083 XRP`, ) - expect(screen.find('[data-testid="amount-sell"] .value')).toHaveText( + expect(screen.getByTestId("amount-sell")).toHaveTextContent( `51.41523894 BCH.rcyS4CeCZVYvTiKcxj6Sx32ibKwcDHLds`, ) }) diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx index 109d363e7..ec1c3f3c8 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx @@ -12,16 +12,16 @@ describe('OfferCreate: TableDetail', () => { it('renders with an expiration and offer', () => { renderComponent(mockOfferCreateWithCancel) - expect(screen.find('[data-testid="pair"]')).toHaveText( + expect(screen.getByTestId("pair")).toHaveTextContent( 'price:612.518 \uE900 XRP/CSC.rCSC', ) - expect(screen.find('[data-testid="cancel-id"]')).toHaveText( + expect(screen.getByTestId("cancel-id")).toHaveTextContent( 'cancel_offer #44866443', ) - expect(screen.find('[data-testid="amount-buy"]')).toHaveText( + expect(screen.getByTestId("amount-buy")).toHaveTextContent( `\uE9001,764.293151 XRP`, ) - expect(screen.find('[data-testid="amount-sell"]')).toHaveText( + expect(screen.getByTestId("amount-sell")).toHaveTextContent( `1,080,661.95882 CSC.rCSCManTZ8ME9EoLrSHHYKW8PPwWMgkwr`, ) }) @@ -29,14 +29,14 @@ describe('OfferCreate: TableDetail', () => { it('renders', () => { renderComponent(mockOfferCreate) - expect(screen.find('[data-testid="pair"]')).toHaveText( + expect(screen.getByTestId("pair")).toHaveTextContent( 'price:0.00207696 \uE900 XRP/BCH.rcyS', ) - expect(screen.find('[data-testid="offer-id"]')).not.toExist() - expect(screen.find('[data-testid="amount-buy"]')).toHaveText( + expect(screen.getByTestId("offer-id").not.toExist() + expect(screen.getByTestId("amount-buy")).toHaveTextContent( `\uE90024,755.081083 XRP`, ) - expect(screen.find('[data-testid="amount-sell"]')).toHaveText( + expect(screen.getByTestId("amount-sell")).toHaveTextContent( `51.41523894 BCH.rcyS4CeCZVYvTiKcxj6Sx32ibKwcDHLds`, ) }) @@ -44,7 +44,7 @@ describe('OfferCreate: TableDetail', () => { it('renders inverted currencies', () => { renderComponent(mockOfferCreateInvertedCurrencies) - expect(screen.find('[data-testid="pair"]')).toHaveText( + expect(screen.getByTestId("pair")).toHaveTextContent( 'price:0.346896 \uE900 XRP/USD.rvYA', ) }) diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx index 7fab9daa8..200bf1bfc 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx @@ -17,15 +17,15 @@ describe('Payment: Description', () => { it('renders', () => { renderComponent(mockPayment) - expect(screen.find('[data-testid="from-to-line"]')).toHaveText( + expect(screen.getByTestId("from-to-line")).toHaveTextContent( `The payment is from rNQEMJA4PsoSrZRn9J6RajAYhcDzzhf8ok to rHoPwMC75KVUhBMeV3uDMybKG5JND74teh`, ) - expect(screen.find('[data-testid="source-tag-line"]')).not.toExist() - expect(screen.find('[data-testid="destination-tag-line"]')).not.toExist() - expect(screen.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.getByTestId("source-tag-line").not.toExist() + expect(screen.getByTestId("destination-tag-line").not.toExist() + expect(screen.getByTestId("amount-line")).toHaveTextContent( `It was instructed to deliver \uE9002,421.8268 XRP`, ) - expect(screen.find('[data-testid="delivered-line"]')).toHaveText( + expect(screen.getByTestId("delivered-line")).toHaveTextContent( `The actual amount delivered was \uE9002,421.8268 XRP`, ) }) @@ -33,31 +33,31 @@ describe('Payment: Description', () => { it('renders with failed partial conversion', () => { renderComponent(mockPaymentConvert) - expect(screen.find('[data-testid="from-to-line"]')).toHaveText( + expect(screen.getByTestId("from-to-line")).toHaveTextContent( `The payment is from r9x5PHDiwuvbpYB3uvGAqEUVV5wxHayQEx to r9x5PHDiwuvbpYB3uvGAqEUVV5wxHayQEx`, ) - expect(screen.find('[data-testid="source-tag-line"]')).not.toExist() - expect(screen.find('[data-testid="destination-tag-line"]')).not.toExist() - expect(screen.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.getByTestId("source-tag-line").not.toExist() + expect(screen.getByTestId("destination-tag-line").not.toExist() + expect(screen.getByTestId("amount-line")).toHaveTextContent( `It was instructed to deliver up to 1,140.00 YCN.r8HgVGenRTAiNSM5iqt9PX2D2EczFZhZr by spending up to \uE9001,140.00 XRP`, ) - expect(screen.find('[data-testid="delivered-line"]')).not.toExist() + expect(screen.getByTestId("delivered-line").not.toExist() }) it('renders with destination tag', () => { renderComponent(mockPaymentDestinationTag) - expect(screen.find('[data-testid="from-to-line"]')).toHaveText( + expect(screen.getByTestId("from-to-line")).toHaveTextContent( `The payment is from rDAE53VfMvftPB4ogpWGWvzkQxfht6JPxr to rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt`, ) - expect(screen.find('[data-testid="source-tag-line"]')).not.toExist() - expect(screen.find('[data-testid="destination-tag-line"]')).toHaveText( + expect(screen.getByTestId("source-tag-line").not.toExist() + expect(screen.getByTestId("destination-tag-line")).toHaveTextContent( `The destination tag is 381702`, ) - expect(screen.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.getByTestId("amount-line")).toHaveTextContent( `It was instructed to deliver \uE9001,531.267 XRP`, ) - expect(screen.find('[data-testid="delivered-line"]')).toHaveText( + expect(screen.getByTestId("delivered-line")).toHaveTextContent( `The actual amount delivered was \uE9001,531.267 XRP`, ) }) @@ -65,17 +65,17 @@ describe('Payment: Description', () => { it('renders with send max', () => { renderComponent(mockPaymentSendMax) - expect(screen.find('[data-testid="from-to-line"]')).toHaveText( + expect(screen.getByTestId("from-to-line")).toHaveTextContent( `The payment is from r3RaNVLvWjqqtFAawC6jbRhgKyFH7HvRS8 to rprcTynT68nYdKzDTefAZG9HjSHiYcnP4b`, ) - expect(screen.find('[data-testid="destination-tag-line"]')).toHaveText( + expect(screen.getByTestId("destination-tag-line")).toHaveTextContent( `The destination tag is 0`, ) - expect(screen.find('[data-testid="source-tag-line"]')).not.toExist() - expect(screen.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.getByTestId("source-tag-line").not.toExist() + expect(screen.getByTestId("amount-line")).toHaveTextContent( `It was instructed to deliver 17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA by spending up to 17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA`, ) - expect(screen.find('[data-testid="delivered-line"]')).toHaveText( + expect(screen.getByTestId("delivered-line")).toHaveTextContent( `The actual amount delivered was 17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA`, ) }) @@ -83,17 +83,17 @@ describe('Payment: Description', () => { it('renders with partial', () => { renderComponent(mockPaymentPartial) - expect(screen.find('[data-testid="from-to-line"]')).toHaveText( + expect(screen.getByTestId("from-to-line")).toHaveTextContent( `The payment is from rGTurN94Nn3RkJGSqy9MwmQCLpXZkELbnq to rMQ4oGC8fasuJwfdrfknFTttDbf8cR3D2j`, ) - expect(screen.find('[data-testid="destination-tag-line"]')).toHaveText( + expect(screen.getByTestId("destination-tag-line")).toHaveTextContent( `The destination tag is 0`, ) - expect(screen.find('[data-testid="source-tag-line"]')).not.toExist() - expect(screen.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.getByTestId("source-tag-line").not.toExist() + expect(screen.getByTestId("amount-line")).toHaveTextContent( `It was instructed to deliver up to 0.001043 xCoin.rXCoYSUnkpygdtfpz3Df8dKQuRZjM9UFi`, ) - expect(screen.find('[data-testid="delivered-line"]')).toHaveText( + expect(screen.getByTestId("delivered-line")).toHaveTextContent( `The actual amount delivered was 0.00104196 xCoin.rXCoYSUnkpygdtfpz3Df8dKQuRZjM9UFi`, ) }) @@ -101,10 +101,10 @@ describe('Payment: Description', () => { it('renders with SourceTag', () => { renderComponent(mockPaymentSourceTag) - expect(screen.find('[data-testid="source-tag-line"]')).toHaveText( + expect(screen.getByTestId("source-tag-line")).toHaveTextContent( `The source tag is 20648`, ) - expect(screen.find('[data-testid="destination-tag-line"]')).toHaveText( + expect(screen.getByTestId("destination-tag-line")).toHaveTextContent( `The destination tag is 412453880`, ) }) diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx index ca2ccc606..0bb2ad1b7 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx @@ -49,7 +49,7 @@ describe('Payment: Simple', () => { `0.00 YCN.r8HgVGenRTAiNSM5iqt9PX2D2EczFZhZrpartial_payment_allowed`, ) - expect(screen.find('[data-testid="destination"]')).not.toExist() + expect(screen.getByTestId("destination").not.toExist() }) it('renders with destination tag', () => { diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx index fa2c49b2c..2822aeaea 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx @@ -16,7 +16,7 @@ describe('Payment: TableDetail', () => { renderComponent(mockPayment) // styling makes this look okay - expect(screen.find('.payment')).toHaveText( + expect(screen.find('.payment')).toHaveTextContent( `send\uE9002,421.8268 XRPtorHoPwMC75KVUhBMeV3uDMybKG5JND74teh`, ) }) @@ -25,7 +25,7 @@ describe('Payment: TableDetail', () => { renderComponent(mockPaymentConvert) // styling makes this look okay - expect(screen.find('.payment')).toHaveText( + expect(screen.find('.payment')).toHaveTextContent( `convert_maximum1,140.00 XRPto0.00 YCN.r8HgVGenRTAiNSM5iqt9PX2D2EczFZhZrpartial_payment_allowed`, ) }) @@ -34,7 +34,7 @@ describe('Payment: TableDetail', () => { renderComponent(mockPaymentDestinationTag) // styling makes this look okay - expect(screen.find('.payment')).toHaveText( + expect(screen.find('.payment')).toHaveTextContent( `send1,531.267 XRPtorHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt:381702`, ) }) @@ -43,7 +43,7 @@ describe('Payment: TableDetail', () => { renderComponent(mockPaymentSendMax) // styling makes this look okay - expect(screen.find('.payment')).toHaveText( + expect(screen.find('.payment')).toHaveTextContent( `send17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjAtorprcTynT68nYdKzDTefAZG9HjSHiYcnP4b:0`, ) }) @@ -52,7 +52,7 @@ describe('Payment: TableDetail', () => { renderComponent(mockPaymentPartial) // styling makes this look okay - expect(screen.find('.payment')).toHaveText( + expect(screen.find('.payment')).toHaveTextContent( `send0.00104196 xCoin.rXCoYSUnkpygdtfpz3Df8dKQuRZjM9UFitorMQ4oGC8fasuJwfdrfknFTttDbf8cR3D2j:0partial_payment_allowed`, ) }) @@ -60,6 +60,6 @@ describe('Payment: TableDetail', () => { it('renders with SourceTag', () => { renderComponent(mockPaymentSourceTag) - expect(screen.find('.st')).toHaveText('source_tag: 20648') + expect(screen.find('.st')).toHaveTextContent('source_tag: 20648') }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx index 8dcedb091..f788ff141 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx @@ -14,55 +14,55 @@ describe('PaymentChannelClaim: Description', () => { afterEach(cleanup) it('renders a claim', () => { renderComponent(mockPaymentChannelClaim) - expect(screen.find('[data-testid="account-line"]')).toHaveText( + expect(screen.getByTestId("account-line")).toHaveTextContent( `The transaction was initiated by rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN`, ) - expect(screen.find('[data-testid="channel-line"]')).toHaveText( + expect(screen.getByTestId("channel-line")).toHaveTextContent( `It will update the payment channel 50107651E7163E294CE0EAD8A20BF7CC046304480FCC9C74A49FFAB3F46FB98E`, ) - expect(screen.find('[data-testid="balance-line"]')).toHaveText( + expect(screen.getByTestId("balance-line")).toHaveTextContent( `The channel balance claimed is \uE90049.65716XRP (increased by \uE9000.01XRP)`, ) - expect(screen.find('[data-testid="closed-line"]')).not.toExist() + expect(screen.getByTestId("closed-line").not.toExist() }) it('renders tx with channel being closed', () => { renderComponent(mockPaymentChannelClaimClosed) - expect(screen.find('[data-testid="account-line"]')).toHaveText( + expect(screen.getByTestId("account-line")).toHaveTextContent( `The transaction was initiated by rH11fDGhbVH5NVXNXkGAMTmfWhUHjCtA3B`, ) - expect(screen.find('[data-testid="channel-line"]')).toHaveText( + expect(screen.getByTestId("channel-line")).toHaveTextContent( `It will update the payment channel 3BDB4F92432BCEB2385D3BAA60E8AAEC9B552890A240AEE4AA9E88C9E6C517E8`, ) - expect(screen.find('[data-testid="balance-line"]')).not.toExist() - expect(screen.find('[data-testid="closed-line"]')).toHaveText( + expect(screen.getByTestId("balance-line").not.toExist() + expect(screen.getByTestId("closed-line")).toHaveTextContent( `The payment channel will be closed, any remaining balance will be returned to the source account`, ) }) it('renders tx requesting channel be closed but not closing it', () => { renderComponent(mockPaymentChannelClaimCloseDenied) - expect(screen.find('[data-testid="account-line"]')).toHaveText( + expect(screen.getByTestId("account-line")).toHaveTextContent( `The transaction was initiated by rH11fDGhbVH5NVXNXkGAMTmfWhUHjCtA3B`, ) - expect(screen.find('[data-testid="channel-line"]')).toHaveText( + expect(screen.getByTestId("channel-line")).toHaveTextContent( `It will update the payment channel 3BDB4F92432BCEB2385D3BAA60E8AAEC9B552890A240AEE4AA9E88C9E6C517E8`, ) - expect(screen.find('[data-testid="balance-line"]')).not.toExist() - expect(screen.find('[data-testid="closed-line"]')).not.toExist() + expect(screen.getByTestId("balance-line").not.toExist() + expect(screen.getByTestId("closed-line").not.toExist() }) it('renders tx with destination tag', () => { renderComponent(mockPaymentChannelClaimWithDestinationTag) - expect(screen.find('[data-testid="account-line"]')).toHaveText( + expect(screen.getByTestId("account-line")).toHaveTextContent( `The transaction was initiated by rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn`, ) - expect(screen.find('[data-testid="channel-line"]')).toHaveText( + expect(screen.getByTestId("channel-line")).toHaveTextContent( `It will update the payment channel 5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3`, ) - expect(screen.find('[data-testid="balance-line"]')).toHaveText( + expect(screen.getByTestId("balance-line")).toHaveTextContent( `The channel balance claimed is \uE9001.00XRP (increased by \uE9001.00XRP)`, ) - expect(screen.find('[data-testid="closed-line"]')).not.toExist() + expect(screen.getByTestId("closed-line").not.toExist() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx index ebea4ee98..66379d06c 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx @@ -14,75 +14,75 @@ describe('PaymentChannelClaim: TableDetail', () => { afterEach(cleanup) it('renders a claim', () => { renderComponent(mockPaymentChannelClaim) - expect(screen.find('[data-testid="source"]')).toHaveText( + expect(screen.getByTestId('source')).toHaveTextContent( 'sourcernNzy3iPc7gPEAJbAdXwxY1UTBamBqTYhR:1002539517', ) - expect(screen.find('[data-testid="destination"]')).toHaveText( + expect(screen.getByTestId('destination')).toHaveTextContent( 'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) - expect(screen.find('[data-testid="claimed"]')).toHaveText( + expect(screen.getByTestId('claimed')).toHaveTextContent( 'claimed\uE9000.01 XRP (\uE90020.34284 XRP of \uE90070.00 XRP remaining)', ) - expect(screen.find('[data-testid="channel-amount"]')).not.toExist() - expect(screen.find('[data-testid="renew"]')).not.toExist() - expect(screen.find('[data-testid="close-request"]')).not.toExist() - expect(screen.find('[data-testid="closed"]')).not.toExist() + expect(screen.getByTestId('channel-amount')).not.toExist() + expect(screen.getByTestId('renew')).not.toExist() + expect(screen.getByTestId('close-request')).not.toExist() + expect(screen.getByTestId('closed')).not.toExist() }) it('renders tx with channel being closed', () => { renderComponent(mockPaymentChannelClaimClosed) - expect(screen.find('[data-testid="source"]')).toHaveText( + expect(screen.getByTestId('source')).toHaveTextContent( 'sourcerH11fDGhbVH5NVXNXkGAMTmfWhUHjCtA3B:2647131528', ) - expect(screen.find('[data-testid="destination"]')).toHaveText( + expect(screen.getByTestId('destination')).toHaveTextContent( 'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) - expect(screen.find('[data-testid="claimed"]')).not.toExist() - expect(screen.find('[data-testid="channel-amount"]')).toHaveText( + expect(screen.getByTestId('claimed')).not.toExist() + expect(screen.getByTestId('channel-amount')).toHaveTextContent( 'channel amount\uE90010.00 XRP', ) - expect(screen.find('[data-testid="renew"]')).not.toExist() - expect(screen.find('[data-testid="close-request"]')).toHaveText( + expect(screen.getByTestId('renew')).not.toExist() + expect(screen.getByTestId('close-request')).toHaveTextContent( 'close channel request', ) - expect(screen.find('[data-testid="closed"]')).toHaveText( + expect(screen.getByTestId('closed')).toHaveTextContent( 'payment channel closed', ) }) it('renders tx requesting channel be closed but not closing it', () => { renderComponent(mockPaymentChannelClaimCloseDenied) - expect(screen.find('[data-testid="source"]')).toHaveText( + expect(screen.getByTestId('source')).toHaveTextContent( 'sourcerH11fDGhbVH5NVXNXkGAMTmfWhUHjCtA3B:2647131528', ) - expect(screen.find('[data-testid="destination"]')).toHaveText( + expect(screen.getByTestId('destination')).toHaveTextContent( 'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) - expect(screen.find('[data-testid="claimed"]')).not.toExist() - expect(screen.find('[data-testid="channel-amount"]')).toHaveText( + expect(screen.getByTestId('claimed')).not.toExist() + expect(screen.getByTestId('channel-amount')).toHaveTextContent( 'channel amount\uE90010.00 XRP', ) - expect(screen.find('[data-testid="renew"]')).not.toExist() - expect(screen.find('[data-testid="close-request"]')).toHaveText( + expect(screen.getByTestId('renew')).not.toExist() + expect(screen.getByTestId('close-request')).toHaveTextContent( 'close channel request', ) - expect(screen.find('[data-testid="closed"]')).not.toExist() + expect(screen.getByTestId('closed')).not.toExist() }) it('renders tx with destination tag', () => { renderComponent(mockPaymentChannelClaimWithDestinationTag) - expect(screen.find('[data-testid="source"]')).toHaveText( + expect(screen.getByTestId('source')).toHaveTextContent( 'sourcerN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH', ) - expect(screen.find('[data-testid="destination"]')).toHaveText( + expect(screen.getByTestId('destination')).toHaveTextContent( 'destinationrf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn:20170428', ) - expect(screen.find('[data-testid="claimed"]')).toHaveText( + expect(screen.getByTestId('claimed')).toHaveTextContent( 'claimed\uE9001.00 XRP (\uE90099.00 XRP of \uE900100.00 XRP remaining)', ) - expect(screen.find('[data-testid="channel-amount"]')).not.toExist() - expect(screen.find('[data-testid="renew"]')).not.toExist() - expect(screen.find('[data-testid="close-request"]')).not.toExist() - expect(screen.find('[data-testid="closed"]')).not.toExist() + expect(screen.getByTestId('channel-amount')).not.toExist() + expect(screen.getByTestId('renew')).not.toExist() + expect(screen.getByTestId('close-request')).not.toExist() + expect(screen.getByTestId('closed')).not.toExist() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx index d87c7810b..36a3d7fa5 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx @@ -13,50 +13,50 @@ describe('PaymentChannelCreate: Description', () => { afterEach(cleanup) it('renders', () => { renderComponent(mockPaymentChannelCreate) - expect(screen.find('[data-testid="accounts-line"]')).toHaveText( + expect(screen.getByTestId("accounts-line")).toHaveTextContent( `The account rJnQrhRTXutuSwtrwxYiTkHn4Dtp8sF2LM:2460331042 will create a payment channel to rUXYat4hW2M87gHoqKK7fC4cqrT9C6V7d7`, ) - expect(screen.find('[data-testid="channel-line"]')).toHaveText( + expect(screen.getByTestId("channel-line")).toHaveTextContent( `The channel ID is 15AB9EE9344C42C05164E6A1F2F08B35F35D7B9D66CCB9697452B0995C8F8242`, ) - expect(screen.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.getByTestId("amount-line")).toHaveTextContent( `The channel amount is \uE9001.00 XRP`, ) - expect(screen.find('[data-testid="delay-line"]')).toHaveText( + expect(screen.getByTestId("delay-line")).toHaveTextContent( `The channel has a settlement delay of 3,600 seconds`, ) - expect(screen.find('[data-testid="cancel-line"]')).not.toExist() + expect(screen.getByTestId("cancel-line").not.toExist() }) it('renders failed tx', () => { renderComponent(mockPaymentChannelCreateFailed) - expect(screen.find('[data-testid="accounts-line"]')).toHaveText( + expect(screen.getByTestId("accounts-line")).toHaveTextContent( `The account rMphibGfHpLDU4DzVCspzLYVuMNpmzN6n8:2810223114 will create a payment channel to rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN`, ) - expect(screen.find('[data-testid="channel-line"]')).not.toExist() - expect(screen.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.getByTestId("channel-line").not.toExist() + expect(screen.getByTestId("amount-line")).toHaveTextContent( `The channel amount is \uE90010.00 XRP`, ) - expect(screen.find('[data-testid="delay-line"]')).toHaveText( + expect(screen.getByTestId("delay-line")).toHaveTextContent( `The channel has a settlement delay of 3,600 seconds`, ) - expect(screen.find('[data-testid="cancel-line"]')).not.toExist() + expect(screen.getByTestId("cancel-line").not.toExist() }) it('renders tx with destination tag', () => { renderComponent(mockPaymentChannelCreateWithDestinationTag) - expect(screen.find('[data-testid="accounts-line"]')).toHaveText( + expect(screen.getByTestId("accounts-line")).toHaveTextContent( `The account rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH will create a payment channel to rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn:20170428`, ) - expect(screen.find('[data-testid="channel-line"]')).toHaveText( + expect(screen.getByTestId("channel-line")).toHaveTextContent( `The channel ID is 5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3`, ) - expect(screen.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.getByTestId("amount-line")).toHaveTextContent( `The channel amount is \uE900100.00 XRP`, ) - expect(screen.find('[data-testid="delay-line"]')).toHaveText( + expect(screen.getByTestId("delay-line")).toHaveTextContent( `The channel has a settlement delay of 86,400 seconds`, ) - expect(screen.find('[data-testid="cancel-line"]')).not.toExist() + expect(screen.getByTestId("cancel-line").not.toExist() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx index 1825706df..985051d69 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx @@ -13,34 +13,34 @@ describe('PaymentChannelCreate: TableDetail', () => { afterEach(cleanup) it('renders', () => { renderComponent(mockPaymentChannelCreate) - expect(screen.find('[data-testid="source"]')).toHaveText( + expect(screen.getByTestId('source')).toHaveTextContent( 'sourcerJnQrhRTXutuSwtrwxYiTkHn4Dtp8sF2LM:2460331042', ) - expect(screen.find('[data-testid="destination"]')).toHaveText( + expect(screen.getByTestId('destination')).toHaveTextContent( 'destinationrUXYat4hW2M87gHoqKK7fC4cqrT9C6V7d7', ) - expect(screen.find('[data-testid="amount"]')).toHaveText('\uE9001.00 XRP') + expect(screen.getByTestId('amount')).toHaveTextContent('\uE9001.00 XRP') }) it('renders failed tx', () => { renderComponent(mockPaymentChannelCreateFailed) - expect(screen.find('[data-testid="source"]')).toHaveText( + expect(screen.getByTestId('source')).toHaveTextContent( 'sourcerMphibGfHpLDU4DzVCspzLYVuMNpmzN6n8:2810223114', ) - expect(screen.find('[data-testid="destination"]')).toHaveText( + expect(screen.getByTestId('destination')).toHaveTextContent( 'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) - expect(screen.find('[data-testid="amount"]')).toHaveText('\uE90010.00 XRP') + expect(screen.getByTestId('amount')).toHaveTextContent('\uE90010.00 XRP') }) it('renders tx with destination tag', () => { renderComponent(mockPaymentChannelCreateWithDestinationTag) - expect(screen.find('[data-testid="source"]')).toHaveText( + expect(screen.getByTestId('source')).toHaveTextContent( 'sourcerN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH', ) - expect(screen.find('[data-testid="destination"]')).toHaveText( + expect(screen.getByTestId('destination')).toHaveTextContent( 'destinationrf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn:20170428', ) - expect(screen.find('[data-testid="amount"]')).toHaveText('\uE900100.00 XRP') + expect(screen.getByTestId('amount')).toHaveTextContent('\uE900100.00 XRP') }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx index 98f098acc..ad60c7d74 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundDescription.test.tsx @@ -12,20 +12,20 @@ describe('PaymentChannelFund: Description', () => { afterEach(cleanup) it('renders a Fund', () => { renderComponent(mockPaymentChannelFund) - expect(screen.find('[data-testid="channel-line"]')).toHaveText( + expect(screen.getByTestId('channel-line')).toHaveTextContent( `It will update the payment channel 4BEAC9E4C10674AB698EAC0F2D78A4FF507428370578A59B04883E7EB8D82260`, ) - expect(screen.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.getByTestId('amount-line')).toHaveTextContent( `It will increase the channel amount by \uE9001.00 XRP from \uE90074.00 XRP to \uE90075.00 XRP`, ) }) it('renders failed tx', () => { renderComponent(mockPaymentChannelFundFailed) - expect(screen.find('[data-testid="channel-line"]')).toHaveText( + expect(screen.getByTestId('channel-line')).toHaveTextContent( `It will update the payment channel 933F93F7113A2F94B7838D64D0D2A244C57EFD6411C16FFF5FA293D200EF5876`, ) - expect(screen.find('[data-testid="amount-line"]')).toHaveText( + expect(screen.getByTestId('amount-line')).toHaveTextContent( `It will increase the channel amount by \uE90020.00 XRP`, ) }) diff --git a/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx b/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx index b69f04577..ac21f943f 100644 --- a/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SetFee/test/SetFeeDescription.test.tsx @@ -11,14 +11,14 @@ const renderComponent = createDescriptionRenderFactory( i18nTestConfigEnUS, ) -function testDescription(screen) { - expect(screen.find('[data-testid="fees-line"]')).toHaveText( +function testDescription() { + expect(screen.getByTestId('fees-line')).toHaveTextContent( `Future transactions will require a minimum fee of \uE9000.00001 XRP.`, ) - expect(screen.find('[data-testid="reserves-line"]')).toHaveText( + expect(screen.getByTestId('reserves-line')).toHaveTextContent( `Accounts must now hold a base of \uE90010.00 XRP and an additional \uE9002.00 XRP for each additional object that account owns.`, ) - expect(screen.find('[data-testid="documentation-line"]')).toHaveText( + expect(screen.getByTestId('documentation-line')).toHaveTextContent( `Visit the docs: Fees`, ) } @@ -27,11 +27,11 @@ describe('SetFee: Description', () => { afterEach(cleanup) it('renders Description for transaction before XRPFees amendment', () => { renderComponent(SetFeePreAmendment) - testDescription(screen) + testDescription() }) it('renders Description for transaction after XRPFees amendment', () => { renderComponent(SetFeePostAmendment) - testDescription(screen) + testDescription() }) }) diff --git a/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx b/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx index 3d23cfcde..b99a0a3a7 100644 --- a/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetFee/test/SetFeeSimple.test.tsx @@ -12,7 +12,7 @@ import SetFeePostAmendment from './mock_data/SetFee_PostAmendment.json' const renderComponent = createSimpleRenderFactory(Simple, i18nTestConfigEnUS) -function testSimple(screen) { +function testSimple() { expectSimpleRowLabel(screen, `base-fee`, 'Base Fee') expectSimpleRowText(screen, `base-fee`, `\uE9000.00001 XRP`) expectSimpleRowLabel(screen, `reserve`, 'Reserve') @@ -25,11 +25,11 @@ describe('SetFee: Simple', () => { afterEach(cleanup) it('renders Simple for transaction before XRPFees amendment', () => { renderComponent(SetFeePreAmendment) - testSimple(screen) + testSimple() }) it('renders Simple for transaction after XRPFees amendment', () => { renderComponent(SetFeePostAmendment) - testSimple(screen) + testSimple() }) }) diff --git a/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx b/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx index 54519336f..97993885a 100644 --- a/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx @@ -1,5 +1,5 @@ -import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { cleanup, screen } from '@testing-library/react' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockSetHook from './mock_data/SetHook.json' import mockSetHook2 from './mock_data/SetHook2.json' @@ -9,6 +9,7 @@ import { expectSimpleRowText } from '../../test/expectations' const renderComponent = createSimpleRenderFactory(Simple) describe('SetHookSimple', () => { + afterEach(cleanup) it('renders', () => { renderComponent(mockSetHook) @@ -64,18 +65,18 @@ describe('SetHookSimple', () => { const grant1 = hook.find('.grant').at(0) const grant2 = hook.find('.grant').at(1) - expect(grant1.find('.hash')).toHaveText( + expect(grant1.find('.hash')).toHaveTextContent( '096A70632BBB67488F4804AE55604A01F52226BD556E3589270D0D30C9A6AF81', ) - expect(grant1.find('.account').at(0)).toHaveText( + expect(grant1.find('.account').at(0)).toHaveTextContent( 'rQUhXd7sopuga3taru3jfvc1BgVbscrb1X', ) expect(grant1.find(`.account a`)).toExist() - expect(grant2.find('.hash')).toHaveText( + expect(grant2.find('.hash')).toHaveTextContent( '3F47684053E1A653E54EAC1C5F50BCBAF7F69078CEFB5846BB046CE44B8ECDC2', ) - expect(grant2.find('.account').at(0)).toHaveText( + expect(grant2.find('.account').at(0)).toHaveTextContent( 'raPSFU999HcwpyRojdNh2i96T22gY9fgxL', ) expect(grant2.find(`.account a`)).toExist() diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx index 40aca0e54..ff2c272be 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx @@ -9,16 +9,16 @@ const renderComponent = createDescriptionRenderFactory(Description) describe('SetRegularKey: Description', () => { afterEach(cleanup) it('renders description for transaction', () => { - renderComponent(SetRegularKey) + const { container } = renderComponent(SetRegularKey) - expect(screen.html()).toBe( + expect(container).toHaveHTML( `
set_regular_key_description rULyyLRoZ47P33Vapew67VoiRqPrZ2ejbp
`, ) }) it('renders description for transaction that unsets key', () => { - renderComponent(SetRegularKeyUnset) + const { container } = renderComponent(SetRegularKeyUnset) - expect(screen.html()).toBe(`
unset_regular_key_description
`) + expect(container).toHaveHTML(`
unset_regular_key_description
`) }) }) diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx index 89e6f7d82..12c63969a 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx @@ -6,7 +6,8 @@ import { createTableDetailRenderFactory } from '../../test' const renderComponent = createTableDetailRenderFactory(TableDetail) -describe('SetRegularKeyTable: Detail', () => { +describe('SetRegularKeyTable: TableDetail', () => { + afterEach(cleanup) it('renders Simple for transaction', () => { renderComponent(SetRegularKey) diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx index e3f3e2bf5..4f35c645a 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetDescription.test.tsx @@ -16,19 +16,19 @@ describe('SignerListSet: Description', () => { ) const signers = screen.find('.signers li') - expect(signers.at(0)).toHaveText( + expect(signers.at(0)).toHaveTextContent( 'rK8MWkYVgHR6VmPH6WpWcvVce9evvMpKSv - weight: 2', ) - expect(signers.at(1)).toHaveText( + expect(signers.at(1)).toHaveTextContent( 'rLoRH7XuBgz2kTP1ACkoyVYk9hsLggVvbP - weight: 1', ) - expect(signers.at(2)).toHaveText( + expect(signers.at(2)).toHaveTextContent( 'rL6SsrxyVp1JLNEZsX1hFWHcP2iJcZJ2dy - weight: 1', ) }) it('renders when signer list is cleared', () => { - renderComponent(mockSignerListSetClear) - expect(screen).toHaveText('unset_signer_list_description') + const { container } = renderComponent(mockSignerListSetClear) + expect(container).toHaveTextContent('unset_signer_list_description') }) }) diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx index 20f512c29..a7235b3df 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx @@ -12,24 +12,24 @@ describe('SignerListSet: Simple', () => { it('renders', () => { renderComponent(mockSignerListSet) - expect(screen.find('[data-testid="quorum"] .value').text()).toEqual( + expect(screen.getByTestId("quorum"] .value').text()).toEqual( '3 out_of 4', ) - const signers = screen.find('[data-testid="signers"] .value li') - expect(signers.at(0)).toHaveText( + const signers = screen.getByTestId("signers"] .value li') + expect(signers.at(0)).toHaveTextContent( 'rK8MWkYVgHR6VmPH6WpWcvVce9evvMpKSv weight: 2', ) - expect(signers.at(1)).toHaveText( + expect(signers.at(1)).toHaveTextContent( 'rLoRH7XuBgz2kTP1ACkoyVYk9hsLggVvbP weight: 1', ) - expect(signers.at(2)).toHaveText( + expect(signers.at(2)).toHaveTextContent( 'rL6SsrxyVp1JLNEZsX1hFWHcP2iJcZJ2dy weight: 1', ) }) it('renders when signer list is cleared', () => { renderComponent(mockSignerListSetClear) - expect(screen.find(SimpleRow)).toHaveText('unset_signer_list') + expect(screen.find(SimpleRow)).toHaveTextContent('unset_signer_list') }) }) diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx index e85ab6ed1..9c3e9f4b8 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx @@ -10,12 +10,12 @@ const renderComponent = createTableDetailRenderFactory(TableDetail) describe('SignerListSet: TableDetail', () => { afterEach(cleanup) it('renders', () => { - renderComponent(mockSignerListSet) - expect(screen).toHaveText('signers: 3 - quorum: 3/4') + const { container } = renderComponent(mockSignerListSet) + expect(container).toHaveTextContent('signers: 3 - quorum: 3/4') }) it('renders when signer list is cleared', () => { - renderComponent(mockSignerListSetClear) - expect(screen).toHaveText('unset_signer_list') + const { container } = renderComponent(mockSignerListSetClear) + expect(container).toHaveTextContent('unset_signer_list') }) }) diff --git a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx index 2c2c5759f..5757e7b23 100644 --- a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx @@ -8,7 +8,7 @@ const renderComponent = createTableDetailRenderFactory(TableDetail) describe('TicketCreate: TableDetail', () => { afterEach(cleanup) it('renders', () => { - renderComponent(TicketCreate) - expect(screen).toHaveText('ticket_count: 1') + const { container } = renderComponent(TicketCreate) + expect(container).toHaveTextContent('ticket_count: 1') }) }) diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx index 9341aa48a..77b125ce9 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx @@ -11,8 +11,8 @@ const renderComponent = createDescriptionRenderFactory(Description, i18n) describe('TrustSet: Description', () => { afterEach(cleanup) it('renders description for authorize', () => { - renderComponent(mockTrustSet) - expect(screen.html()).toBe( + const { container } = renderComponent(mockTrustSet) + expect(container).toHaveHTML( `
It establishes CNÂ¥1,000,000,000.00 as the maximum amount of CNY from that is willing to hold
`, ) }) diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx index 7d176f00d..bcca826b0 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx @@ -11,7 +11,7 @@ describe('TrustSet: TableDetail', () => { it('renders', () => { renderComponent(mockTrustSet) expectSimpleRowLabel(screen, 'Set Trust Limit') - expect(screen.find('Amount')).toHaveText( + expect(screen.find('Amount')).toHaveTextContent( 'CNÂ¥1,000,000,000.00 CNY.razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA', ) }) diff --git a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx index edc080e24..37078e681 100644 --- a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx +++ b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx @@ -51,7 +51,7 @@ describe('UNLModify: Simple', () => { /> , ) - expect(screen.find('[data-testid="account"]')).not.toExist() + expect(screen.getByTestId("account").not.toExist() expectSimpleRowLabel(screen, 'sequence', 'Sequence Number') expectSimpleRowText(screen, 'sequence', '0') }) diff --git a/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx index f5388c222..5b65928f8 100644 --- a/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx @@ -8,6 +8,7 @@ import { expectSimpleRowText } from '../../test/expectations' const renderComponent = createSimpleRenderFactory(Simple) describe('XChainAccountCreateCommitSimple', () => { + afterEach(cleanup) it('renders', () => { renderComponent(mockXChainAccountCreateCommit) @@ -17,14 +18,14 @@ describe('XChainAccountCreateCommitSimple', () => { 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).toExist() + expect(screen.getByTestId('locking-chain-door')).toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') @@ -33,7 +34,7 @@ describe('XChainAccountCreateCommitSimple', () => { 'destination', 'raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym', ) - expect(screen.find(`[data-testid="destination"] a`)).not.toExist() + expect(screen.getByTestId('destination"] a`)).not.toExist() }) it('renders failed transaction', () => { @@ -45,14 +46,14 @@ describe('XChainAccountCreateCommitSimple', () => { 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'send', '\uE9001,000.00 XRP') @@ -61,6 +62,6 @@ describe('XChainAccountCreateCommitSimple', () => { 'destination', 'raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym', ) - expect(screen.find(`[data-testid="destination"] a`)).not.toExist() + expect(screen.getByTestId('destination"] a`)).not.toExist() }) }) diff --git a/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx index 6f36bb2a3..996f7b018 100644 --- a/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAddAccountCreateAttestation/test/XChainAddAccountCreateAttestationSimple.test.tsx @@ -1,5 +1,5 @@ -import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { cleanup, screen } from '@testing-library/react' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockXChainAddAccountCreateAttestation from './mock_data/XChainAddAccountCreateAttestation.json' import mockXChainAddAccountCreateAttestationFailed from './mock_data/XChainAddAccountCreateAttestationFailed.json' @@ -7,7 +7,8 @@ import { expectSimpleRowText } from '../../test/expectations' const renderComponent = createSimpleRenderFactory(Simple) -describe('XChainAddAccountCreateAttestationSimple', () => { +describe('XChainAddAccountCreateAttestation - Simple', () => { + afterEach(cleanup) it('renders', () => { renderComponent(mockXChainAddAccountCreateAttestation) @@ -17,14 +18,14 @@ describe('XChainAddAccountCreateAttestationSimple', () => { 'locking-chain-door', 'rDPwN6dz3shffxodeUC9Qf5y1mEHYySKLJ', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') @@ -38,7 +39,7 @@ describe('XChainAddAccountCreateAttestationSimple', () => { 'destination', 'rLbKhMNskUBYRShdbbQcFm9YhumEeUJfPK', ) - expect(screen.find(`[data-testid="destination"] a`)).toExist() + expect(screen.getByTestId('destination')).not.toHaveAttribute('href') }) it('renders failed transaction', () => { @@ -50,14 +51,14 @@ describe('XChainAddAccountCreateAttestationSimple', () => { 'locking-chain-door', 'rNFrsx478pH42Vy5w4KN9Hcyh8SDrVmCfd', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') @@ -71,6 +72,6 @@ describe('XChainAddAccountCreateAttestationSimple', () => { 'destination', 'rPy1F9bQ7dNn2T3QAFRM6dFz6ygHa3MDDi', ) - expect(screen.find(`[data-testid="destination"] a`)).toExist() + expect(screen.getByTestId('destination')).not.toHaveAttribute('href') }) }) diff --git a/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx index d4f815b49..3c42341d7 100644 --- a/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx @@ -1,5 +1,5 @@ -import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { cleanup, screen } from '@testing-library/react' +import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockXChainAddClaimAttestation from './mock_data/XChainAddClaimAttestation.json' import mockXChainAddClaimAttestationFailed from './mock_data/XChainAddClaimAttestationFailed.json' @@ -8,6 +8,7 @@ import { expectSimpleRowText } from '../../test/expectations' const renderComponent = createSimpleRenderFactory(Simple) describe('XChainAddClaimAttestationSimple', () => { + afterEach(cleanup) it('renders', () => { renderComponent(mockXChainAddClaimAttestation) @@ -17,14 +18,14 @@ describe('XChainAddClaimAttestationSimple', () => { 'locking-chain-door', 'r3ZsJYkBao2qiwUCvmjfgEUquKueLAwPxQ', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') @@ -38,7 +39,7 @@ describe('XChainAddClaimAttestationSimple', () => { 'destination', 'rJdTJRJZ6GXCCRaamHJgEqVzB7Zy4557Pi', ) - expect(screen.find(`[data-testid="destination"] a`)).toExist() + expect(screen.getByTestId('destination')).toHaveAttribute('href') expectSimpleRowText(screen, 'xchain-claim-id', '1') }) @@ -51,14 +52,14 @@ describe('XChainAddClaimAttestationSimple', () => { 'locking-chain-door', 'rNFrsx478pH42Vy5w4KN9Hcyh8SDrVmCfd', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') @@ -72,7 +73,7 @@ describe('XChainAddClaimAttestationSimple', () => { 'destination', 'rJdTJRJZ6GXCCRaamHJgEqVzB7Zy4557Pi', ) - expect(screen.find(`[data-testid="destination"] a`)).toExist() + expect(screen.getByTestId('destination')).toHaveAttribute('href') expectSimpleRowText(screen, 'xchain-claim-id', '3') }) }) diff --git a/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx b/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx index 5c8778e24..8fb114f57 100644 --- a/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx @@ -7,6 +7,7 @@ import mockXChainClaimNoQuorum from './mock_data/XChainClaimNoQuorum.json' const renderComponent = createSimpleRenderFactory(Simple) describe('XChainClaimSimple', () => { + afterEach(cleanup) it('renders', () => { renderComponent(mockXChainClaim) @@ -16,14 +17,14 @@ describe('XChainClaimSimple', () => { 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).toExist() + expect(screen.getByTestId('issuing-chain-door')).toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'amount', '\uE90010.00 XRP') @@ -44,14 +45,14 @@ describe('XChainClaimSimple', () => { 'locking-chain-door', 'rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'amount', '\uE9000.01 XRP') diff --git a/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx index ec7982bda..3299f0005 100644 --- a/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx @@ -8,6 +8,7 @@ import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' const renderComponent = createSimpleRenderFactory(Simple) describe('XChainCommitSimple', () => { + afterEach(cleanup) it('renders', () => { renderComponent(mockXChainCommit) @@ -17,19 +18,19 @@ describe('XChainCommitSimple', () => { 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).toExist() + expect(screen.getByTestId('locking-chain-door')).toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') expectSimpleRowText(screen, 'claim-id', '4') - expect(screen.find(`[data-testid="destination"]`)).not.toExist() + expect(screen.getByTestId('destination"]`)).not.toExist() }) it('renders failed tx', () => { @@ -41,14 +42,14 @@ describe('XChainCommitSimple', () => { 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'send', '\uE90010,000.00 XRP') diff --git a/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx index 26167308c..f3b9e38e5 100644 --- a/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx @@ -8,6 +8,7 @@ import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' const renderComponent = createSimpleRenderFactory(Simple) describe('XChainCreateBridgeSimple', () => { + afterEach(cleanup) it('renders', () => { renderComponent(mockXChainCreateBridge) @@ -17,19 +18,19 @@ describe('XChainCreateBridgeSimple', () => { 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).toExist() + expect(screen.getByTestId('issuing-chain-door')).toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'signature-reward', '\uE9000.0001 XRP') expect( - screen.find(`[data-testid="min-create-account-amount"]`), + screen.getByTestId('min-create-account-amount"]`), ).not.toExist() }) @@ -42,7 +43,7 @@ describe('XChainCreateBridgeSimple', () => { 'locking-chain-door', 'ratAutb3katzezbXX3LsX4sk4vmvhNucac', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() expectSimpleRowText( screen, 'locking-chain-issue', @@ -53,7 +54,7 @@ describe('XChainCreateBridgeSimple', () => { 'issuing-chain-door', 'rBkRN2VHVWJVKqfnh1TovLkXo7vLP7oBcq', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).toExist() + expect(screen.getByTestId('issuing-chain-door')).toHaveAttribute('href') expectSimpleRowText( screen, 'issuing-chain-issue', @@ -73,14 +74,14 @@ describe('XChainCreateBridgeSimple', () => { 'locking-chain-door', 'rNFrsx478pH42Vy5w4KN9Hcyh8SDrVmCfd', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).toExist() + expect(screen.getByTestId('locking-chain-door')).toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'signature-reward', '\uE9000.0001 XRP') diff --git a/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx index 3ebc66587..74b999358 100644 --- a/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx @@ -7,6 +7,7 @@ import mockXChainCreateClaimIDFailed from './mock_data/XChainCreateClaimIDFailed const renderComponent = createSimpleRenderFactory(Simple) describe('XChainCreateClaimIDSimple', () => { + afterEach(cleanup) it('renders', () => { renderComponent(mockXChainCreateClaimID) @@ -16,14 +17,14 @@ describe('XChainCreateClaimIDSimple', () => { 'locking-chain-door', 'rNe5NbD1hqCSZPz9KM5PHm5Bf8jjHfezPE', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).toExist() + expect(screen.getByTestId('issuing-chain-door')).toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'signature-reward', '\uE9000.0001 XRP') @@ -44,14 +45,14 @@ describe('XChainCreateClaimIDSimple', () => { 'locking-chain-door', 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'signature-reward', '\uE9000.0001 XRP') @@ -60,6 +61,6 @@ describe('XChainCreateClaimIDSimple', () => { 'other-chain-source', 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W', ) - expect(screen.find(`[data-testid="claim-id"]`)).not.toExist() + expect(screen.getByTestId('claim-id"]`)).not.toExist() }) }) diff --git a/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx b/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx index c7fbfee82..6dfe96f37 100644 --- a/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx @@ -8,6 +8,7 @@ import mockXChainModifyBridgeNoEntry from './mock_data/XChainModifyBridgeNoEntry const renderComponent = createSimpleRenderFactory(Simple) describe('XChainModifyBridgeSimple', () => { + afterEach(cleanup) it('renders', () => { renderComponent(mockXChainModifyBridge) @@ -17,14 +18,14 @@ describe('XChainModifyBridgeSimple', () => { 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).toExist() + expect(screen.getByTestId('issuing-chain-door')).toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'signature-reward', '\uE9000.01 XRP') @@ -39,14 +40,14 @@ describe('XChainModifyBridgeSimple', () => { 'locking-chain-door', 'rnBnyot2gCJywLxLzfHQX2dUJqZ6oghUFp', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).toExist() + expect(screen.getByTestId('locking-chain-door')).toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'min-account-create-amount', '\uE900100.00 XRP') @@ -61,14 +62,14 @@ describe('XChainModifyBridgeSimple', () => { 'locking-chain-door', 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W', ) - expect(screen.find(`[data-testid="locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="issuing-chain-door"] a`)).toExist() + expect(screen.getByTestId('issuing-chain-door')).toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'signature-reward', '\uE9000.0001 XRP') diff --git a/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx b/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx index 732682194..3683b2650 100644 --- a/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx +++ b/src/containers/shared/components/Transaction/test/DefaultSimple.test.tsx @@ -1,20 +1,22 @@ +import { cleanup, screen } from '@testing-library/react' import NewEscrowCreate from './mock_data/NewEscrowCreate.json' import SetHook from './mock_data/SetHook.json' import SetHook2 from './mock_data/SetHook2.json' import TokenSwapPropose from './mock_data/TokenSwapPropose.json' import { DefaultSimple } from '../DefaultSimple' -import { createWrapper as createGeneralWrapper } from './createRenderFactory' +import { renderComponent as renderGeneralComponent } from './createRenderFactory' import { expectSimpleRowText } from './expectations' import summarizeTransaction from '../../../../../rippled/lib/txSummary' -function createWrapper(tx: { tx: any; meta: any }) { +function renderComponent(tx: { tx: any; meta: any }) { // eslint-disable-next-line no-param-reassign -- needed so parsers aren't triggered tx.tx.TransactionType = 'DummyTx' const data = summarizeTransaction(tx, true) - return createGeneralWrapper() + return renderGeneralComponent() } describe('DefaultSimple', () => { + afterEach(cleanup) it('renders Simple for basic transaction', () => { renderComponent(NewEscrowCreate) expectSimpleRowText( @@ -22,78 +24,70 @@ describe('DefaultSimple', () => { 'Destination', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.find(`[data-testid="Destination"] a`)).toExist() + expect(screen.getByTestId('Destination')).toHaveAttribute('href') expectSimpleRowText(screen, 'Amount', '\uE9001.00 XRP') expectSimpleRowText(screen, 'FinishAfter', '736447590') }) it('renders Simple for more complex transaction', () => { renderComponent(SetHook) - expect(screen.find(`[data-testid="group"]`).length).toEqual(10) - expect(screen.find(`[data-testid="CreateCode"]`).length).toEqual(10) - expect(screen.find(`[data-testid="Flags"]`).length).toEqual(10) - expect(screen.find(`[data-testid="HookApiVersion"]`).length).toEqual(2) - expect(screen.find(`[data-testid="HookNamespace"]`).length).toEqual(2) - expect(screen.find(`[data-testid="HookOn"]`).length).toEqual(2) + expect(screen.getAllByTestId('group').length).toEqual(10) + expect(screen.getAllByTestId('CreateCode').length).toEqual(10) + expect(screen.getAllByTestId('Flags').length).toEqual(10) + expect(screen.getAllByTestId('HookApiVersion').length).toEqual(2) + expect(screen.getAllByTestId('HookNamespace').length).toEqual(2) + expect(screen.getAllByTestId('HookOn').length).toEqual(2) - expect(screen.find(`[data-testid="CreateCode"] .value`).at(0)).toHaveText( + expect(screen.getByTestId('CreateCode')[0]).toHaveTextContent( '0061736D0100000001420960027F7F017F60037F7F7F017E60037F7F7E017E60027F7F017E60047F' + '7F7F7F017E60017F017E6000017E60057F7F7F7F7F017E60097F7F7F7F7F7F7F7F7F017E02BC02' + '1403656E76025F67000003656E760A6F74786E5F6669656C64000103656E760661636365707400' + '0203656E7608726F6C6C6261636B000203656E760C686F6F6B5F6163636F756E...', ) - expect(screen.find(`[data-testid="Flags"] .value`).at(0)).toHaveText('1') - expect( - screen.find(`[data-testid="HookApiVersion"] .value`).at(0), - ).toHaveText('0') - expect( - screen.find(`[data-testid="HookNamespace"] .value`).at(0), - ).toHaveText( + expect(screen.getByTestId('Flags')).toHaveTextContent('1') + expect(screen.getByTestId('HookApiVersion')).toHaveTextContent('0') + expect(screen.getByTestId('HookNamespace')).toHaveTextContent( '0000000000000000000000000000000000000000000000000000000000000000', ) - expect(screen.find(`[data-testid="HookOn"] .value`).at(0)).toHaveText( + expect(screen.getByTestId('HookOn')).toHaveTextContent( 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFFFFFFFFFBFFFFF', ) }) it('renders Simple for more complex transaction', () => { renderComponent(SetHook2) - expect(screen.find(`[data-testid="group"]`).length).toEqual(1) - expect(screen.find(`[data-testid="CreateCode"]`).length).toEqual(1) - expect(screen.find(`[data-testid="Flags"]`).length).toEqual(1) - expect(screen.find(`[data-testid="HookApiVersion"]`).length).toEqual(1) - expect(screen.find(`[data-testid="HookNamespace"]`).length).toEqual(1) - expect(screen.find(`[data-testid="HookOn"]`).length).toEqual(1) - expect(screen.find(`[data-testid="HookParameters"]`).length).toEqual(1) + expect(screen.getAllByTestId('group').length).toEqual(1) + expect(screen.getAllByTestId('CreateCode').length).toEqual(1) + expect(screen.getAllByTestId('Flags').length).toEqual(1) + expect(screen.getAllByTestId('HookApiVersion').length).toEqual(1) + expect(screen.getAllByTestId('HookNamespace').length).toEqual(1) + expect(screen.getAllByTestId('HookOn').length).toEqual(1) + expect(screen.getAllByTestId('HookParameters').length).toEqual(1) - expect(screen.find(`[data-testid="CreateCode"] .value`).at(0)).toHaveText( + expect(screen.getByTestId('CreateCode')).toHaveTextContent( '0061736D01000000011C0460057F7F7F7F7F017E60037F7F7E017E60027F7F017F60017F017E0223' + '0303656E76057472616365000003656E7606616363657074000103656E76025F6700020302010305' + '030100020621057F0141B088040B7F0041A6080B7F004180080B7F0041B088040B7F004180080B07' + '080104686F6F6B00030AC6800001C2800002017F017E230041106B220124...', ) - expect(screen.find(`[data-testid="Flags"] .value`).at(0)).toHaveText('1') - expect( - screen.find(`[data-testid="HookApiVersion"] .value`).at(0), - ).toHaveText('0') - expect( - screen.find(`[data-testid="HookNamespace"] .value`).at(0), - ).toHaveText( + expect(screen.getByTestId('Flags')).toHaveTextContent('1') + expect(screen.getByTestId('HookApiVersion')).toHaveTextContent('0') + expect(screen.getByTestId('HookNamespace')).toHaveTextContent( '4FF9961269BF7630D32E15276569C94470174A5DA79FA567C0F62251AA9A36B9', ) - expect(screen.find(`[data-testid="HookOn"] .value`).at(0)).toHaveText( + expect(screen.getByTestId('HookOn')).toHaveTextContent( 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFFFFFFFFFBFFFFF', ) expect( screen.find( `[data-testid="HookParameters"] .subgroup [data-testid="HookParameterName"]`, ), - ).toHaveText('HookParameterName: 6E616D6531') + ).toHaveTextContent('HookParameterName: 6E616D6531') expect( screen.find( `[data-testid="HookParameters"] .subgroup [data-testid="HookParameterValue"]`, ), - ).toHaveText('HookParameterValue: 76616C756531') + ).toHaveTextContent('HookParameterValue: 76616C756531') }) it('renders Simple for amount', () => { @@ -103,7 +97,7 @@ describe('DefaultSimple', () => { 'AccountOther', 'rPTScb8m3wq6r3Ys93Ec5at7LYDmWrtndi', ) - expect(screen.find(`[data-testid="AccountOther"] a`)).toExist() + expect(screen.getByTestId('AccountOther')).toHaveAttribute('href') expectSimpleRowText( screen, 'Amount', diff --git a/src/containers/shared/components/Transaction/test/createRenderFactory.tsx b/src/containers/shared/components/Transaction/test/createRenderFactory.tsx index 2f6f9254d..507052516 100644 --- a/src/containers/shared/components/Transaction/test/createRenderFactory.tsx +++ b/src/containers/shared/components/Transaction/test/createRenderFactory.tsx @@ -3,7 +3,7 @@ import { I18nextProvider } from 'react-i18next' import { BrowserRouter } from 'react-router-dom' import { i18n } from 'i18next' import { QueryClientProvider } from 'react-query' -import { render } from '@testing-library/react' +import { RenderResult, render } from '@testing-library/react' import defaultI18nConfig from '../../../../../i18n/testConfig' import summarizeTransaction from '../../../../../rippled/lib/txSummary' import { @@ -22,8 +22,8 @@ import { testQueryClient } from '../../../../test/QueryClient' export function renderComponent( TestComponent: ReactElement, i18nConfig?: i18n, -): void { - render( +): RenderResult { + return render( {TestComponent} @@ -35,30 +35,30 @@ export function renderComponent( export function createDescriptionRenderFactory( Description: TransactionDescriptionComponent, i18nConfig?: i18n, -): (tx: any) => void { +): (tx: any) => RenderResult { return function createDescriptionWrapper(tx: any) { - renderComponent(, i18nConfig) + return renderComponent(, i18nConfig) } } export function createSimpleRenderFactory( Simple: TransactionSimpleComponent, i18nConfig?: i18n, -): (tx: any) => void { +): (tx: any) => RenderResult { return function createSimpleWrapper(tx: any) { const data = summarizeTransaction(tx, true) - renderComponent(, i18nConfig) + return renderComponent(, i18nConfig) } } export function createTableDetailRenderFactory( TableDetail: TransactionTableDetailComponent, i18nConfig?: i18n, -): (tx: any) => void { +): (tx: any) => RenderResult { return function createTableDetailWrapper(tx: any) { const data = summarizeTransaction(tx, true) - renderComponent( + return renderComponent( , i18nConfig, ) From b16bf041c8d36dd61b45f86ca1d4727237aaff15 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 9 May 2024 11:31:07 -0400 Subject: [PATCH 09/55] more fixes --- .../DIDSet/test/DIDSetSimple.test.tsx | 1 - .../test/EscrowCancelDescription.test.tsx | 2 +- .../test/EscrowCreateDescription.test.tsx | 2 +- .../test/EscrowFinishDescription.test.tsx | 2 +- .../test/NFTokenCancelOfferSimple.test.tsx | 26 ++--- .../test/NFTokenCreateOfferSimple.test.tsx | 19 ++-- .../test/NFTokenMintSimple.test.tsx | 94 ++++--------------- ...st.tsx => OfferCancelDescription.test.tsx} | 0 ...le.test.tsx => OfferCancelSimple.test.tsx} | 0 ...st.tsx => OfferCancelTableDetail.test.tsx} | 2 +- .../test/OfferCreateDescription.test.tsx | 4 +- .../test/OfferCreateSimple.test.tsx | 16 ++-- .../test/OfferCreateTableDetail.test.tsx | 18 ++-- .../Payment/test/PaymentDescription.test.tsx | 54 +++++------ .../Payment/test/PaymentSimple.test.tsx | 2 +- .../PaymentChannelClaimDescription.test.tsx | 32 +++---- .../PaymentChannelCreateDescription.test.tsx | 30 +++--- .../SetHook/test/SetHookSimple.test.tsx | 2 +- .../test/SetRegularKeyDescription.test.tsx | 4 +- .../Transaction/SignerListSet/Simple.tsx | 2 +- .../test/SignerListSetSimple.test.tsx | 17 ++-- .../test/TrustSetDescription.test.tsx | 2 +- .../test/TrustSetTableDetail.test.tsx | 9 +- .../UNLModify/test/UNLModifySimple.test.tsx | 2 +- .../XChainAccountCreateCommitSimple.test.tsx | 10 +- .../XChainAddClaimAttestationSimple.test.tsx | 8 +- .../test/XChainClaimSimple.test.tsx | 6 +- .../test/XChainCommitSimple.test.tsx | 8 +- .../test/XChainCreateBridgeSimple.test.tsx | 10 +- .../test/XChainCreateClaimIDSimple.test.tsx | 8 +- .../test/XChainModifyBridgeSimple.test.tsx | 6 +- 31 files changed, 159 insertions(+), 239 deletions(-) rename src/containers/shared/components/Transaction/OfferCancel/test/{OfferCreateDescription.test.tsx => OfferCancelDescription.test.tsx} (100%) rename src/containers/shared/components/Transaction/OfferCancel/test/{OfferCreateSimple.test.tsx => OfferCancelSimple.test.tsx} (100%) rename src/containers/shared/components/Transaction/OfferCancel/test/{OfferCreateTableDetail.test.tsx => OfferCancelTableDetail.test.tsx} (88%) diff --git a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetSimple.test.tsx b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetSimple.test.tsx index c9e82210c..13735b8da 100644 --- a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetSimple.test.tsx @@ -6,7 +6,6 @@ import DIDSet from './mock_data/DIDSet.json' const renderComponent = createSimpleRenderFactory(Simple) describe('DIDSet: Simple', () => { - afterEach(cleanup) afterEach(cleanup) it('renders', () => { renderComponent(DIDSet) diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx index b60a1559e..3359f3506 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx @@ -9,7 +9,7 @@ describe('EscrowCancel - Description', () => { afterEach(cleanup) it('renders description for EscrowCancel', () => { const { container } = renderComponent(EscrowCancel) - expect(container).toHaveHTML( + expect(container.innerHTML).toBe( '
escrow_cancellation_desc
The escrowed amount of\uE900135.79XRPwas returned to (\uE900135.78999XRP escrow_after_transaction_cost)
The escrow was created bywith transactionA979AD...', ) }) diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx index 914ea66fd..f820f1d37 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx @@ -9,7 +9,7 @@ describe('EscrowCreate - Description', () => { afterEach(cleanup) it('renders description for EscrowCreate', () => { const { container } = renderComponent(EscrowCreate) - expect(container).toHaveHTML( + expect(container.innerHTML).toBe( 'The escrow is fromto
escrow_condition A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120
escrowed_amount \uE900997.50XRP
describe_cancel_after March 1, 2020 at 8:54:20 AM UTC
describe_finish_after March 1, 2020 at 9:01:00 AM UTC
', ) }) diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx index 62fbe8c3a..d34488b90 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx @@ -9,7 +9,7 @@ describe('EscrowFinish - Description', () => { afterEach(cleanup) it('renders description for EscrowFinish', () => { const { container } = renderComponent(EscrowFinish) - expect(container).toHaveHTML( + expect(container.innerHTML).toBe( '
escrow_completion_desc
The escrowed amount of\uE9000.0154XRPwas delivered to (\uE9000.015388XRP escrow_after_transaction_cost)
The escrow was created bywith transaction3E2E75...
escrow_finish_fullfillment_desc Fulfillment
', ) }) diff --git a/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx index d7343a282..89d3c12cc 100644 --- a/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx @@ -1,26 +1,14 @@ -import { BrowserRouter as Router } from 'react-router-dom' -import { mount } from 'enzyme' -import { I18nextProvider } from 'react-i18next' -import { QueryClientProvider } from 'react-query' -import { Simple as NFTokenCancelOffer } from '../Simple' +import { cleanup, screen } from '@testing-library/react' +import { Simple } from '../Simple' import transaction from './mock_data/NFTokenCancelOffer.json' -import summarizeTransaction from '../../../../../../rippled/lib/txSummary' -import i18n from '../../../../../../i18n/testConfig' -import { queryClient } from '../../../../QueryClient' +import { createSimpleRenderFactory } from '../../test' + +const renderComponent = createSimpleRenderFactory(Simple) describe('NFTokenCancelOffer', () => { + afterEach(cleanup) it.only('handles NFTokenCancelOffer simple view ', () => { - const screen = mount( - - - - - - - , - ) + renderComponent(transaction) expect(screen.getByTestId('token-id')).toHaveTextContent( '000800006203F49C21D5D6E022CB16DE3538F248662FC73C258BA1B200000018', ) diff --git a/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx index e58a7f321..c3f6ce847 100644 --- a/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx @@ -9,6 +9,7 @@ import transactionDestination from './mock_data/NFTokenCreateOfferDestination.js const renderComponent = createSimpleRenderFactory(Simple) describe('NFTokenCreateOffer', () => { + afterEach(cleanup) it('handles NFTokenCreateOffer buy simple view ', () => { renderComponent(transactionBuy) expectSimpleRowText( @@ -23,15 +24,13 @@ describe('NFTokenCreateOffer', () => { ) expectSimpleRowText(screen, 'owner', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g') expectSimpleRowText(screen, 'amount', '\uE9000.0001 XRP') - expect(screen.getByTestId("buyer-or-seller"] .label')).toHaveTextContent( - 'buyer', - ) + expect(screen.getByTestId('buyer-or-seller')).toHaveTextContent('buyer') expectSimpleRowText( screen, 'buyer-or-seller', 'rfFRmXUR1yfxeUfXj7WwKhETrtToYx1hYh', ) - expect(screen.getByTestId("destination")).not.toExist() + expect(screen.getByTestId('destination')).not.toExist() }) it('handles NFTokenCreateOffer sell simple view ', () => { @@ -46,21 +45,19 @@ describe('NFTokenCreateOffer', () => { 'offer-id', 'F660CA62E16B8067649052E8FCE947049FC6EF0D8B42EF7E5819997EC5AE45B6', ) - expect(screen.getByTestId("owner")).not.toExist() + expect(screen.getByTestId('owner')).not.toExist() expectSimpleRowText( screen, 'amount', '$100.00 USD.r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g', ) - expect(screen.getByTestId("buyer-or-seller"] .label')).toHaveTextContent( - 'seller', - ) + expect(screen.getByTestId('buyer-or-seller')).toHaveTextContent('seller') expectSimpleRowText( screen, 'buyer-or-seller', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g', ) - expect(screen.getByTestId("destination")).not.toExist() + expect(screen.getByTestId('destination')).not.toExist() }) it('handles failed NFTokenCreateOffer transaction', () => { @@ -70,8 +67,8 @@ describe('NFTokenCreateOffer', () => { 'token-id', '00080000AC7377C74DD53E77C8161537F5EBF56B0CE8FD3BD392C2B800001702', ) - expect(screen.getByTestId("offer-id")).not.toExist() - expect(screen.getByTestId("owner")).not.toExist() + expect(screen.getByTestId('offer-id')).not.toExist() + expect(screen.getByTestId('owner')).not.toExist() expectSimpleRowText(screen, 'amount', '\uE900500.00 XRP') }) diff --git a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx index d1c3d5cf9..eeb305e8c 100644 --- a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx @@ -1,8 +1,5 @@ -import { BrowserRouter as Router } from 'react-router-dom' -import { mount } from 'enzyme' -import { I18nextProvider } from 'react-i18next' import { cleanup, screen } from '@testing-library/react' -import { Simple as NFTokenMint } from '../Simple' +import { Simple } from '../Simple' import transactionModified2 from './mock_data/NFTokenMintModified2.json' import transactionModified1Created1 from './mock_data/NFTokenMintModified1Created1.json' import transactionModified2Created1 from './mock_data/NFTokenMintMostModified2Created1.json' @@ -10,22 +7,19 @@ import transactionWithIssuer from './mock_data/NFTokenMintWithIssuer.json' import transactionModified4Created1 from './mock_data/NFTokenMintModified4Created1.json' import transactionNullURI from './mock_data/NFTokenMintNullURI.json' import transactionFailed from './mock_data/NFTokenMintFailed.json' -import summarizeTransaction from '../../../../../../rippled/lib/txSummary' -import i18n from '../../../../../../i18n/testConfig' import { convertHexToString } from '../../../../../../rippled/lib/utils' -import { expectSimpleRowText, expectSimpleRowNotToExist } from '../../test' +import { + expectSimpleRowText, + expectSimpleRowNotToExist, + createSimpleRenderFactory, +} from '../../test' -describe('NFTokenMint', () => { +const renderComponent = createSimpleRenderFactory(Simple) + +describe('NFTokenMint - Simple', () => { + afterEach(cleanup) it('handles NFTokenMint that modified 2 nodes', () => { - const screen = mount( - - - - - , - ) + renderComponent(transactionModified2) expectSimpleRowText( screen, @@ -39,17 +33,7 @@ describe('NFTokenMint', () => { }) it('handles NFTokenMint that modified 1 node and created 1 node', () => { - const screen = mount( - - - - - , - ) + renderComponent(transactionModified1Created1) expectSimpleRowText( screen, @@ -63,17 +47,7 @@ describe('NFTokenMint', () => { }) it('handles NFTokenMint that modified 2 nodes and created 1 node', () => { - const screen = mount( - - - - - , - ) + renderComponent(transactionModified2Created1) expectSimpleRowText( screen, @@ -87,15 +61,7 @@ describe('NFTokenMint', () => { }) it('handles NFTokenMint with issuer', () => { - const screen = mount( - - - - - , - ) + renderComponent(transactionWithIssuer) expect(screen.getByTestId('token-issuer')).toExist() expectSimpleRowText( @@ -118,17 +84,7 @@ describe('NFTokenMint', () => { }) it('handles NFTokenMint that modified 3 nodes', () => { - const screen = mount( - - - - - , - ) + renderComponent(transactionModified4Created1) expectSimpleRowText( screen, @@ -146,29 +102,13 @@ describe('NFTokenMint', () => { }) it('handles NFTokenMint that has null URI', () => { - const screen = mount( - - - - - , - ) + renderComponent(transactionNullURI) expectSimpleRowNotToExist(screen, 'token-uri') }) it('handles NFTokenMint that failed', () => { - const screen = mount( - - - - - , - ) + renderComponent(transactionFailed) expectSimpleRowNotToExist(screen, 'token-id') expectSimpleRowText(screen, 'token-taxon', '19') diff --git a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCancelDescription.test.tsx similarity index 100% rename from src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateDescription.test.tsx rename to src/containers/shared/components/Transaction/OfferCancel/test/OfferCancelDescription.test.tsx diff --git a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateSimple.test.tsx b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCancelSimple.test.tsx similarity index 100% rename from src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateSimple.test.tsx rename to src/containers/shared/components/Transaction/OfferCancel/test/OfferCancelSimple.test.tsx diff --git a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCancelTableDetail.test.tsx similarity index 88% rename from src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx rename to src/containers/shared/components/Transaction/OfferCancel/test/OfferCancelTableDetail.test.tsx index deb86fa67..3f07f13b0 100644 --- a/src/containers/shared/components/Transaction/OfferCancel/test/OfferCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCancel/test/OfferCancelTableDetail.test.tsx @@ -1,4 +1,4 @@ -import { cleanup, screen } from '@testing-library/react' +import { cleanup } from '@testing-library/react' import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import offerCancel from './mock_data/OfferCancel.json' diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx index fd34bf988..3c51528e9 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx @@ -11,7 +11,7 @@ describe('OfferCreate: Description', () => { it('renders description for transaction with cancel and expiration', () => { const { container } = renderComponent(OfferCreate) - expect(container).toHaveHTML( + expect(container.innerHTML).toBe( '
The accountoffered to pay1,080,661.95882CSCin order to receive\uE9001,764.293151XRP
offer_create_desc_line_2 612.52XRP/CSC
offer_create_desc_line_3 44866443
The offer expiresMay 18, 2022 at 5:28:16 PM UTCunless cancelled before', ) }) @@ -19,7 +19,7 @@ describe('OfferCreate: Description', () => { it('renders description for transaction with inverted currencies', () => { const { container } = renderComponent(OfferCreateInvertedCurrencies) - expect(container).toHaveHTML( + expect(container.innerHTML).toBe( '
The accountoffered to pay\uE90017,588.363594XRPin order to receive$6,101.33033905USD
offer_create_desc_line_2 0.34690XRP/USD
offer_create_desc_line_3 80543309
', ) }) diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx index 2a0e80ad6..5f2a2fcf7 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx @@ -10,16 +10,14 @@ describe('OfferCreate: Simple', () => { afterEach(cleanup) it('renders with an expiration and offer', () => { renderComponent(mockOfferCreateWithCancel) - expect(screen.getByTestId("amount"] .one-line')).toHaveTextContent( + expect(screen.getByTestId('amount')).toHaveTextContent( '\uE900 XRP/CSC.rCSC', ) - expect(screen.getByTestId("cancel-id")).toHaveTextContent( - '#44866443', - ) - expect(screen.getByTestId("amount-buy")).toHaveTextContent( + expect(screen.getByTestId('cancel-id')).toHaveTextContent('#44866443') + expect(screen.getByTestId('amount-buy')).toHaveTextContent( `\uE9001,764.293151 XRP`, ) - expect(screen.getByTestId("amount-sell")).toHaveTextContent( + expect(screen.getByTestId('amount-sell')).toHaveTextContent( `1,080,661.95882 CSC.rCSCManTZ8ME9EoLrSHHYKW8PPwWMgkwr`, ) }) @@ -27,11 +25,11 @@ describe('OfferCreate: Simple', () => { it('renders', () => { renderComponent(mockOfferCreate) - expect(screen.getByTestId("offer-id")).not.toExist() - expect(screen.getByTestId("amount-buy")).toHaveTextContent( + expect(screen.getByTestId('offer-id')).not.toExist() + expect(screen.getByTestId('amount-buy')).toHaveTextContent( `\uE90024,755.081083 XRP`, ) - expect(screen.getByTestId("amount-sell")).toHaveTextContent( + expect(screen.getByTestId('amount-sell')).toHaveTextContent( `51.41523894 BCH.rcyS4CeCZVYvTiKcxj6Sx32ibKwcDHLds`, ) }) diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx index ec1c3f3c8..8ce5f14c6 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx @@ -12,16 +12,16 @@ describe('OfferCreate: TableDetail', () => { it('renders with an expiration and offer', () => { renderComponent(mockOfferCreateWithCancel) - expect(screen.getByTestId("pair")).toHaveTextContent( + expect(screen.getByTestId('pair')).toHaveTextContent( 'price:612.518 \uE900 XRP/CSC.rCSC', ) - expect(screen.getByTestId("cancel-id")).toHaveTextContent( + expect(screen.getByTestId('cancel-id')).toHaveTextContent( 'cancel_offer #44866443', ) - expect(screen.getByTestId("amount-buy")).toHaveTextContent( + expect(screen.getByTestId('amount-buy')).toHaveTextContent( `\uE9001,764.293151 XRP`, ) - expect(screen.getByTestId("amount-sell")).toHaveTextContent( + expect(screen.getByTestId('amount-sell')).toHaveTextContent( `1,080,661.95882 CSC.rCSCManTZ8ME9EoLrSHHYKW8PPwWMgkwr`, ) }) @@ -29,14 +29,14 @@ describe('OfferCreate: TableDetail', () => { it('renders', () => { renderComponent(mockOfferCreate) - expect(screen.getByTestId("pair")).toHaveTextContent( + expect(screen.getByTestId('pair')).toHaveTextContent( 'price:0.00207696 \uE900 XRP/BCH.rcyS', ) - expect(screen.getByTestId("offer-id").not.toExist() - expect(screen.getByTestId("amount-buy")).toHaveTextContent( + expect(screen.getByTestId('offer-id')).not.toExist() + expect(screen.getByTestId('amount-buy')).toHaveTextContent( `\uE90024,755.081083 XRP`, ) - expect(screen.getByTestId("amount-sell")).toHaveTextContent( + expect(screen.getByTestId('amount-sell')).toHaveTextContent( `51.41523894 BCH.rcyS4CeCZVYvTiKcxj6Sx32ibKwcDHLds`, ) }) @@ -44,7 +44,7 @@ describe('OfferCreate: TableDetail', () => { it('renders inverted currencies', () => { renderComponent(mockOfferCreateInvertedCurrencies) - expect(screen.getByTestId("pair")).toHaveTextContent( + expect(screen.getByTestId('pair')).toHaveTextContent( 'price:0.346896 \uE900 XRP/USD.rvYA', ) }) diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx index 200bf1bfc..fdf53cd3e 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx @@ -17,15 +17,15 @@ describe('Payment: Description', () => { it('renders', () => { renderComponent(mockPayment) - expect(screen.getByTestId("from-to-line")).toHaveTextContent( + expect(screen.getByTestId('from-to-line')).toHaveTextContent( `The payment is from rNQEMJA4PsoSrZRn9J6RajAYhcDzzhf8ok to rHoPwMC75KVUhBMeV3uDMybKG5JND74teh`, ) - expect(screen.getByTestId("source-tag-line").not.toExist() - expect(screen.getByTestId("destination-tag-line").not.toExist() - expect(screen.getByTestId("amount-line")).toHaveTextContent( + expect(screen.getByTestId('source-tag-line')).not.toExist() + expect(screen.getByTestId('destination-tag-line')).not.toExist() + expect(screen.getByTestId('amount-line')).toHaveTextContent( `It was instructed to deliver \uE9002,421.8268 XRP`, ) - expect(screen.getByTestId("delivered-line")).toHaveTextContent( + expect(screen.getByTestId('delivered-line')).toHaveTextContent( `The actual amount delivered was \uE9002,421.8268 XRP`, ) }) @@ -33,31 +33,31 @@ describe('Payment: Description', () => { it('renders with failed partial conversion', () => { renderComponent(mockPaymentConvert) - expect(screen.getByTestId("from-to-line")).toHaveTextContent( + expect(screen.getByTestId('from-to-line')).toHaveTextContent( `The payment is from r9x5PHDiwuvbpYB3uvGAqEUVV5wxHayQEx to r9x5PHDiwuvbpYB3uvGAqEUVV5wxHayQEx`, ) - expect(screen.getByTestId("source-tag-line").not.toExist() - expect(screen.getByTestId("destination-tag-line").not.toExist() - expect(screen.getByTestId("amount-line")).toHaveTextContent( + expect(screen.getByTestId('source-tag-line')).not.toExist() + expect(screen.getByTestId('destination-tag-line')).not.toExist() + expect(screen.getByTestId('amount-line')).toHaveTextContent( `It was instructed to deliver up to 1,140.00 YCN.r8HgVGenRTAiNSM5iqt9PX2D2EczFZhZr by spending up to \uE9001,140.00 XRP`, ) - expect(screen.getByTestId("delivered-line").not.toExist() + expect(screen.getByTestId('delivered-line')).not.toExist() }) it('renders with destination tag', () => { renderComponent(mockPaymentDestinationTag) - expect(screen.getByTestId("from-to-line")).toHaveTextContent( + expect(screen.getByTestId('from-to-line')).toHaveTextContent( `The payment is from rDAE53VfMvftPB4ogpWGWvzkQxfht6JPxr to rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt`, ) - expect(screen.getByTestId("source-tag-line").not.toExist() - expect(screen.getByTestId("destination-tag-line")).toHaveTextContent( + expect(screen.getByTestId('source-tag-line')).not.toExist() + expect(screen.getByTestId('destination-tag-line')).toHaveTextContent( `The destination tag is 381702`, ) - expect(screen.getByTestId("amount-line")).toHaveTextContent( + expect(screen.getByTestId('amount-line')).toHaveTextContent( `It was instructed to deliver \uE9001,531.267 XRP`, ) - expect(screen.getByTestId("delivered-line")).toHaveTextContent( + expect(screen.getByTestId('delivered-line')).toHaveTextContent( `The actual amount delivered was \uE9001,531.267 XRP`, ) }) @@ -65,17 +65,17 @@ describe('Payment: Description', () => { it('renders with send max', () => { renderComponent(mockPaymentSendMax) - expect(screen.getByTestId("from-to-line")).toHaveTextContent( + expect(screen.getByTestId('from-to-line')).toHaveTextContent( `The payment is from r3RaNVLvWjqqtFAawC6jbRhgKyFH7HvRS8 to rprcTynT68nYdKzDTefAZG9HjSHiYcnP4b`, ) - expect(screen.getByTestId("destination-tag-line")).toHaveTextContent( + expect(screen.getByTestId('destination-tag-line')).toHaveTextContent( `The destination tag is 0`, ) - expect(screen.getByTestId("source-tag-line").not.toExist() - expect(screen.getByTestId("amount-line")).toHaveTextContent( + expect(screen.getByTestId('source-tag-line')).not.toExist() + expect(screen.getByTestId('amount-line')).toHaveTextContent( `It was instructed to deliver 17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA by spending up to 17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA`, ) - expect(screen.getByTestId("delivered-line")).toHaveTextContent( + expect(screen.getByTestId('delivered-line')).toHaveTextContent( `The actual amount delivered was 17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA`, ) }) @@ -83,17 +83,17 @@ describe('Payment: Description', () => { it('renders with partial', () => { renderComponent(mockPaymentPartial) - expect(screen.getByTestId("from-to-line")).toHaveTextContent( + expect(screen.getByTestId('from-to-line')).toHaveTextContent( `The payment is from rGTurN94Nn3RkJGSqy9MwmQCLpXZkELbnq to rMQ4oGC8fasuJwfdrfknFTttDbf8cR3D2j`, ) - expect(screen.getByTestId("destination-tag-line")).toHaveTextContent( + expect(screen.getByTestId('destination-tag-line')).toHaveTextContent( `The destination tag is 0`, ) - expect(screen.getByTestId("source-tag-line").not.toExist() - expect(screen.getByTestId("amount-line")).toHaveTextContent( + expect(screen.getByTestId('source-tag-line')).not.toExist() + expect(screen.getByTestId('amount-line')).toHaveTextContent( `It was instructed to deliver up to 0.001043 xCoin.rXCoYSUnkpygdtfpz3Df8dKQuRZjM9UFi`, ) - expect(screen.getByTestId("delivered-line")).toHaveTextContent( + expect(screen.getByTestId('delivered-line')).toHaveTextContent( `The actual amount delivered was 0.00104196 xCoin.rXCoYSUnkpygdtfpz3Df8dKQuRZjM9UFi`, ) }) @@ -101,10 +101,10 @@ describe('Payment: Description', () => { it('renders with SourceTag', () => { renderComponent(mockPaymentSourceTag) - expect(screen.getByTestId("source-tag-line")).toHaveTextContent( + expect(screen.getByTestId('source-tag-line')).toHaveTextContent( `The source tag is 20648`, ) - expect(screen.getByTestId("destination-tag-line")).toHaveTextContent( + expect(screen.getByTestId('destination-tag-line')).toHaveTextContent( `The destination tag is 412453880`, ) }) diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx index 0bb2ad1b7..192498dd6 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx @@ -49,7 +49,7 @@ describe('Payment: Simple', () => { `0.00 YCN.r8HgVGenRTAiNSM5iqt9PX2D2EczFZhZrpartial_payment_allowed`, ) - expect(screen.getByTestId("destination").not.toExist() + expect(screen.getByTestId('destination')).not.toExist() }) it('renders with destination tag', () => { diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx index f788ff141..2f5473973 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx @@ -14,55 +14,55 @@ describe('PaymentChannelClaim: Description', () => { afterEach(cleanup) it('renders a claim', () => { renderComponent(mockPaymentChannelClaim) - expect(screen.getByTestId("account-line")).toHaveTextContent( + expect(screen.getByTestId('account-line')).toHaveTextContent( `The transaction was initiated by rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN`, ) - expect(screen.getByTestId("channel-line")).toHaveTextContent( + expect(screen.getByTestId('channel-line')).toHaveTextContent( `It will update the payment channel 50107651E7163E294CE0EAD8A20BF7CC046304480FCC9C74A49FFAB3F46FB98E`, ) - expect(screen.getByTestId("balance-line")).toHaveTextContent( + expect(screen.getByTestId('balance-line')).toHaveTextContent( `The channel balance claimed is \uE90049.65716XRP (increased by \uE9000.01XRP)`, ) - expect(screen.getByTestId("closed-line").not.toExist() + expect(screen.getByTestId('closed-line')).not.toExist() }) it('renders tx with channel being closed', () => { renderComponent(mockPaymentChannelClaimClosed) - expect(screen.getByTestId("account-line")).toHaveTextContent( + expect(screen.getByTestId('account-line')).toHaveTextContent( `The transaction was initiated by rH11fDGhbVH5NVXNXkGAMTmfWhUHjCtA3B`, ) - expect(screen.getByTestId("channel-line")).toHaveTextContent( + expect(screen.getByTestId('channel-line')).toHaveTextContent( `It will update the payment channel 3BDB4F92432BCEB2385D3BAA60E8AAEC9B552890A240AEE4AA9E88C9E6C517E8`, ) - expect(screen.getByTestId("balance-line").not.toExist() - expect(screen.getByTestId("closed-line")).toHaveTextContent( + expect(screen.getByTestId('balance-line')).not.toExist() + expect(screen.getByTestId('closed-line')).toHaveTextContent( `The payment channel will be closed, any remaining balance will be returned to the source account`, ) }) it('renders tx requesting channel be closed but not closing it', () => { renderComponent(mockPaymentChannelClaimCloseDenied) - expect(screen.getByTestId("account-line")).toHaveTextContent( + expect(screen.getByTestId('account-line')).toHaveTextContent( `The transaction was initiated by rH11fDGhbVH5NVXNXkGAMTmfWhUHjCtA3B`, ) - expect(screen.getByTestId("channel-line")).toHaveTextContent( + expect(screen.getByTestId('channel-line')).toHaveTextContent( `It will update the payment channel 3BDB4F92432BCEB2385D3BAA60E8AAEC9B552890A240AEE4AA9E88C9E6C517E8`, ) - expect(screen.getByTestId("balance-line").not.toExist() - expect(screen.getByTestId("closed-line").not.toExist() + expect(screen.getByTestId('balance-line')).not.toExist() + expect(screen.getByTestId('closed-line')).not.toExist() }) it('renders tx with destination tag', () => { renderComponent(mockPaymentChannelClaimWithDestinationTag) - expect(screen.getByTestId("account-line")).toHaveTextContent( + expect(screen.getByTestId('account-line')).toHaveTextContent( `The transaction was initiated by rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn`, ) - expect(screen.getByTestId("channel-line")).toHaveTextContent( + expect(screen.getByTestId('channel-line')).toHaveTextContent( `It will update the payment channel 5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3`, ) - expect(screen.getByTestId("balance-line")).toHaveTextContent( + expect(screen.getByTestId('balance-line')).toHaveTextContent( `The channel balance claimed is \uE9001.00XRP (increased by \uE9001.00XRP)`, ) - expect(screen.getByTestId("closed-line").not.toExist() + expect(screen.getByTestId('closed-line')).not.toExist() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx index 36a3d7fa5..ec863a1a0 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx @@ -13,50 +13,50 @@ describe('PaymentChannelCreate: Description', () => { afterEach(cleanup) it('renders', () => { renderComponent(mockPaymentChannelCreate) - expect(screen.getByTestId("accounts-line")).toHaveTextContent( + expect(screen.getByTestId('accounts-line')).toHaveTextContent( `The account rJnQrhRTXutuSwtrwxYiTkHn4Dtp8sF2LM:2460331042 will create a payment channel to rUXYat4hW2M87gHoqKK7fC4cqrT9C6V7d7`, ) - expect(screen.getByTestId("channel-line")).toHaveTextContent( + expect(screen.getByTestId('channel-line')).toHaveTextContent( `The channel ID is 15AB9EE9344C42C05164E6A1F2F08B35F35D7B9D66CCB9697452B0995C8F8242`, ) - expect(screen.getByTestId("amount-line")).toHaveTextContent( + expect(screen.getByTestId('amount-line')).toHaveTextContent( `The channel amount is \uE9001.00 XRP`, ) - expect(screen.getByTestId("delay-line")).toHaveTextContent( + expect(screen.getByTestId('delay-line')).toHaveTextContent( `The channel has a settlement delay of 3,600 seconds`, ) - expect(screen.getByTestId("cancel-line").not.toExist() + expect(screen.getByTestId('cancel-line')).not.toExist() }) it('renders failed tx', () => { renderComponent(mockPaymentChannelCreateFailed) - expect(screen.getByTestId("accounts-line")).toHaveTextContent( + expect(screen.getByTestId('accounts-line')).toHaveTextContent( `The account rMphibGfHpLDU4DzVCspzLYVuMNpmzN6n8:2810223114 will create a payment channel to rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN`, ) - expect(screen.getByTestId("channel-line").not.toExist() - expect(screen.getByTestId("amount-line")).toHaveTextContent( + expect(screen.getByTestId('channel-line')).not.toExist() + expect(screen.getByTestId('amount-line')).toHaveTextContent( `The channel amount is \uE90010.00 XRP`, ) - expect(screen.getByTestId("delay-line")).toHaveTextContent( + expect(screen.getByTestId('delay-line')).toHaveTextContent( `The channel has a settlement delay of 3,600 seconds`, ) - expect(screen.getByTestId("cancel-line").not.toExist() + expect(screen.getByTestId('cancel-line')).not.toExist() }) it('renders tx with destination tag', () => { renderComponent(mockPaymentChannelCreateWithDestinationTag) - expect(screen.getByTestId("accounts-line")).toHaveTextContent( + expect(screen.getByTestId('accounts-line')).toHaveTextContent( `The account rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH will create a payment channel to rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn:20170428`, ) - expect(screen.getByTestId("channel-line")).toHaveTextContent( + expect(screen.getByTestId('channel-line')).toHaveTextContent( `The channel ID is 5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3`, ) - expect(screen.getByTestId("amount-line")).toHaveTextContent( + expect(screen.getByTestId('amount-line')).toHaveTextContent( `The channel amount is \uE900100.00 XRP`, ) - expect(screen.getByTestId("delay-line")).toHaveTextContent( + expect(screen.getByTestId('delay-line')).toHaveTextContent( `The channel has a settlement delay of 86,400 seconds`, ) - expect(screen.getByTestId("cancel-line").not.toExist() + expect(screen.getByTestId('cancel-line')).not.toExist() }) }) diff --git a/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx b/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx index 97993885a..4489bf8d6 100644 --- a/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx @@ -8,7 +8,7 @@ import { expectSimpleRowText } from '../../test/expectations' const renderComponent = createSimpleRenderFactory(Simple) -describe('SetHookSimple', () => { +describe('SetHook: Simple', () => { afterEach(cleanup) it('renders', () => { renderComponent(mockSetHook) diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx index ff2c272be..419c427e7 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx @@ -11,7 +11,7 @@ describe('SetRegularKey: Description', () => { it('renders description for transaction', () => { const { container } = renderComponent(SetRegularKey) - expect(container).toHaveHTML( + expect(container.innerHTML).toBe( `
set_regular_key_description rULyyLRoZ47P33Vapew67VoiRqPrZ2ejbp
`, ) }) @@ -19,6 +19,6 @@ describe('SetRegularKey: Description', () => { it('renders description for transaction that unsets key', () => { const { container } = renderComponent(SetRegularKeyUnset) - expect(container).toHaveHTML(`
unset_regular_key_description
`) + expect(container.innerHTML).toBe(`
unset_regular_key_description
`) }) }) diff --git a/src/containers/shared/components/Transaction/SignerListSet/Simple.tsx b/src/containers/shared/components/Transaction/SignerListSet/Simple.tsx index eeab19230..f43b21b7f 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/Simple.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/Simple.tsx @@ -15,7 +15,7 @@ export const Simple = ({
    {signers.map((d) => ( -
  • +
  • {` ${t('weight')}: `} {d.weight} diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx index a7235b3df..0057a5045 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetSimple.test.tsx @@ -2,7 +2,6 @@ import { cleanup, screen } from '@testing-library/react' import { Simple } from '../Simple' import mockSignerListSetClear from './mock_data/SignerListSetClear.json' import mockSignerListSet from './mock_data/SignerListSet.json' -import { SimpleRow } from '../../SimpleRow' import { createSimpleRenderFactory } from '../../test/createRenderFactory' const renderComponent = createSimpleRenderFactory(Simple) @@ -12,24 +11,22 @@ describe('SignerListSet: Simple', () => { it('renders', () => { renderComponent(mockSignerListSet) - expect(screen.getByTestId("quorum"] .value').text()).toEqual( - '3 out_of 4', - ) + expect(screen.getByTestId('quorum')).toHaveTextContent('3 out_of 4') - const signers = screen.getByTestId("signers"] .value li') - expect(signers.at(0)).toHaveTextContent( + const signers = screen.getAllByTestId('signer') + expect(signers[0]).toHaveTextContent( 'rK8MWkYVgHR6VmPH6WpWcvVce9evvMpKSv weight: 2', ) - expect(signers.at(1)).toHaveTextContent( + expect(signers[1]).toHaveTextContent( 'rLoRH7XuBgz2kTP1ACkoyVYk9hsLggVvbP weight: 1', ) - expect(signers.at(2)).toHaveTextContent( + expect(signers[2]).toHaveTextContent( 'rL6SsrxyVp1JLNEZsX1hFWHcP2iJcZJ2dy weight: 1', ) }) it('renders when signer list is cleared', () => { - renderComponent(mockSignerListSetClear) - expect(screen.find(SimpleRow)).toHaveTextContent('unset_signer_list') + const { container } = renderComponent(mockSignerListSetClear) + expect(container).toHaveTextContent('unset_signer_list') }) }) diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx index 77b125ce9..c0cb69ee3 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx @@ -12,7 +12,7 @@ describe('TrustSet: Description', () => { afterEach(cleanup) it('renders description for authorize', () => { const { container } = renderComponent(mockTrustSet) - expect(container).toHaveHTML( + expect(container.innerHTML).toBe( `
    It establishes CNÂ¥1,000,000,000.00 as the maximum amount of CNY from that is willing to hold
    `, ) }) diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx index bcca826b0..532ce2bc0 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetTableDetail.test.tsx @@ -1,5 +1,8 @@ import { cleanup, screen } from '@testing-library/react' -import { createTableDetailRenderFactory } from '../../test' +import { + createTableDetailRenderFactory, + expectSimpleRowLabel, +} from '../../test' import { TableDetail } from '../TableDetail' import mockTrustSet from './mock_data/TrustSet.json' import i18n from '../../../../../../i18n/testConfigEnglish' @@ -10,8 +13,8 @@ describe('TrustSet: TableDetail', () => { afterEach(cleanup) it('renders', () => { renderComponent(mockTrustSet) - expectSimpleRowLabel(screen, 'Set Trust Limit') - expect(screen.find('Amount')).toHaveTextContent( + expectSimpleRowLabel(screen, 'Set Trust Limit', 'Set Trust Limit') + expect(screen.getByTestId('Amount')).toHaveTextContent( 'CNÂ¥1,000,000,000.00 CNY.razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA', ) }) diff --git a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx index 37078e681..e48fd9cf6 100644 --- a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx +++ b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx @@ -51,7 +51,7 @@ describe('UNLModify: Simple', () => { /> , ) - expect(screen.getByTestId("account").not.toExist() + expect(screen.getByTestId('account')).not.toExist() expectSimpleRowLabel(screen, 'sequence', 'Sequence Number') expectSimpleRowText(screen, 'sequence', '0') }) diff --git a/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx index 5b65928f8..3cca27be0 100644 --- a/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAccountCreateCommit/test/XChainAccountCreateCommitSimple.test.tsx @@ -25,7 +25,7 @@ describe('XChainAccountCreateCommitSimple', () => { 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') @@ -34,7 +34,7 @@ describe('XChainAccountCreateCommitSimple', () => { 'destination', 'raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym', ) - expect(screen.getByTestId('destination"] a`)).not.toExist() + expect(screen.getByTestId('destination')).not.toHaveAttribute('href') }) it('renders failed transaction', () => { @@ -46,14 +46,14 @@ describe('XChainAccountCreateCommitSimple', () => { 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'send', '\uE9001,000.00 XRP') @@ -62,6 +62,6 @@ describe('XChainAccountCreateCommitSimple', () => { 'destination', 'raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym', ) - expect(screen.getByTestId('destination"] a`)).not.toExist() + expect(screen.getByTestId('destination')).not.toHaveAttribute('href') }) }) diff --git a/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx b/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx index 3c42341d7..ae48df7c5 100644 --- a/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainAddClaimAttestation/test/XChainAddClaimAttestationSimple.test.tsx @@ -18,14 +18,14 @@ describe('XChainAddClaimAttestationSimple', () => { 'locking-chain-door', 'r3ZsJYkBao2qiwUCvmjfgEUquKueLAwPxQ', ) - expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') @@ -52,14 +52,14 @@ describe('XChainAddClaimAttestationSimple', () => { 'locking-chain-door', 'rNFrsx478pH42Vy5w4KN9Hcyh8SDrVmCfd', ) - expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') diff --git a/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx b/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx index 8fb114f57..b3ce5ae35 100644 --- a/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainClaim/test/XChainClaimSimple.test.tsx @@ -17,7 +17,7 @@ describe('XChainClaimSimple', () => { 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, @@ -45,14 +45,14 @@ describe('XChainClaimSimple', () => { 'locking-chain-door', 'rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4', ) - expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'amount', '\uE9000.01 XRP') diff --git a/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx index 3299f0005..3ce6eab2b 100644 --- a/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx @@ -25,12 +25,12 @@ describe('XChainCommitSimple', () => { 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') expectSimpleRowText(screen, 'claim-id', '4') - expect(screen.getByTestId('destination"]`)).not.toExist() + expect(screen.getByTestId('destination')).not.toExist() }) it('renders failed tx', () => { @@ -42,14 +42,14 @@ describe('XChainCommitSimple', () => { 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'send', '\uE90010,000.00 XRP') diff --git a/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx index f3b9e38e5..80fc92a49 100644 --- a/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx @@ -18,7 +18,7 @@ describe('XChainCreateBridgeSimple', () => { 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, @@ -29,9 +29,7 @@ describe('XChainCreateBridgeSimple', () => { expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'signature-reward', '\uE9000.0001 XRP') - expect( - screen.getByTestId('min-create-account-amount"]`), - ).not.toExist() + expect(screen.getByTestId('min-create-account-amount')).not.toExist() }) it('renders IOU bridge', () => { @@ -43,7 +41,7 @@ describe('XChainCreateBridgeSimple', () => { 'locking-chain-door', 'ratAutb3katzezbXX3LsX4sk4vmvhNucac', ) - expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door')).not.toHaveAttribute('href') expectSimpleRowText( screen, 'locking-chain-issue', @@ -81,7 +79,7 @@ describe('XChainCreateBridgeSimple', () => { 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'signature-reward', '\uE9000.0001 XRP') diff --git a/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx index 74b999358..f516a710e 100644 --- a/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx @@ -17,7 +17,7 @@ describe('XChainCreateClaimIDSimple', () => { 'locking-chain-door', 'rNe5NbD1hqCSZPz9KM5PHm5Bf8jjHfezPE', ) - expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, @@ -45,14 +45,14 @@ describe('XChainCreateClaimIDSimple', () => { 'locking-chain-door', 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W', ) - expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, 'issuing-chain-door', 'rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq', ) - expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'signature-reward', '\uE9000.0001 XRP') @@ -61,6 +61,6 @@ describe('XChainCreateClaimIDSimple', () => { 'other-chain-source', 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W', ) - expect(screen.getByTestId('claim-id"]`)).not.toExist() + expect(screen.getByTestId('claim-id')).not.toExist() }) }) diff --git a/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx b/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx index 6dfe96f37..8e1e74673 100644 --- a/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainModifyBridge/test/XChainModifyBridgeSimple.test.tsx @@ -18,7 +18,7 @@ describe('XChainModifyBridgeSimple', () => { 'locking-chain-door', 'rGQLcxzT3Po9PsCk5Lj9uK7S1juThii9cR', ) - expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, @@ -47,7 +47,7 @@ describe('XChainModifyBridgeSimple', () => { 'issuing-chain-door', 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh', ) - expect(screen.getByTestId('issuing-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('issuing-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'min-account-create-amount', '\uE900100.00 XRP') @@ -62,7 +62,7 @@ describe('XChainModifyBridgeSimple', () => { 'locking-chain-door', 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W', ) - expect(screen.getByTestId('locking-chain-door"] a`)).not.toExist() + expect(screen.getByTestId('locking-chain-door')).not.toHaveAttribute('href') expectSimpleRowText(screen, 'locking-chain-issue', '\uE900 XRP') expectSimpleRowText( screen, From 5979986d5e20b80ccd02a15beec919888a9d6dc6 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 9 May 2024 11:35:52 -0400 Subject: [PATCH 10/55] fix linter issues --- .../Transaction/DIDSet/test/DIDSetTableDetail.test.tsx | 2 +- .../EscrowCancel/test/EscrowCancelTableDetail.test.tsx | 2 +- .../EscrowCreate/test/EscrowCreateDescription.test.tsx | 2 +- .../OfferCreate/test/OfferCreateDescription.test.tsx | 2 +- .../SetRegularKey/test/SetRegularKeyDescription.test.tsx | 2 +- .../SignerListSet/test/SignerListSetTableDetail.test.tsx | 2 +- .../TicketCreate/test/TicketCreateTableDetail.test.tsx | 2 +- .../TrustSet/test/TrustSetDescription.test.tsx | 2 +- .../Transaction/UNLModify/test/UNLModifySimple.test.tsx | 9 ++++----- 9 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx index c448a5d16..8b2ae6b1b 100644 --- a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetTableDetail.test.tsx @@ -9,8 +9,8 @@ describe('DIDSet: TableDetail', () => { afterEach(cleanup) it('renders', () => { const { container } = renderComponent(DIDSet) - // eslint-disable-next-line no-useless-concat -- easier to read this way expect(container).toHaveTextContent( + // eslint-disable-next-line no-useless-concat -- easier to read this way 'uri: did_example' + 'did_document: doc', ) }) diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx index 0ccd01a87..670318ee7 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelTableDetail.test.tsx @@ -1,4 +1,4 @@ -import { cleanup, screen } from '@testing-library/react' +import { cleanup } from '@testing-library/react' import { TableDetail } from '../TableDetail' import mockEscrowCancel from './mock_data/EscrowCancel.json' import { createTableDetailRenderFactory } from '../../test' diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx index f820f1d37..d62e51128 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx @@ -1,4 +1,4 @@ -import { cleanup, screen } from '@testing-library/react' +import { cleanup } from '@testing-library/react' import EscrowCreate from './mock_data/EscrowCreate.json' import { Description } from '../Description' import { createDescriptionRenderFactory } from '../../test' diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx index 3c51528e9..20fa07bdc 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx @@ -1,4 +1,4 @@ -import { cleanup, screen } from '@testing-library/react' +import { cleanup } from '@testing-library/react' import OfferCreate from './mock_data/OfferCreateWithExpirationAndCancel.json' import OfferCreateInvertedCurrencies from './mock_data/OfferCreateInvertedCurrencies.json' import { Description } from '../Description' diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx index 419c427e7..eb6ba08e5 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyDescription.test.tsx @@ -1,4 +1,4 @@ -import { cleanup, screen } from '@testing-library/react' +import { cleanup } from '@testing-library/react' import SetRegularKey from './mock_data/SetRegularKey.json' import SetRegularKeyUnset from './mock_data/SetRegularKeyUnsetKey.json' import { Description } from '../Description' diff --git a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx index 9c3e9f4b8..29d76fafa 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/test/SignerListSetTableDetail.test.tsx @@ -1,4 +1,4 @@ -import { cleanup, screen } from '@testing-library/react' +import { cleanup } from '@testing-library/react' import { TableDetail } from '../TableDetail' import mockSignerListSetClear from './mock_data/SignerListSetClear.json' import mockSignerListSet from './mock_data/SignerListSet.json' diff --git a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx index 5757e7b23..2ac349333 100644 --- a/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/TicketCreate/test/TicketCreateTableDetail.test.tsx @@ -1,4 +1,4 @@ -import { cleanup, screen } from '@testing-library/react' +import { cleanup } from '@testing-library/react' import { createTableDetailRenderFactory } from '../../test' import { TableDetail } from '../TableDetail' import TicketCreate from './mock_data/TicketCreate.json' diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx index c0cb69ee3..933be4858 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx @@ -1,4 +1,4 @@ -import { cleanup, screen } from '@testing-library/react' +import { cleanup } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import mockTrustSet from './mock_data/TrustSet.json' diff --git a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx index e48fd9cf6..6b14861f1 100644 --- a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx +++ b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx @@ -1,5 +1,4 @@ -import { mount } from 'enzyme' -import { cleanup, screen } from '@testing-library/react' +import { cleanup, render, screen } from '@testing-library/react' import i18n from '../../../../../../i18n/testConfigEnglish' import { expectSimpleRowLabel, expectSimpleRowText } from '../../test' import { createSimpleRenderFactory } from '../../test/createRenderFactory' @@ -7,9 +6,9 @@ import { createSimpleRenderFactory } from '../../test/createRenderFactory' import { Simple } from '../Simple' import mockUNLModifyEnable from './mock_data/UNLModifyEnable.json' import mockUNLModifyDisable from './mock_data/UNLModifyDisable.json' -import { SimpleTab } from '../../../../../Transactions/SimpleTab' -import { QuickHarness } from '../../../../../test/utils' import summarizeTransaction from '../../../../../../rippled/lib/txSummary' +import { QuickHarness } from '../../../../../test/utils' +import { SimpleTab } from '../../../../../Transactions/SimpleTab' const renderComponent = createSimpleRenderFactory(Simple, i18n) @@ -40,7 +39,7 @@ describe('UNLModify: Simple', () => { }) it('renders tx with correct account and sequence', () => { - const screen = mount( + render( Date: Thu, 9 May 2024 12:01:41 -0400 Subject: [PATCH 11/55] fix more issues --- .../AMMBid/test/{AMMBid.test.tsx => AMMBidSimple.test.tsx} | 2 +- .../Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx | 2 +- .../Transaction/Clawback/test/ClawbackSimple.test.tsx | 3 ++- src/containers/shared/components/Transaction/SimpleRow.tsx | 5 +++-- .../shared/components/Transaction/test/expectations.ts | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) rename src/containers/shared/components/Transaction/AMMBid/test/{AMMBid.test.tsx => AMMBidSimple.test.tsx} (96%) diff --git a/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx b/src/containers/shared/components/Transaction/AMMBid/test/AMMBidSimple.test.tsx similarity index 96% rename from src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx rename to src/containers/shared/components/Transaction/AMMBid/test/AMMBidSimple.test.tsx index 1f678297f..8e41c419b 100644 --- a/src/containers/shared/components/Transaction/AMMBid/test/AMMBid.test.tsx +++ b/src/containers/shared/components/Transaction/AMMBid/test/AMMBidSimple.test.tsx @@ -5,7 +5,7 @@ import bidMock from './mock_data/amm_bid.json' const renderComponent = createSimpleRenderFactory(Simple) -describe('AMM Bid Tests', () => { +describe('AMM Bid: Simple', () => { afterEach(cleanup) it('renders from transaction', () => { diff --git a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx index cb4d3266f..13bcaeac8 100644 --- a/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx +++ b/src/containers/shared/components/Transaction/AMMDelete/test/AMMDeleteDescription.test.tsx @@ -14,7 +14,7 @@ describe('AMMDelete: Description', () => { expect(screen.getByTestId('amm-delete-description')).toHaveTextContent( 'Attempted to delete the AMM for \uE900 XRP and FOO.rm5c42Crqpdch5fbuCdHmSMV1wrL9arV9.If there were more than 512 trustlines, this only removes 512 trustlines instead.', ) - expect(screen.findByRole('link')).toHaveAttribute( + expect(screen.queryByRole('link')).toHaveAttribute( 'href', '/token/FOO.rm5c42Crqpdch5fbuCdHmSMV1wrL9arV9', ) diff --git a/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx b/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx index f6d0e013a..baee4433c 100644 --- a/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx +++ b/src/containers/shared/components/Transaction/Clawback/test/ClawbackSimple.test.tsx @@ -14,11 +14,12 @@ jest.mock('react-query', () => ({ const renderComponent = createSimpleRenderFactory(Simple) -describe('Clawback - Simple', () => { +describe('Clawback: Simple', () => { afterEach(cleanup) it('handles Clawback simple view ', () => { renderComponent(transaction) expectSimpleRowText(screen, 'holder', 'rscBWQpyZEmQvupeB1quu7Ky8YX4f5CHDP') + screen.debug() expectSimpleRowText( screen, 'amount', diff --git a/src/containers/shared/components/Transaction/SimpleRow.tsx b/src/containers/shared/components/Transaction/SimpleRow.tsx index 4cc56510b..e2f11500c 100644 --- a/src/containers/shared/components/Transaction/SimpleRow.tsx +++ b/src/containers/shared/components/Transaction/SimpleRow.tsx @@ -4,12 +4,13 @@ import classnames from 'classnames' export type SimpleRowProps = PropsWithChildren<{ className?: string label: string + 'data-testid'?: string }> export const SimpleRow = (props: SimpleRowProps) => { - const { label, children, className } = props + const { label, children, className, 'data-testid': testId } = props return ( -
    +
    {label}
    {children}
    diff --git a/src/containers/shared/components/Transaction/test/expectations.ts b/src/containers/shared/components/Transaction/test/expectations.ts index 5ef9f58f2..1240c471b 100644 --- a/src/containers/shared/components/Transaction/test/expectations.ts +++ b/src/containers/shared/components/Transaction/test/expectations.ts @@ -5,4 +5,4 @@ export const expectSimpleRowText = (screen: any, key: string, text: string) => expect(screen.getByTestId(key)).toHaveTextContent(text) export const expectSimpleRowNotToExist = (screen: any, key: string) => - expect(screen.getByTestId(key)).not.toExist() + expect(screen.queryByTestId(key)).toBeNull() From 56468f73ea9bad54f95cbae0dcef7087ef348e04 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 9 May 2024 12:03:17 -0400 Subject: [PATCH 12/55] fix DID tests --- .../components/Transaction/DIDSet/test/DIDSetSimple.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetSimple.test.tsx b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetSimple.test.tsx index 13735b8da..72fa55215 100644 --- a/src/containers/shared/components/Transaction/DIDSet/test/DIDSetSimple.test.tsx +++ b/src/containers/shared/components/Transaction/DIDSet/test/DIDSetSimple.test.tsx @@ -10,7 +10,7 @@ describe('DIDSet: Simple', () => { it('renders', () => { renderComponent(DIDSet) expectSimpleRowText(screen, 'uri', 'did_example') - expectSimpleRowText(screen, 'did_document', 'doc') + expectSimpleRowText(screen, 'did-document', 'doc') expectSimpleRowText(screen, 'attestation', 'attest') }) }) From 70a4e4488a44cc80a45d59f2465f0b87cf85db98 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 9 May 2024 12:10:32 -0400 Subject: [PATCH 13/55] fix escrow tests --- .../EscrowCreate/test/EscrowCreateTableDetail.test.tsx | 4 ++-- .../components/Transaction/EscrowFinish/TableDetail.tsx | 4 ++-- .../EscrowFinish/test/EscrowFinishTableDetail.test.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx index 3c72a0ebf..15e420e3b 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateTableDetail.test.tsx @@ -10,11 +10,11 @@ describe('EscrowCreateTableDetail', () => { it('renders EscrowCreate without crashing', () => { renderComponent(mockEscrowCreate) expect(screen.getByTestId('account')).toHaveTextContent( - ` rLbgNAngLq3HABBXK4uPGCHrqeZwgaYi7q `, + `rLbgNAngLq3HABBXK4uPGCHrqeZwgaYi7q`, ) expect(screen.getByTestId('amount')).toHaveTextContent(`997.50 XRP`) expect(screen.getByTestId('condition')).toHaveTextContent( - ` A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120 `, + `A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120`, ) expect(screen.getByTestId('finish_after')).toHaveTextContent( `March 1, 2020 at 9:01:00 AM UTC`, diff --git a/src/containers/shared/components/Transaction/EscrowFinish/TableDetail.tsx b/src/containers/shared/components/Transaction/EscrowFinish/TableDetail.tsx index f9fbb6918..708ed624f 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/TableDetail.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/TableDetail.tsx @@ -18,9 +18,9 @@ export const TableDetail = (props: any) => {
    )} {amount && ( -
    +
    {t('amount')} - +
    )} {fulfillment && ( diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx index 273e80827..bfa947ed1 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishTableDetail.test.tsx @@ -16,7 +16,7 @@ describe('EscrowFinish - TableDetail', () => { `\uE9000.0154 XRP`, ) expect(screen.getByTestId('escrow-fulfillment')).toHaveTextContent( - `fulfillment Fulfillment `, + `fulfillment Fulfillment`, ) }) }) From 09b08651c37fe4f44fae0557364b34626cacc9f3 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 9 May 2024 12:17:39 -0400 Subject: [PATCH 14/55] fix NFT tests --- .../Transaction/NFTokenAcceptOffer/Simple.tsx | 2 +- .../test/NFTokenAcceptOfferSimple.test.tsx | 8 +++---- .../Transaction/NFTokenCancelOffer/Simple.tsx | 2 +- .../test/NFTokenCancelOfferSimple.test.tsx | 2 +- .../Transaction/NFTokenCreateOffer/Simple.tsx | 2 +- .../test/NFTokenCreateOfferSimple.test.tsx | 22 +++++++++++-------- .../test/NFTokenMintSimple.test.tsx | 2 +- 7 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/Simple.tsx b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/Simple.tsx index e2ca6d49a..395bf2c9f 100644 --- a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/Simple.tsx +++ b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/Simple.tsx @@ -38,7 +38,7 @@ export const Simple: TransactionSimpleComponent = ({ > - + diff --git a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx index cbbd68609..be1584f44 100644 --- a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx @@ -24,7 +24,7 @@ describe('NFTokenAcceptOffer - Simple', () => { 'offer-id', '8278760A246D4464EE701D503091B9DB0D9790DD2BBE9CAABCA45B04A1A25B6B', ) - expectSimpleRowText(screen, 'amount', '\uE9000.0001 XRP') + expectSimpleRowText(screen, 'offer-amount', '\uE9000.0001 XRP') expectSimpleRowText(screen, 'buyer', 'rfFRmXUR1yfxeUfXj7WwKhETrtToYx1hYh') expectSimpleRowText(screen, 'seller', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g') }) @@ -41,7 +41,7 @@ describe('NFTokenAcceptOffer - Simple', () => { 'offer-id', '505E7F1E1EA989C0B0196AB7F503ACACAC7A9640C27B58A5E3C9DD31E88848D4', ) - expectSimpleRowText(screen, 'amount', '\uE9000.000102 XRP') + expectSimpleRowText(screen, 'offer-amount', '\uE9000.000102 XRP') expectSimpleRowText(screen, 'buyer', 'rfFRmXUR1yfxeUfXj7WwKhETrtToYx1hYh') expectSimpleRowText(screen, 'seller', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g') }) @@ -55,7 +55,7 @@ describe('NFTokenAcceptOffer - Simple', () => { '17AFFE8C8D94554EB3A31A517B05C16085777FAEA9ACEDDCDE9D7CFD7B988D01', ) expectSimpleRowNotToExist(screen, 'token-id') - expectSimpleRowNotToExist(screen, 'amount') + expectSimpleRowNotToExist(screen, 'offer-amount') expectSimpleRowNotToExist(screen, 'buyer') expectSimpleRowNotToExist(screen, 'seller') }) @@ -68,7 +68,7 @@ describe('NFTokenAcceptOffer - Simple', () => { '00081B581189F5687DBB7516339D6CCB5593D96622AD82DF08CFDA8600000A17', ) expect(screen.getAllByTestId('offer-id').length).toBe(2) - expectSimpleRowText(screen, 'amount', '\uE9002,500.00 XRP') + expectSimpleRowText(screen, 'offer-amount', '\uE9002,500.00 XRP') expectSimpleRowText(screen, 'buyer', 'rNYKGnHrjSnKXQGgACciyCLg4xRcwWZixN') expectSimpleRowText(screen, 'seller', 'rnp9DA6H2tLH7YFkgpjoVREB2yccYv56Sg') }) diff --git a/src/containers/shared/components/Transaction/NFTokenCancelOffer/Simple.tsx b/src/containers/shared/components/Transaction/NFTokenCancelOffer/Simple.tsx index 6df38b784..7a74cd066 100644 --- a/src/containers/shared/components/Transaction/NFTokenCancelOffer/Simple.tsx +++ b/src/containers/shared/components/Transaction/NFTokenCancelOffer/Simple.tsx @@ -30,7 +30,7 @@ export const Simple: TransactionSimpleComponent = ({ > - + diff --git a/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx index 89d3c12cc..5b04942c6 100644 --- a/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx @@ -15,7 +15,7 @@ describe('NFTokenCancelOffer', () => { expect(screen.getByTestId('offer-id')).toHaveTextContent( '35F3D6D99548FA5F5315580FBF8BA6B15CAA2CAE93023D5CE4FDC130602BC5C3', ) - expect(screen.getByTestId('amount')).toHaveTextContent( + expect(screen.getByTestId('offer-amount')).toHaveTextContent( '$100.00 USD.r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g', ) expect(screen.getByTestId('offerer')).toHaveTextContent( diff --git a/src/containers/shared/components/Transaction/NFTokenCreateOffer/Simple.tsx b/src/containers/shared/components/Transaction/NFTokenCreateOffer/Simple.tsx index 4d57365c0..88c697bda 100644 --- a/src/containers/shared/components/Transaction/NFTokenCreateOffer/Simple.tsx +++ b/src/containers/shared/components/Transaction/NFTokenCreateOffer/Simple.tsx @@ -39,7 +39,7 @@ export const Simple: TransactionSimpleComponent = ({ - + diff --git a/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx index c3f6ce847..3d5e45d3b 100644 --- a/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx @@ -1,5 +1,9 @@ import { cleanup, screen } from '@testing-library/react' -import { createSimpleRenderFactory, expectSimpleRowText } from '../../test' +import { + createSimpleRenderFactory, + expectSimpleRowNotToExist, + expectSimpleRowText, +} from '../../test' import { Simple } from '../Simple' import transactionBuy from './mock_data/NFTokenCreateOffer_Buy.json' import transactionSell from './mock_data/NFTokenCreateOffer_Sell.json' @@ -23,14 +27,14 @@ describe('NFTokenCreateOffer', () => { '3D1C297DA5B831267CCF692F8A023688D6A4BD5AFAE9A746D5C4E0B15D256B29', ) expectSimpleRowText(screen, 'owner', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g') - expectSimpleRowText(screen, 'amount', '\uE9000.0001 XRP') + expectSimpleRowText(screen, 'offer-amount', '\uE9000.0001 XRP') expect(screen.getByTestId('buyer-or-seller')).toHaveTextContent('buyer') expectSimpleRowText( screen, 'buyer-or-seller', 'rfFRmXUR1yfxeUfXj7WwKhETrtToYx1hYh', ) - expect(screen.getByTestId('destination')).not.toExist() + expectSimpleRowNotToExist(screen, 'destination') }) it('handles NFTokenCreateOffer sell simple view ', () => { @@ -45,10 +49,10 @@ describe('NFTokenCreateOffer', () => { 'offer-id', 'F660CA62E16B8067649052E8FCE947049FC6EF0D8B42EF7E5819997EC5AE45B6', ) - expect(screen.getByTestId('owner')).not.toExist() + expectSimpleRowNotToExist(screen, 'owner') expectSimpleRowText( screen, - 'amount', + 'offer-amount', '$100.00 USD.r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g', ) expect(screen.getByTestId('buyer-or-seller')).toHaveTextContent('seller') @@ -57,7 +61,7 @@ describe('NFTokenCreateOffer', () => { 'buyer-or-seller', 'r9AExd6v3keXaXa3nXAMHHcP9nWy9Aef2g', ) - expect(screen.getByTestId('destination')).not.toExist() + expectSimpleRowNotToExist(screen, 'destination') }) it('handles failed NFTokenCreateOffer transaction', () => { @@ -67,9 +71,9 @@ describe('NFTokenCreateOffer', () => { 'token-id', '00080000AC7377C74DD53E77C8161537F5EBF56B0CE8FD3BD392C2B800001702', ) - expect(screen.getByTestId('offer-id')).not.toExist() - expect(screen.getByTestId('owner')).not.toExist() - expectSimpleRowText(screen, 'amount', '\uE900500.00 XRP') + expectSimpleRowNotToExist(screen, 'offer-id') + expectSimpleRowNotToExist(screen, 'owner') + expectSimpleRowText(screen, 'offer-amount', '\uE900500.00 XRP') }) it('handles NFTokenCreateOffer with destination', () => { diff --git a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx index eeb305e8c..b3a5a3814 100644 --- a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx @@ -63,7 +63,7 @@ describe('NFTokenMint - Simple', () => { it('handles NFTokenMint with issuer', () => { renderComponent(transactionWithIssuer) - expect(screen.getByTestId('token-issuer')).toExist() + expect(screen.getByTestId('token-issuer')).toBeDefined() expectSimpleRowText( screen, 'token-id', From 6c7b362a07e82238a71fe763b1549df3f4fcc70d Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 9 May 2024 12:24:52 -0400 Subject: [PATCH 15/55] fix offer tests --- .../test/EnableAmendmentSimple.test.tsx | 2 +- .../Transaction/OfferCreate/Simple.tsx | 2 +- .../Transaction/OfferCreate/TableDetail.tsx | 8 +++--- .../test/OfferCreateSimple.test.tsx | 6 ++--- .../test/OfferCreateTableDetail.test.tsx | 2 +- .../Payment/test/PaymentDescription.test.tsx | 16 ++++++------ .../Payment/test/PaymentSimple.test.tsx | 2 +- .../PaymentChannelClaimDescription.test.tsx | 10 +++---- .../PaymentChannelClaimTableDetail.test.tsx | 26 +++++++++---------- .../PaymentChannelCreateDescription.test.tsx | 8 +++--- .../SetHook/test/SetHookSimple.test.tsx | 4 +-- .../test/SetRegularKeyTableDetail.test.tsx | 4 +-- .../UNLModify/test/UNLModifySimple.test.tsx | 2 +- .../test/XChainCommitSimple.test.tsx | 2 +- .../test/XChainCreateBridgeSimple.test.tsx | 2 +- .../test/XChainCreateClaimIDSimple.test.tsx | 2 +- 16 files changed, 48 insertions(+), 50 deletions(-) diff --git a/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx b/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx index e4103b248..662dba070 100644 --- a/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx @@ -60,7 +60,7 @@ describe('EnableAmendment: Simple', () => { expectSimpleRowText(screen, 'status', 'Lost Majority') expectSimpleRowLabel(screen, 'version', 'Introduced In') expectSimpleRowText(screen, 'version', 'Loading') - expect(screen.getByTestId('date')).not.toExist() + expect(screen.getByTestId('date')).toBeNull() await flushPromises() diff --git a/src/containers/shared/components/Transaction/OfferCreate/Simple.tsx b/src/containers/shared/components/Transaction/OfferCreate/Simple.tsx index 6aae61649..8c8b80807 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/Simple.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/Simple.tsx @@ -13,7 +13,7 @@ const Simple: TransactionSimpleComponent = (props: TransactionSimpleProps) => { return ( <> -
    +
    {`${Number(price)}`}
    { />
    -
    +
    {t('buy')} - +
    -
    +
    {t('sell')} - +
    {cancel && (
    diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx index 5f2a2fcf7..c3c78d32b 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx @@ -10,9 +10,7 @@ describe('OfferCreate: Simple', () => { afterEach(cleanup) it('renders with an expiration and offer', () => { renderComponent(mockOfferCreateWithCancel) - expect(screen.getByTestId('amount')).toHaveTextContent( - '\uE900 XRP/CSC.rCSC', - ) + expect(screen.getByTestId('price')).toHaveTextContent('\uE900 XRP/CSC.rCSC') expect(screen.getByTestId('cancel-id')).toHaveTextContent('#44866443') expect(screen.getByTestId('amount-buy')).toHaveTextContent( `\uE9001,764.293151 XRP`, @@ -25,7 +23,7 @@ describe('OfferCreate: Simple', () => { it('renders', () => { renderComponent(mockOfferCreate) - expect(screen.getByTestId('offer-id')).not.toExist() + expect(screen.queryByTestId('offer-id')).toBeNull() expect(screen.getByTestId('amount-buy')).toHaveTextContent( `\uE90024,755.081083 XRP`, ) diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx index 8ce5f14c6..d34d6c7d3 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx @@ -32,7 +32,7 @@ describe('OfferCreate: TableDetail', () => { expect(screen.getByTestId('pair')).toHaveTextContent( 'price:0.00207696 \uE900 XRP/BCH.rcyS', ) - expect(screen.getByTestId('offer-id')).not.toExist() + expect(screen.queryByTestId('offer-id')).toBeNull() expect(screen.getByTestId('amount-buy')).toHaveTextContent( `\uE90024,755.081083 XRP`, ) diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx index fdf53cd3e..566652856 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx @@ -20,8 +20,8 @@ describe('Payment: Description', () => { expect(screen.getByTestId('from-to-line')).toHaveTextContent( `The payment is from rNQEMJA4PsoSrZRn9J6RajAYhcDzzhf8ok to rHoPwMC75KVUhBMeV3uDMybKG5JND74teh`, ) - expect(screen.getByTestId('source-tag-line')).not.toExist() - expect(screen.getByTestId('destination-tag-line')).not.toExist() + expect(screen.getByTestId('source-tag-line')).toBeNull() + expect(screen.getByTestId('destination-tag-line')).toBeNull() expect(screen.getByTestId('amount-line')).toHaveTextContent( `It was instructed to deliver \uE9002,421.8268 XRP`, ) @@ -36,12 +36,12 @@ describe('Payment: Description', () => { expect(screen.getByTestId('from-to-line')).toHaveTextContent( `The payment is from r9x5PHDiwuvbpYB3uvGAqEUVV5wxHayQEx to r9x5PHDiwuvbpYB3uvGAqEUVV5wxHayQEx`, ) - expect(screen.getByTestId('source-tag-line')).not.toExist() - expect(screen.getByTestId('destination-tag-line')).not.toExist() + expect(screen.getByTestId('source-tag-line')).toBeNull() + expect(screen.getByTestId('destination-tag-line')).toBeNull() expect(screen.getByTestId('amount-line')).toHaveTextContent( `It was instructed to deliver up to 1,140.00 YCN.r8HgVGenRTAiNSM5iqt9PX2D2EczFZhZr by spending up to \uE9001,140.00 XRP`, ) - expect(screen.getByTestId('delivered-line')).not.toExist() + expect(screen.getByTestId('delivered-line')).toBeNull() }) it('renders with destination tag', () => { @@ -50,7 +50,7 @@ describe('Payment: Description', () => { expect(screen.getByTestId('from-to-line')).toHaveTextContent( `The payment is from rDAE53VfMvftPB4ogpWGWvzkQxfht6JPxr to rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt`, ) - expect(screen.getByTestId('source-tag-line')).not.toExist() + expect(screen.getByTestId('source-tag-line')).toBeNull() expect(screen.getByTestId('destination-tag-line')).toHaveTextContent( `The destination tag is 381702`, ) @@ -71,7 +71,7 @@ describe('Payment: Description', () => { expect(screen.getByTestId('destination-tag-line')).toHaveTextContent( `The destination tag is 0`, ) - expect(screen.getByTestId('source-tag-line')).not.toExist() + expect(screen.getByTestId('source-tag-line')).toBeNull() expect(screen.getByTestId('amount-line')).toHaveTextContent( `It was instructed to deliver 17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA by spending up to 17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA`, ) @@ -89,7 +89,7 @@ describe('Payment: Description', () => { expect(screen.getByTestId('destination-tag-line')).toHaveTextContent( `The destination tag is 0`, ) - expect(screen.getByTestId('source-tag-line')).not.toExist() + expect(screen.getByTestId('source-tag-line')).toBeNull() expect(screen.getByTestId('amount-line')).toHaveTextContent( `It was instructed to deliver up to 0.001043 xCoin.rXCoYSUnkpygdtfpz3Df8dKQuRZjM9UFi`, ) diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx index 192498dd6..760cf9aba 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx @@ -49,7 +49,7 @@ describe('Payment: Simple', () => { `0.00 YCN.r8HgVGenRTAiNSM5iqt9PX2D2EczFZhZrpartial_payment_allowed`, ) - expect(screen.getByTestId('destination')).not.toExist() + expect(screen.getByTestId('destination')).toBeNull() }) it('renders with destination tag', () => { diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx index 2f5473973..e8bb32d4d 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx @@ -23,7 +23,7 @@ describe('PaymentChannelClaim: Description', () => { expect(screen.getByTestId('balance-line')).toHaveTextContent( `The channel balance claimed is \uE90049.65716XRP (increased by \uE9000.01XRP)`, ) - expect(screen.getByTestId('closed-line')).not.toExist() + expect(screen.getByTestId('closed-line')).toBeNull() }) it('renders tx with channel being closed', () => { @@ -34,7 +34,7 @@ describe('PaymentChannelClaim: Description', () => { expect(screen.getByTestId('channel-line')).toHaveTextContent( `It will update the payment channel 3BDB4F92432BCEB2385D3BAA60E8AAEC9B552890A240AEE4AA9E88C9E6C517E8`, ) - expect(screen.getByTestId('balance-line')).not.toExist() + expect(screen.getByTestId('balance-line')).toBeNull() expect(screen.getByTestId('closed-line')).toHaveTextContent( `The payment channel will be closed, any remaining balance will be returned to the source account`, ) @@ -48,8 +48,8 @@ describe('PaymentChannelClaim: Description', () => { expect(screen.getByTestId('channel-line')).toHaveTextContent( `It will update the payment channel 3BDB4F92432BCEB2385D3BAA60E8AAEC9B552890A240AEE4AA9E88C9E6C517E8`, ) - expect(screen.getByTestId('balance-line')).not.toExist() - expect(screen.getByTestId('closed-line')).not.toExist() + expect(screen.getByTestId('balance-line')).toBeNull() + expect(screen.getByTestId('closed-line')).toBeNull() }) it('renders tx with destination tag', () => { @@ -63,6 +63,6 @@ describe('PaymentChannelClaim: Description', () => { expect(screen.getByTestId('balance-line')).toHaveTextContent( `The channel balance claimed is \uE9001.00XRP (increased by \uE9001.00XRP)`, ) - expect(screen.getByTestId('closed-line')).not.toExist() + expect(screen.getByTestId('closed-line')).toBeNull() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx index 66379d06c..4b6fe7454 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx @@ -23,10 +23,10 @@ describe('PaymentChannelClaim: TableDetail', () => { expect(screen.getByTestId('claimed')).toHaveTextContent( 'claimed\uE9000.01 XRP (\uE90020.34284 XRP of \uE90070.00 XRP remaining)', ) - expect(screen.getByTestId('channel-amount')).not.toExist() - expect(screen.getByTestId('renew')).not.toExist() - expect(screen.getByTestId('close-request')).not.toExist() - expect(screen.getByTestId('closed')).not.toExist() + expect(screen.getByTestId('channel-amount')).toBeNull() + expect(screen.getByTestId('renew')).toBeNull() + expect(screen.getByTestId('close-request')).toBeNull() + expect(screen.getByTestId('closed')).toBeNull() }) it('renders tx with channel being closed', () => { @@ -37,11 +37,11 @@ describe('PaymentChannelClaim: TableDetail', () => { expect(screen.getByTestId('destination')).toHaveTextContent( 'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) - expect(screen.getByTestId('claimed')).not.toExist() + expect(screen.getByTestId('claimed')).toBeNull() expect(screen.getByTestId('channel-amount')).toHaveTextContent( 'channel amount\uE90010.00 XRP', ) - expect(screen.getByTestId('renew')).not.toExist() + expect(screen.getByTestId('renew')).toBeNull() expect(screen.getByTestId('close-request')).toHaveTextContent( 'close channel request', ) @@ -58,15 +58,15 @@ describe('PaymentChannelClaim: TableDetail', () => { expect(screen.getByTestId('destination')).toHaveTextContent( 'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) - expect(screen.getByTestId('claimed')).not.toExist() + expect(screen.getByTestId('claimed')).toBeNull() expect(screen.getByTestId('channel-amount')).toHaveTextContent( 'channel amount\uE90010.00 XRP', ) - expect(screen.getByTestId('renew')).not.toExist() + expect(screen.getByTestId('renew')).toBeNull() expect(screen.getByTestId('close-request')).toHaveTextContent( 'close channel request', ) - expect(screen.getByTestId('closed')).not.toExist() + expect(screen.getByTestId('closed')).toBeNull() }) it('renders tx with destination tag', () => { @@ -80,9 +80,9 @@ describe('PaymentChannelClaim: TableDetail', () => { expect(screen.getByTestId('claimed')).toHaveTextContent( 'claimed\uE9001.00 XRP (\uE90099.00 XRP of \uE900100.00 XRP remaining)', ) - expect(screen.getByTestId('channel-amount')).not.toExist() - expect(screen.getByTestId('renew')).not.toExist() - expect(screen.getByTestId('close-request')).not.toExist() - expect(screen.getByTestId('closed')).not.toExist() + expect(screen.getByTestId('channel-amount')).toBeNull() + expect(screen.getByTestId('renew')).toBeNull() + expect(screen.getByTestId('close-request')).toBeNull() + expect(screen.getByTestId('closed')).toBeNull() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx index ec863a1a0..3224a2e04 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx @@ -25,7 +25,7 @@ describe('PaymentChannelCreate: Description', () => { expect(screen.getByTestId('delay-line')).toHaveTextContent( `The channel has a settlement delay of 3,600 seconds`, ) - expect(screen.getByTestId('cancel-line')).not.toExist() + expect(screen.getByTestId('cancel-line')).toBeNull() }) it('renders failed tx', () => { @@ -33,14 +33,14 @@ describe('PaymentChannelCreate: Description', () => { expect(screen.getByTestId('accounts-line')).toHaveTextContent( `The account rMphibGfHpLDU4DzVCspzLYVuMNpmzN6n8:2810223114 will create a payment channel to rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN`, ) - expect(screen.getByTestId('channel-line')).not.toExist() + expect(screen.getByTestId('channel-line')).toBeNull() expect(screen.getByTestId('amount-line')).toHaveTextContent( `The channel amount is \uE90010.00 XRP`, ) expect(screen.getByTestId('delay-line')).toHaveTextContent( `The channel has a settlement delay of 3,600 seconds`, ) - expect(screen.getByTestId('cancel-line')).not.toExist() + expect(screen.getByTestId('cancel-line')).toBeNull() }) it('renders tx with destination tag', () => { @@ -57,6 +57,6 @@ describe('PaymentChannelCreate: Description', () => { expect(screen.getByTestId('delay-line')).toHaveTextContent( `The channel has a settlement delay of 86,400 seconds`, ) - expect(screen.getByTestId('cancel-line')).not.toExist() + expect(screen.getByTestId('cancel-line')).toBeNull() }) }) diff --git a/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx b/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx index 4489bf8d6..e79bd45eb 100644 --- a/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx @@ -71,7 +71,7 @@ describe('SetHook: Simple', () => { expect(grant1.find('.account').at(0)).toHaveTextContent( 'rQUhXd7sopuga3taru3jfvc1BgVbscrb1X', ) - expect(grant1.find(`.account a`)).toExist() + expect(grant1.find(`.account a`)).toBeDefined() expect(grant2.find('.hash')).toHaveTextContent( '3F47684053E1A653E54EAC1C5F50BCBAF7F69078CEFB5846BB046CE44B8ECDC2', @@ -79,7 +79,7 @@ describe('SetHook: Simple', () => { expect(grant2.find('.account').at(0)).toHaveTextContent( 'raPSFU999HcwpyRojdNh2i96T22gY9fgxL', ) - expect(grant2.find(`.account a`)).toExist() + expect(grant2.find(`.account a`)).toBeDefined() }) it('renders a failed SetHook tx', () => { diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx index 12c63969a..aee61bfe9 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx @@ -11,7 +11,7 @@ describe('SetRegularKeyTable: TableDetail', () => { it('renders Simple for transaction', () => { renderComponent(SetRegularKey) - expect(screen.find('.setregularkey')).toExist() + expect(screen.find('.setregularkey')).toBeDefined() expect(screen.find('.label').text()).toBe(`regular_key`) expect(screen.find('.key').text()).toBe( `rULyyLRoZ47P33Vapew67VoiRqPrZ2ejbp`, @@ -21,7 +21,7 @@ describe('SetRegularKeyTable: TableDetail', () => { it('renders Simple for transaction that unsets key', () => { renderComponent(SetRegularKeyUnset) - expect(screen.find('.unset')).toExist() + expect(screen.find('.unset')).toBeDefined() expect(screen.text()).toBe(`unset_regular_key`) }) }) diff --git a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx index 6b14861f1..9eacc5253 100644 --- a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx +++ b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx @@ -50,7 +50,7 @@ describe('UNLModify: Simple', () => { /> , ) - expect(screen.getByTestId('account')).not.toExist() + expect(screen.getByTestId('account')).toBeNull() expectSimpleRowLabel(screen, 'sequence', 'Sequence Number') expectSimpleRowText(screen, 'sequence', '0') }) diff --git a/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx index 3ce6eab2b..4f807b8ec 100644 --- a/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx @@ -30,7 +30,7 @@ describe('XChainCommitSimple', () => { expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') expectSimpleRowText(screen, 'claim-id', '4') - expect(screen.getByTestId('destination')).not.toExist() + expect(screen.getByTestId('destination')).toBeNull() }) it('renders failed tx', () => { diff --git a/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx index 80fc92a49..4e9c190b0 100644 --- a/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx @@ -29,7 +29,7 @@ describe('XChainCreateBridgeSimple', () => { expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'signature-reward', '\uE9000.0001 XRP') - expect(screen.getByTestId('min-create-account-amount')).not.toExist() + expect(screen.getByTestId('min-create-account-amount')).toBeNull() }) it('renders IOU bridge', () => { diff --git a/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx index f516a710e..c104f76ad 100644 --- a/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx @@ -61,6 +61,6 @@ describe('XChainCreateClaimIDSimple', () => { 'other-chain-source', 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W', ) - expect(screen.getByTestId('claim-id')).not.toExist() + expect(screen.getByTestId('claim-id')).toBeNull() }) }) From e1ca0b496593fb2a21068ceb3b85f8900b16c3af Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 9 May 2024 12:38:41 -0400 Subject: [PATCH 16/55] fix payment/paychan tests --- .../test/EnableAmendmentSimple.test.tsx | 2 +- .../test/NFTokenMintSimple.test.tsx | 2 +- .../components/Transaction/Payment/Simple.tsx | 4 +-- .../Transaction/Payment/TableDetail.tsx | 2 +- .../Payment/test/PaymentDescription.test.tsx | 16 ++++++------ .../Payment/test/PaymentSimple.test.tsx | 22 ++++++++-------- .../Payment/test/PaymentTableDetail.test.tsx | 22 ++++++++-------- .../PaymentChannelClaim/Simple.tsx | 8 ++++-- .../PaymentChannelClaimDescription.test.tsx | 10 +++---- .../test/PaymentChannelClaimSimple.test.tsx | 20 +++++++------- .../PaymentChannelClaimTableDetail.test.tsx | 26 +++++++++---------- .../PaymentChannelCreate/Simple.tsx | 8 ++++-- .../PaymentChannelCreate/TableDetail.tsx | 2 +- .../PaymentChannelCreateDescription.test.tsx | 8 +++--- .../test/PaymentChannelCreateSimple.test.tsx | 16 ++++++------ .../PaymentChannelCreateTableDetail.test.tsx | 12 ++++++--- .../Transaction/PaymentChannelFund/Simple.tsx | 6 ++++- .../test/PaymentChannelFundSimple.test.tsx | 6 ++--- .../UNLModify/test/UNLModifySimple.test.tsx | 2 +- .../test/XChainCommitSimple.test.tsx | 2 +- .../test/XChainCreateBridgeSimple.test.tsx | 2 +- .../test/XChainCreateClaimIDSimple.test.tsx | 2 +- 22 files changed, 109 insertions(+), 91 deletions(-) diff --git a/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx b/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx index 662dba070..1e6b60366 100644 --- a/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx +++ b/src/containers/shared/components/Transaction/EnableAmendment/test/EnableAmendmentSimple.test.tsx @@ -60,7 +60,7 @@ describe('EnableAmendment: Simple', () => { expectSimpleRowText(screen, 'status', 'Lost Majority') expectSimpleRowLabel(screen, 'version', 'Introduced In') expectSimpleRowText(screen, 'version', 'Loading') - expect(screen.getByTestId('date')).toBeNull() + expect(screen.queryByTestId('date')).toBeNull() await flushPromises() diff --git a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx index b3a5a3814..5176e5f33 100644 --- a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx +++ b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx @@ -63,7 +63,7 @@ describe('NFTokenMint - Simple', () => { it('handles NFTokenMint with issuer', () => { renderComponent(transactionWithIssuer) - expect(screen.getByTestId('token-issuer')).toBeDefined() + expect(screen.queryByTestId('token-issuer')).toBeDefined() expectSimpleRowText( screen, 'token-id', diff --git a/src/containers/shared/components/Transaction/Payment/Simple.tsx b/src/containers/shared/components/Transaction/Payment/Simple.tsx index 833893ef2..af60c29f8 100644 --- a/src/containers/shared/components/Transaction/Payment/Simple.tsx +++ b/src/containers/shared/components/Transaction/Payment/Simple.tsx @@ -29,7 +29,7 @@ export const Simple = (props: TransactionSimpleProps) => { )} {renderPartial()} @@ -51,7 +51,7 @@ export const Simple = (props: TransactionSimpleProps) => { - + {renderPartial()} diff --git a/src/containers/shared/components/Transaction/Payment/TableDetail.tsx b/src/containers/shared/components/Transaction/Payment/TableDetail.tsx index 867566e33..b89268d5e 100644 --- a/src/containers/shared/components/Transaction/Payment/TableDetail.tsx +++ b/src/containers/shared/components/Transaction/Payment/TableDetail.tsx @@ -33,7 +33,7 @@ export const TableDetail = ({ {t('to')} {sourceTag !== undefined && ( -
    +
    {t('source_tag')} {': '} {sourceTag} diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx index 566652856..d99b5c177 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentDescription.test.tsx @@ -20,8 +20,8 @@ describe('Payment: Description', () => { expect(screen.getByTestId('from-to-line')).toHaveTextContent( `The payment is from rNQEMJA4PsoSrZRn9J6RajAYhcDzzhf8ok to rHoPwMC75KVUhBMeV3uDMybKG5JND74teh`, ) - expect(screen.getByTestId('source-tag-line')).toBeNull() - expect(screen.getByTestId('destination-tag-line')).toBeNull() + expect(screen.queryByTestId('source-tag-line')).toBeNull() + expect(screen.queryByTestId('destination-tag-line')).toBeNull() expect(screen.getByTestId('amount-line')).toHaveTextContent( `It was instructed to deliver \uE9002,421.8268 XRP`, ) @@ -36,12 +36,12 @@ describe('Payment: Description', () => { expect(screen.getByTestId('from-to-line')).toHaveTextContent( `The payment is from r9x5PHDiwuvbpYB3uvGAqEUVV5wxHayQEx to r9x5PHDiwuvbpYB3uvGAqEUVV5wxHayQEx`, ) - expect(screen.getByTestId('source-tag-line')).toBeNull() - expect(screen.getByTestId('destination-tag-line')).toBeNull() + expect(screen.queryByTestId('source-tag-line')).toBeNull() + expect(screen.queryByTestId('destination-tag-line')).toBeNull() expect(screen.getByTestId('amount-line')).toHaveTextContent( `It was instructed to deliver up to 1,140.00 YCN.r8HgVGenRTAiNSM5iqt9PX2D2EczFZhZr by spending up to \uE9001,140.00 XRP`, ) - expect(screen.getByTestId('delivered-line')).toBeNull() + expect(screen.queryByTestId('delivered-line')).toBeNull() }) it('renders with destination tag', () => { @@ -50,7 +50,7 @@ describe('Payment: Description', () => { expect(screen.getByTestId('from-to-line')).toHaveTextContent( `The payment is from rDAE53VfMvftPB4ogpWGWvzkQxfht6JPxr to rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt`, ) - expect(screen.getByTestId('source-tag-line')).toBeNull() + expect(screen.queryByTestId('source-tag-line')).toBeNull() expect(screen.getByTestId('destination-tag-line')).toHaveTextContent( `The destination tag is 381702`, ) @@ -71,7 +71,7 @@ describe('Payment: Description', () => { expect(screen.getByTestId('destination-tag-line')).toHaveTextContent( `The destination tag is 0`, ) - expect(screen.getByTestId('source-tag-line')).toBeNull() + expect(screen.queryByTestId('source-tag-line')).toBeNull() expect(screen.getByTestId('amount-line')).toHaveTextContent( `It was instructed to deliver 17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA by spending up to 17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA`, ) @@ -89,7 +89,7 @@ describe('Payment: Description', () => { expect(screen.getByTestId('destination-tag-line')).toHaveTextContent( `The destination tag is 0`, ) - expect(screen.getByTestId('source-tag-line')).toBeNull() + expect(screen.queryByTestId('source-tag-line')).toBeNull() expect(screen.getByTestId('amount-line')).toHaveTextContent( `It was instructed to deliver up to 0.001043 xCoin.rXCoYSUnkpygdtfpz3Df8dKQuRZjM9UFi`, ) diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx index 760cf9aba..159f03a72 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentSimple.test.tsx @@ -26,8 +26,8 @@ describe('Payment: Simple', () => { it('renders', () => { renderComponent(mockPayment) - expectSimpleRowText(screen, 'amount', `\uE9002,421.8268 XRP`) - expectSimpleRowLabel(screen, 'amount', `send`) + expectSimpleRowText(screen, 'payment-amount', `\uE9002,421.8268 XRP`) + expectSimpleRowLabel(screen, 'payment-amount', `send`) expectSimpleRowText( screen, @@ -42,21 +42,21 @@ describe('Payment: Simple', () => { expectSimpleRowLabel(screen, 'max', `convert_maximum`) expectSimpleRowText(screen, 'max', `\uE9001,140.00 XRP`) - expectSimpleRowLabel(screen, 'amount', `convert_to`) + expectSimpleRowLabel(screen, 'convert-amount', `convert_to`) expectSimpleRowText( screen, - 'amount', + 'convert-amount', `0.00 YCN.r8HgVGenRTAiNSM5iqt9PX2D2EczFZhZrpartial_payment_allowed`, ) - expect(screen.getByTestId('destination')).toBeNull() + expect(screen.queryByTestId('destination')).toBeNull() }) it('renders with destination tag', () => { renderComponent(mockPaymentDestinationTag) - expectSimpleRowText(screen, 'amount', `\uE9001,531.267 XRP`) - expectSimpleRowLabel(screen, 'amount', `send`) + expectSimpleRowText(screen, 'payment-amount', `\uE9001,531.267 XRP`) + expectSimpleRowLabel(screen, 'payment-amount', `send`) expectSimpleRowText( screen, @@ -77,10 +77,10 @@ describe('Payment: Simple', () => { expectSimpleRowText( screen, - 'amount', + 'payment-amount', `17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjA`, ) - expectSimpleRowLabel(screen, 'amount', `send`) + expectSimpleRowLabel(screen, 'payment-amount', `send`) expectSimpleRowText( screen, @@ -94,10 +94,10 @@ describe('Payment: Simple', () => { expectSimpleRowText( screen, - 'amount', + 'payment-amount', `0.00104196 xCoin.rXCoYSUnkpygdtfpz3Df8dKQuRZjM9UFipartial_payment_allowed`, ) - expectSimpleRowLabel(screen, 'amount', `delivered`) + expectSimpleRowLabel(screen, 'payment-amount', `delivered`) expectSimpleRowText( screen, diff --git a/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx b/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx index 2822aeaea..c9ef98d68 100644 --- a/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/Payment/test/PaymentTableDetail.test.tsx @@ -13,46 +13,46 @@ const renderComponent = createTableDetailRenderFactory(TableDetail) describe('Payment: TableDetail', () => { afterEach(cleanup) it('renders', () => { - renderComponent(mockPayment) + const { container } = renderComponent(mockPayment) // styling makes this look okay - expect(screen.find('.payment')).toHaveTextContent( + expect(container).toHaveTextContent( `send\uE9002,421.8268 XRPtorHoPwMC75KVUhBMeV3uDMybKG5JND74teh`, ) }) it('renders with failed partial conversion', () => { - renderComponent(mockPaymentConvert) + const { container } = renderComponent(mockPaymentConvert) // styling makes this look okay - expect(screen.find('.payment')).toHaveTextContent( + expect(container).toHaveTextContent( `convert_maximum1,140.00 XRPto0.00 YCN.r8HgVGenRTAiNSM5iqt9PX2D2EczFZhZrpartial_payment_allowed`, ) }) it('renders with destination tag', () => { - renderComponent(mockPaymentDestinationTag) + const { container } = renderComponent(mockPaymentDestinationTag) // styling makes this look okay - expect(screen.find('.payment')).toHaveTextContent( + expect(container).toHaveTextContent( `send1,531.267 XRPtorHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt:381702`, ) }) it('renders with send max', () => { - renderComponent(mockPaymentSendMax) + const { container } = renderComponent(mockPaymentSendMax) // styling makes this look okay - expect(screen.find('.payment')).toHaveTextContent( + expect(container).toHaveTextContent( `send17,366,599.150289 XRdoge.rLqUC2eCPohYvJCEBJ77eCCqVL2uEiczjAtorprcTynT68nYdKzDTefAZG9HjSHiYcnP4b:0`, ) }) it('renders with partial', () => { - renderComponent(mockPaymentPartial) + const { container } = renderComponent(mockPaymentPartial) // styling makes this look okay - expect(screen.find('.payment')).toHaveTextContent( + expect(container).toHaveTextContent( `send0.00104196 xCoin.rXCoYSUnkpygdtfpz3Df8dKQuRZjM9UFitorMQ4oGC8fasuJwfdrfknFTttDbf8cR3D2j:0partial_payment_allowed`, ) }) @@ -60,6 +60,6 @@ describe('Payment: TableDetail', () => { it('renders with SourceTag', () => { renderComponent(mockPaymentSourceTag) - expect(screen.find('.st')).toHaveTextContent('source_tag: 20648') + expect(screen.getByTestId('st')).toHaveTextContent('source_tag: 20648') }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/Simple.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/Simple.tsx index 890501665..866961a87 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/Simple.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/Simple.tsx @@ -26,7 +26,7 @@ export const Simple = ({ return ( <> {channelAmount && ( - + )} @@ -53,7 +53,11 @@ export const Simple = ({ )} {channel && ( - + {channel} )} diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx index e8bb32d4d..306bf83df 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimDescription.test.tsx @@ -23,7 +23,7 @@ describe('PaymentChannelClaim: Description', () => { expect(screen.getByTestId('balance-line')).toHaveTextContent( `The channel balance claimed is \uE90049.65716XRP (increased by \uE9000.01XRP)`, ) - expect(screen.getByTestId('closed-line')).toBeNull() + expect(screen.queryByTestId('closed-line')).toBeNull() }) it('renders tx with channel being closed', () => { @@ -34,7 +34,7 @@ describe('PaymentChannelClaim: Description', () => { expect(screen.getByTestId('channel-line')).toHaveTextContent( `It will update the payment channel 3BDB4F92432BCEB2385D3BAA60E8AAEC9B552890A240AEE4AA9E88C9E6C517E8`, ) - expect(screen.getByTestId('balance-line')).toBeNull() + expect(screen.queryByTestId('balance-line')).toBeNull() expect(screen.getByTestId('closed-line')).toHaveTextContent( `The payment channel will be closed, any remaining balance will be returned to the source account`, ) @@ -48,8 +48,8 @@ describe('PaymentChannelClaim: Description', () => { expect(screen.getByTestId('channel-line')).toHaveTextContent( `It will update the payment channel 3BDB4F92432BCEB2385D3BAA60E8AAEC9B552890A240AEE4AA9E88C9E6C517E8`, ) - expect(screen.getByTestId('balance-line')).toBeNull() - expect(screen.getByTestId('closed-line')).toBeNull() + expect(screen.queryByTestId('balance-line')).toBeNull() + expect(screen.queryByTestId('closed-line')).toBeNull() }) it('renders tx with destination tag', () => { @@ -63,6 +63,6 @@ describe('PaymentChannelClaim: Description', () => { expect(screen.getByTestId('balance-line')).toHaveTextContent( `The channel balance claimed is \uE9001.00XRP (increased by \uE9001.00XRP)`, ) - expect(screen.getByTestId('closed-line')).toBeNull() + expect(screen.queryByTestId('closed-line')).toBeNull() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx index 71bc7e7c4..63ecc2891 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimSimple.test.tsx @@ -19,8 +19,8 @@ describe('PaymentChannelClaim: Simple', () => { afterEach(cleanup) it('renders a claim', () => { renderComponent(mockPaymentChannelClaim) - expectSimpleRowLabel(screen, 'amount', 'channel amount') - expectSimpleRowText(screen, 'amount', '\uE90070.00 XRP') + expectSimpleRowLabel(screen, 'channel-amount', 'channel amount') + expectSimpleRowText(screen, 'channel-amount', '\uE90070.00 XRP') expectSimpleRowLabel(screen, 'claimed', 'amount claimed') expectSimpleRowText(screen, 'claimed', '\uE9000.01 XRP') expectSimpleRowLabel(screen, 'total', 'total claimed') @@ -37,10 +37,10 @@ describe('PaymentChannelClaim: Simple', () => { 'destination', 'rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) - expectSimpleRowLabel(screen, '.channel', 'Channel ID') + expectSimpleRowLabel(screen, 'channel', 'Channel ID') expectSimpleRowText( screen, - '.channel', + 'channel', '50107651E7163E294CE0EAD8A20BF7CC046304480FCC9C74A49FFAB3F46FB98E', ) expectSimpleRowNotToExist(screen, 'renew') @@ -50,7 +50,7 @@ describe('PaymentChannelClaim: Simple', () => { it('renders tx with channel being closed', () => { renderComponent(mockPaymentChannelClaimClosed) - expectSimpleRowText(screen, 'amount', '\uE90010.00 XRP') + expectSimpleRowText(screen, 'channel-amount', '\uE90010.00 XRP') expectSimpleRowNotToExist(screen, 'claimed') expectSimpleRowText(screen, 'total', '\uE9000.34 XRP') expectSimpleRowText( @@ -65,7 +65,7 @@ describe('PaymentChannelClaim: Simple', () => { ) expectSimpleRowText( screen, - '.channel', + 'channel', '3BDB4F92432BCEB2385D3BAA60E8AAEC9B552890A240AEE4AA9E88C9E6C517E8', ) expectSimpleRowNotToExist(screen, 'renew') @@ -75,7 +75,7 @@ describe('PaymentChannelClaim: Simple', () => { it('renders tx requesting channel be closed but not closing it', () => { renderComponent(mockPaymentChannelClaimCloseDenied) - expectSimpleRowText(screen, 'amount', '\uE90010.00 XRP') + expectSimpleRowText(screen, 'channel-amount', '\uE90010.00 XRP') expectSimpleRowNotToExist(screen, 'claimed') expectSimpleRowNotToExist(screen, 'total') expectSimpleRowText( @@ -90,7 +90,7 @@ describe('PaymentChannelClaim: Simple', () => { ) expectSimpleRowText( screen, - '.channel', + 'channel', '3BDB4F92432BCEB2385D3BAA60E8AAEC9B552890A240AEE4AA9E88C9E6C517E8', ) expectSimpleRowNotToExist(screen, 'renew') @@ -100,7 +100,7 @@ describe('PaymentChannelClaim: Simple', () => { it('renders tx with destination tag', () => { renderComponent(mockPaymentChannelClaimWithDestinationTag) - expectSimpleRowText(screen, 'amount', '\uE900100.00 XRP') + expectSimpleRowText(screen, 'channel-amount', '\uE900100.00 XRP') expectSimpleRowText(screen, 'claimed', '\uE9001.00 XRP') expectSimpleRowText(screen, 'total', '\uE9001.00 XRP') expectSimpleRowText(screen, 'source', 'rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH') @@ -111,7 +111,7 @@ describe('PaymentChannelClaim: Simple', () => { ) expectSimpleRowText( screen, - '.channel', + 'channel', '5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3', ) expectSimpleRowNotToExist(screen, 'renew') diff --git a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx index 4b6fe7454..b8eeba01b 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelClaim/test/PaymentChannelClaimTableDetail.test.tsx @@ -23,10 +23,10 @@ describe('PaymentChannelClaim: TableDetail', () => { expect(screen.getByTestId('claimed')).toHaveTextContent( 'claimed\uE9000.01 XRP (\uE90020.34284 XRP of \uE90070.00 XRP remaining)', ) - expect(screen.getByTestId('channel-amount')).toBeNull() - expect(screen.getByTestId('renew')).toBeNull() - expect(screen.getByTestId('close-request')).toBeNull() - expect(screen.getByTestId('closed')).toBeNull() + expect(screen.queryByTestId('channel-amount')).toBeNull() + expect(screen.queryByTestId('renew')).toBeNull() + expect(screen.queryByTestId('close-request')).toBeNull() + expect(screen.queryByTestId('closed')).toBeNull() }) it('renders tx with channel being closed', () => { @@ -37,11 +37,11 @@ describe('PaymentChannelClaim: TableDetail', () => { expect(screen.getByTestId('destination')).toHaveTextContent( 'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) - expect(screen.getByTestId('claimed')).toBeNull() + expect(screen.queryByTestId('claimed')).toBeNull() expect(screen.getByTestId('channel-amount')).toHaveTextContent( 'channel amount\uE90010.00 XRP', ) - expect(screen.getByTestId('renew')).toBeNull() + expect(screen.queryByTestId('renew')).toBeNull() expect(screen.getByTestId('close-request')).toHaveTextContent( 'close channel request', ) @@ -58,15 +58,15 @@ describe('PaymentChannelClaim: TableDetail', () => { expect(screen.getByTestId('destination')).toHaveTextContent( 'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) - expect(screen.getByTestId('claimed')).toBeNull() + expect(screen.queryByTestId('claimed')).toBeNull() expect(screen.getByTestId('channel-amount')).toHaveTextContent( 'channel amount\uE90010.00 XRP', ) - expect(screen.getByTestId('renew')).toBeNull() + expect(screen.queryByTestId('renew')).toBeNull() expect(screen.getByTestId('close-request')).toHaveTextContent( 'close channel request', ) - expect(screen.getByTestId('closed')).toBeNull() + expect(screen.queryByTestId('closed')).toBeNull() }) it('renders tx with destination tag', () => { @@ -80,9 +80,9 @@ describe('PaymentChannelClaim: TableDetail', () => { expect(screen.getByTestId('claimed')).toHaveTextContent( 'claimed\uE9001.00 XRP (\uE90099.00 XRP of \uE900100.00 XRP remaining)', ) - expect(screen.getByTestId('channel-amount')).toBeNull() - expect(screen.getByTestId('renew')).toBeNull() - expect(screen.getByTestId('close-request')).toBeNull() - expect(screen.getByTestId('closed')).toBeNull() + expect(screen.queryByTestId('channel-amount')).toBeNull() + expect(screen.queryByTestId('renew')).toBeNull() + expect(screen.queryByTestId('close-request')).toBeNull() + expect(screen.queryByTestId('closed')).toBeNull() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/Simple.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/Simple.tsx index ab3a8717f..b91f8426c 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/Simple.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/Simple.tsx @@ -18,7 +18,7 @@ export const Simple = ({ return ( <> - + @@ -39,7 +39,11 @@ export const Simple = ({ )} {channel && ( - + {channel} )} diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/TableDetail.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/TableDetail.tsx index bca200507..ca7cb2ac4 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/TableDetail.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/TableDetail.tsx @@ -20,7 +20,7 @@ export const TableDetail = ({ {t('destination')}
    -
    +
    {t('channel_amount')}
    diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx index 3224a2e04..0e5c89c56 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateDescription.test.tsx @@ -25,7 +25,7 @@ describe('PaymentChannelCreate: Description', () => { expect(screen.getByTestId('delay-line')).toHaveTextContent( `The channel has a settlement delay of 3,600 seconds`, ) - expect(screen.getByTestId('cancel-line')).toBeNull() + expect(screen.queryByTestId('cancel-line')).toBeNull() }) it('renders failed tx', () => { @@ -33,14 +33,14 @@ describe('PaymentChannelCreate: Description', () => { expect(screen.getByTestId('accounts-line')).toHaveTextContent( `The account rMphibGfHpLDU4DzVCspzLYVuMNpmzN6n8:2810223114 will create a payment channel to rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN`, ) - expect(screen.getByTestId('channel-line')).toBeNull() + expect(screen.queryByTestId('channel-line')).toBeNull() expect(screen.getByTestId('amount-line')).toHaveTextContent( `The channel amount is \uE90010.00 XRP`, ) expect(screen.getByTestId('delay-line')).toHaveTextContent( `The channel has a settlement delay of 3,600 seconds`, ) - expect(screen.getByTestId('cancel-line')).toBeNull() + expect(screen.queryByTestId('cancel-line')).toBeNull() }) it('renders tx with destination tag', () => { @@ -57,6 +57,6 @@ describe('PaymentChannelCreate: Description', () => { expect(screen.getByTestId('delay-line')).toHaveTextContent( `The channel has a settlement delay of 86,400 seconds`, ) - expect(screen.getByTestId('cancel-line')).toBeNull() + expect(screen.queryByTestId('cancel-line')).toBeNull() }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx index c2125c4fd..4330870e7 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateSimple.test.tsx @@ -18,8 +18,8 @@ describe('PaymentChannelCreate: Simple', () => { afterEach(cleanup) it('renders', () => { renderComponent(mockPaymentChannelCreate) - expectSimpleRowLabel(screen, 'amount', 'Amount') - expectSimpleRowText(screen, 'amount', '\uE9001.00 XRP') + expectSimpleRowLabel(screen, 'channel-amount', 'Amount') + expectSimpleRowText(screen, 'channel-amount', '\uE9001.00 XRP') expectSimpleRowLabel(screen, 'source', 'source') expectSimpleRowText( screen, @@ -34,17 +34,17 @@ describe('PaymentChannelCreate: Simple', () => { ) expectSimpleRowLabel(screen, 'delay', 'Settlement Delay') expectSimpleRowText(screen, 'delay', '3,600 sec.') - expectSimpleRowLabel(screen, '.channel', 'Channel ID') + expectSimpleRowLabel(screen, 'channel', 'Channel ID') expectSimpleRowText( screen, - '.channel', + 'channel', '15AB9EE9344C42C05164E6A1F2F08B35F35D7B9D66CCB9697452B0995C8F8242', ) }) it('renders failed tx', () => { renderComponent(mockPaymentChannelCreateFailed) - expectSimpleRowText(screen, 'amount', '\uE90010.00 XRP') + expectSimpleRowText(screen, 'channel-amount', '\uE90010.00 XRP') expectSimpleRowText( screen, 'source', @@ -56,12 +56,12 @@ describe('PaymentChannelCreate: Simple', () => { 'rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) expectSimpleRowText(screen, 'delay', '3,600 sec.') - expectSimpleRowNotToExist(screen, '.channel') + expectSimpleRowNotToExist(screen, 'channel') }) it('renders tx with destination tag', () => { renderComponent(mockPaymentChannelCreateWithDestinationTag) - expectSimpleRowText(screen, 'amount', '\uE900100.00 XRP') + expectSimpleRowText(screen, 'channel-amount', '\uE900100.00 XRP') expectSimpleRowText(screen, 'source', 'rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH') expectSimpleRowText( screen, @@ -71,7 +71,7 @@ describe('PaymentChannelCreate: Simple', () => { expectSimpleRowText(screen, 'delay', '86,400 sec.') expectSimpleRowText( screen, - '.channel', + 'channel', '5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3', ) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx index 985051d69..2b16ad052 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelCreate/test/PaymentChannelCreateTableDetail.test.tsx @@ -19,7 +19,9 @@ describe('PaymentChannelCreate: TableDetail', () => { expect(screen.getByTestId('destination')).toHaveTextContent( 'destinationrUXYat4hW2M87gHoqKK7fC4cqrT9C6V7d7', ) - expect(screen.getByTestId('amount')).toHaveTextContent('\uE9001.00 XRP') + expect(screen.getByTestId('channel-amount')).toHaveTextContent( + 'channel amount\uE9001.00 XRP', + ) }) it('renders failed tx', () => { @@ -30,7 +32,9 @@ describe('PaymentChannelCreate: TableDetail', () => { expect(screen.getByTestId('destination')).toHaveTextContent( 'destinationrK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN', ) - expect(screen.getByTestId('amount')).toHaveTextContent('\uE90010.00 XRP') + expect(screen.getByTestId('channel-amount')).toHaveTextContent( + 'channel amount\uE90010.00 XRP', + ) }) it('renders tx with destination tag', () => { @@ -41,6 +45,8 @@ describe('PaymentChannelCreate: TableDetail', () => { expect(screen.getByTestId('destination')).toHaveTextContent( 'destinationrf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn:20170428', ) - expect(screen.getByTestId('amount')).toHaveTextContent('\uE900100.00 XRP') + expect(screen.getByTestId('channel-amount')).toHaveTextContent( + 'channel amount\uE900100.00 XRP', + ) }) }) diff --git a/src/containers/shared/components/Transaction/PaymentChannelFund/Simple.tsx b/src/containers/shared/components/Transaction/PaymentChannelFund/Simple.tsx index a1111c43c..f5773a0a0 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelFund/Simple.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelFund/Simple.tsx @@ -46,7 +46,11 @@ export const Simple = ({ )} {channel && ( - + {channel} )} diff --git a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx index 642a758c9..01d2f856f 100644 --- a/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx +++ b/src/containers/shared/components/Transaction/PaymentChannelFund/test/PaymentChannelFundSimple.test.tsx @@ -35,10 +35,10 @@ describe('PaymentChannelFund: Simple', () => { 'destination', 'rBFpf3YQQrcR1HnCt5AhYpNVvXUh4W89Dr', ) - expectSimpleRowLabel(screen, '.channel', 'Channel ID') + expectSimpleRowLabel(screen, 'channel', 'Channel ID') expectSimpleRowText( screen, - '.channel', + 'channel', '4BEAC9E4C10674AB698EAC0F2D78A4FF507428370578A59B04883E7EB8D82260', ) }) @@ -54,7 +54,7 @@ describe('PaymentChannelFund: Simple', () => { expectSimpleRowNotToExist(screen, 'source') expectSimpleRowText( screen, - '.channel', + 'channel', '933F93F7113A2F94B7838D64D0D2A244C57EFD6411C16FFF5FA293D200EF5876', ) }) diff --git a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx index 9eacc5253..c0d466e58 100644 --- a/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx +++ b/src/containers/shared/components/Transaction/UNLModify/test/UNLModifySimple.test.tsx @@ -50,7 +50,7 @@ describe('UNLModify: Simple', () => { /> , ) - expect(screen.getByTestId('account')).toBeNull() + expect(screen.queryByTestId('account')).toBeNull() expectSimpleRowLabel(screen, 'sequence', 'Sequence Number') expectSimpleRowText(screen, 'sequence', '0') }) diff --git a/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx index 4f807b8ec..ef34b9b1e 100644 --- a/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCommit/test/XChainCommitSimple.test.tsx @@ -30,7 +30,7 @@ describe('XChainCommitSimple', () => { expectSimpleRowText(screen, 'send', '\uE90010.00 XRP') expectSimpleRowText(screen, 'claim-id', '4') - expect(screen.getByTestId('destination')).toBeNull() + expect(screen.queryByTestId('destination')).toBeNull() }) it('renders failed tx', () => { diff --git a/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx index 4e9c190b0..41dbd8787 100644 --- a/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCreateBridge/test/XChainCreateBridgeSimple.test.tsx @@ -29,7 +29,7 @@ describe('XChainCreateBridgeSimple', () => { expectSimpleRowText(screen, 'issuing-chain-issue', '\uE900 XRP') expectSimpleRowText(screen, 'signature-reward', '\uE9000.0001 XRP') - expect(screen.getByTestId('min-create-account-amount')).toBeNull() + expect(screen.queryByTestId('min-create-account-amount')).toBeNull() }) it('renders IOU bridge', () => { diff --git a/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx b/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx index c104f76ad..cfbff5431 100644 --- a/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx +++ b/src/containers/shared/components/Transaction/XChainCreateClaimID/test/XChainCreateClaimIDSimple.test.tsx @@ -61,6 +61,6 @@ describe('XChainCreateClaimIDSimple', () => { 'other-chain-source', 'r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W', ) - expect(screen.getByTestId('claim-id')).toBeNull() + expect(screen.queryByTestId('claim-id')).toBeNull() }) }) From b580a2a7745f977f155b43b09bc9952e6b8b42a5 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 9 May 2024 12:47:26 -0400 Subject: [PATCH 17/55] fix stuff --- .../SetHook/test/SetHookSimple.test.tsx | 22 +++++++++---------- .../test/SetRegularKeySimple.test.tsx | 17 +++++++------- .../test/SetRegularKeyTableDetail.test.tsx | 15 +++++-------- .../components/Transaction/SimpleRow.tsx | 2 +- 4 files changed, 25 insertions(+), 31 deletions(-) diff --git a/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx b/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx index e79bd45eb..285aa497a 100644 --- a/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetHook/test/SetHookSimple.test.tsx @@ -13,10 +13,10 @@ describe('SetHook: Simple', () => { it('renders', () => { renderComponent(mockSetHook) - expect(screen.find('.group')).toHaveLength(2) + expect(screen.getAllByTestId('group')).toHaveLength(2) - const hook1 = screen.find('.group').at(0) - const hook2 = screen.find('.group').at(1) + const hook1 = screen.getAllByTestId('group')[0] + const hook2 = screen.getAllByTestId('group')[1] expectSimpleRowText( hook1, @@ -50,9 +50,9 @@ describe('SetHook: Simple', () => { it('renders a different SetHook tx', () => { renderComponent(mockSetHook2) - expect(screen.find('.group')).toHaveLength(1) + expect(screen.getAllByTestId('group')).toHaveLength(1) - const hook = screen.find('.group').at(0) + const hook = screen.getAllByTestId('group')[0] expectSimpleRowText( hook, @@ -62,13 +62,13 @@ describe('SetHook: Simple', () => { expect(hook.find('.grant')).toHaveLength(2) - const grant1 = hook.find('.grant').at(0) - const grant2 = hook.find('.grant').at(1) + const grant1 = hook.find('.grant')[0] + const grant2 = hook.find('.grant')[1] expect(grant1.find('.hash')).toHaveTextContent( '096A70632BBB67488F4804AE55604A01F52226BD556E3589270D0D30C9A6AF81', ) - expect(grant1.find('.account').at(0)).toHaveTextContent( + expect(grant1.find('.account')[0]).toHaveTextContent( 'rQUhXd7sopuga3taru3jfvc1BgVbscrb1X', ) expect(grant1.find(`.account a`)).toBeDefined() @@ -76,7 +76,7 @@ describe('SetHook: Simple', () => { expect(grant2.find('.hash')).toHaveTextContent( '3F47684053E1A653E54EAC1C5F50BCBAF7F69078CEFB5846BB046CE44B8ECDC2', ) - expect(grant2.find('.account').at(0)).toHaveTextContent( + expect(grant2.find('.account')[0]).toHaveTextContent( 'raPSFU999HcwpyRojdNh2i96T22gY9fgxL', ) expect(grant2.find(`.account a`)).toBeDefined() @@ -85,9 +85,9 @@ describe('SetHook: Simple', () => { it('renders a failed SetHook tx', () => { renderComponent(mockSetHookFailure) - expect(screen.find('.group')).toHaveLength(1) + expect(screen.getAllByTestId('group')).toHaveLength(1) - const hook = screen.find('.group').at(0) + const hook = screen.getAllByTestId('group')[0] expectSimpleRowText(hook, 'hook-hash', 'undefined') diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx index 0961280c1..4bd1a07b2 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeySimple.test.tsx @@ -2,8 +2,8 @@ import { cleanup, screen } from '@testing-library/react' import SetRegularKey from './mock_data/SetRegularKey.json' import SetRegularKeyUnset from './mock_data/SetRegularKeyUnsetKey.json' import { Simple } from '../Simple' -import { SimpleRow } from '../../SimpleRow' import { createSimpleRenderFactory } from '../../test/createRenderFactory' +import { expectSimpleRowLabel, expectSimpleRowText } from '../../test' const renderComponent = createSimpleRenderFactory(Simple) @@ -11,19 +11,18 @@ describe('SetRegularKey: Simple', () => { afterEach(cleanup) it('renders Simple for transaction', () => { renderComponent(SetRegularKey) - const keyRow = screen.find(SimpleRow) - - expect(keyRow.prop('label')).toBe(`regular_key`) - expect(keyRow.find('.value').text()).toBe( - `rULyyLRoZ47P33Vapew67VoiRqPrZ2ejbp`, + expectSimpleRowLabel(screen, 'regular_key', 'regular_key') + expectSimpleRowText( + screen, + 'regular_key', + 'rULyyLRoZ47P33Vapew67VoiRqPrZ2ejbp', ) }) it('renders Simple for transaction that unsets key', () => { renderComponent(SetRegularKeyUnset) - const keyRow = screen.find(SimpleRow) - expect(keyRow.prop('label')).toBe('') - expect(keyRow.find('.unset').hostNodes().text()).toBe(`unset_regular_key`) + expectSimpleRowLabel(screen, 'unset', 'unset') + expectSimpleRowText(screen, 'unset', 'unset_regular_key') }) }) diff --git a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx index aee61bfe9..bd7a3bdf6 100644 --- a/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/SetRegularKey/test/SetRegularKeyTableDetail.test.tsx @@ -1,4 +1,4 @@ -import { cleanup, screen } from '@testing-library/react' +import { cleanup } from '@testing-library/react' import SetRegularKey from './mock_data/SetRegularKey.json' import SetRegularKeyUnset from './mock_data/SetRegularKeyUnsetKey.json' import { TableDetail } from '../TableDetail' @@ -9,19 +9,14 @@ const renderComponent = createTableDetailRenderFactory(TableDetail) describe('SetRegularKeyTable: TableDetail', () => { afterEach(cleanup) it('renders Simple for transaction', () => { - renderComponent(SetRegularKey) + const { container } = renderComponent(SetRegularKey) - expect(screen.find('.setregularkey')).toBeDefined() - expect(screen.find('.label').text()).toBe(`regular_key`) - expect(screen.find('.key').text()).toBe( - `rULyyLRoZ47P33Vapew67VoiRqPrZ2ejbp`, - ) + expect(container).toHaveTextContent(`rULyyLRoZ47P33Vapew67VoiRqPrZ2ejbp`) }) it('renders Simple for transaction that unsets key', () => { - renderComponent(SetRegularKeyUnset) + const { container } = renderComponent(SetRegularKeyUnset) - expect(screen.find('.unset')).toBeDefined() - expect(screen.text()).toBe(`unset_regular_key`) + expect(container).toHaveTextContent(`unset_regular_key`) }) }) diff --git a/src/containers/shared/components/Transaction/SimpleRow.tsx b/src/containers/shared/components/Transaction/SimpleRow.tsx index e2f11500c..171d81163 100644 --- a/src/containers/shared/components/Transaction/SimpleRow.tsx +++ b/src/containers/shared/components/Transaction/SimpleRow.tsx @@ -10,7 +10,7 @@ export type SimpleRowProps = PropsWithChildren<{ export const SimpleRow = (props: SimpleRowProps) => { const { label, children, className, 'data-testid': testId } = props return ( -
    +
    {label}
    {children}
    From c3a97bd22e167bdda7e921b98b705e4e2180ee53 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 9 May 2024 12:52:55 -0400 Subject: [PATCH 18/55] fix signer list tests --- .../Transaction/SignerListSet/Description.tsx | 2 +- .../test/SignerListSetDescription.test.tsx | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/containers/shared/components/Transaction/SignerListSet/Description.tsx b/src/containers/shared/components/Transaction/SignerListSet/Description.tsx index 539cb4901..122d444de 100644 --- a/src/containers/shared/components/Transaction/SignerListSet/Description.tsx +++ b/src/containers/shared/components/Transaction/SignerListSet/Description.tsx @@ -17,7 +17,7 @@ export const Description = ({