Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: swap offer output #971

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading