From ed39da66ec87a5a1d7db0fb2232cf2c03aa66e97 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 11 Apr 2024 17:55:08 +0100 Subject: [PATCH] fix: swap offer output (#971) ## High Level Overview of Change The buys and sells were flipped. ### Context of Change They were flipped in #179. ### Type of Change - [x] Bug fix (non-breaking change which fixes an issue) ### TypeScript/Hooks Update N/A ## Before / After ## Test Plan Tests were fixed accordingly to accurately represent what they should. --- .../shared/components/Transaction/OfferCreate/Simple.tsx | 4 ++-- .../components/Transaction/OfferCreate/TableDetail.tsx | 4 ++-- .../OfferCreate/test/OfferCreateSimple.test.tsx | 8 ++++---- .../OfferCreate/test/OfferCreateTableDetail.test.tsx | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/containers/shared/components/Transaction/OfferCreate/Simple.tsx b/src/containers/shared/components/Transaction/OfferCreate/Simple.tsx index 05c534059..c220c9b95 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/Simple.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/Simple.tsx @@ -31,10 +31,10 @@ const Simple: TransactionSimpleComponent = (props: TransactionSimpleProps) => { - + - + {cancel && ( diff --git a/src/containers/shared/components/Transaction/OfferCreate/TableDetail.tsx b/src/containers/shared/components/Transaction/OfferCreate/TableDetail.tsx index 84a1815f4..c42719ab9 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/TableDetail.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/TableDetail.tsx @@ -30,11 +30,11 @@ export const TableDetail = (props: any) => {
{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 248c7b7aa..13c006b28 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateSimple.test.tsx @@ -15,10 +15,10 @@ describe('OfferCreate: Simple', () => { '#44866443', ) expect(wrapper.find('[data-test="amount-buy"] .value')).toHaveText( - `1,080,661.95882 CSC.rCSCManTZ8ME9EoLrSHHYKW8PPwWMgkwr`, + `\uE9001,764.293151 XRP`, ) expect(wrapper.find('[data-test="amount-sell"] .value')).toHaveText( - `\uE9001,764.293151 XRP`, + `1,080,661.95882 CSC.rCSCManTZ8ME9EoLrSHHYKW8PPwWMgkwr`, ) wrapper.unmount() }) @@ -28,10 +28,10 @@ describe('OfferCreate: Simple', () => { expect(wrapper.find('[data-test="offer-id"] .value')).not.toExist() expect(wrapper.find('[data-test="amount-buy"] .value')).toHaveText( - `51.41523894 BCH.rcyS4CeCZVYvTiKcxj6Sx32ibKwcDHLds`, + `\uE90024,755.081083 XRP`, ) expect(wrapper.find('[data-test="amount-sell"] .value')).toHaveText( - `\uE90024,755.081083 XRP`, + `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 e8646a2f1..45e2b6f17 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateTableDetail.test.tsx @@ -17,10 +17,10 @@ describe('OfferCreate: TableDetail', () => { 'cancel_offer #44866443', ) expect(wrapper.find('[data-test="amount-buy"]')).toHaveText( - `1,080,661.95882 CSC.rCSCManTZ8ME9EoLrSHHYKW8PPwWMgkwr`, + `\uE9001,764.293151 XRP`, ) expect(wrapper.find('[data-test="amount-sell"]')).toHaveText( - `\uE9001,764.293151 XRP`, + `1,080,661.95882 CSC.rCSCManTZ8ME9EoLrSHHYKW8PPwWMgkwr`, ) wrapper.unmount() }) @@ -33,10 +33,10 @@ describe('OfferCreate: TableDetail', () => { ) expect(wrapper.find('[data-test="offer-id"]')).not.toExist() expect(wrapper.find('[data-test="amount-buy"]')).toHaveText( - `51.41523894 BCH.rcyS4CeCZVYvTiKcxj6Sx32ibKwcDHLds`, + `\uE90024,755.081083 XRP`, ) expect(wrapper.find('[data-test="amount-sell"]')).toHaveText( - `\uE90024,755.081083 XRP`, + `51.41523894 BCH.rcyS4CeCZVYvTiKcxj6Sx32ibKwcDHLds`, ) })