Skip to content

Commit

Permalink
fix: swap offer output (#971)
Browse files Browse the repository at this point in the history
## 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

<!--
If just refactoring / back-end changes, this can be just an in-English
description of the change at a technical level.
If a UI change, screenshots should be included.
-->

## Test Plan

Tests were fixed accordingly to accurately represent what they should.
  • Loading branch information
mvadari authored Apr 11, 2024
1 parent 8306e95 commit ed39da6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ const Simple: TransactionSimpleComponent = (props: TransactionSimpleProps) => {
</div>
</SimpleRow>
<SimpleRow label={t('buy')} data-test="amount-buy">
<Amount value={gets} />
<Amount value={pays} />
</SimpleRow>
<SimpleRow label={t('sell')} data-test="amount-sell">
<Amount value={pays} />
<Amount value={gets} />
</SimpleRow>
{cancel && (
<SimpleRow label={t('cancel_offer')} data-test="cancel-id">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ export const TableDetail = (props: any) => {
</div>
<div>
<span className="label">{t('buy')}</span>
<Amount value={gets} data-test="amount-buy" />
<Amount value={pays} data-test="amount-buy" />
</div>
<div>
<span className="label">{t('sell')}</span>
<Amount value={pays} data-test="amount-sell" />
<Amount value={gets} data-test="amount-sell" />
</div>
{cancel && (
<div className="cancel" data-test="cancel-id">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand All @@ -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`,
)
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand All @@ -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`,
)
})

Expand Down

0 comments on commit ed39da6

Please sign in to comment.