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

B2CQA-2136 : Switching From and To currencies and perform a swap test #8715

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

stual-ledger
Copy link

βœ… Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • ...

πŸ“ Description

Replace this text by a clear and concise description of what this pull request is about and why it is needed. Be sure to explain the problem you're addressing and the solution you're proposing.
For libraries, you can add a code sample of how to use it.
For bug fixes, you can explain the previous behaviour and how it was fixed.
In case of visual features, please attach screenshots or video recordings to demonstrate the changes.

❓ Context

  • JIRA or GitHub link:

🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

Copy link

vercel bot commented Dec 17, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Dec 17, 2024 0:05am
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Dec 17, 2024 0:05am
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Dec 17, 2024 0:05am
web-tools ⬜️ Ignored (Inspect) Dec 17, 2024 0:05am

@live-github-bot live-github-bot bot added the desktop Has changes in LLD label Dec 17, 2024
Copy link
Contributor

github-actions bot commented Jan 2, 2025

There as been no activity on this PR for the last 14 days. Please consider closing this PR.

@github-actions github-actions bot added the Stale label Jan 2, 2025
@stual-ledger stual-ledger requested a review from VicAlbr January 7, 2025 08:17
@stual-ledger stual-ledger marked this pull request as ready for review January 7, 2025 08:18
@stual-ledger stual-ledger requested review from a team as code owners January 7, 2025 08:18
@@ -436,6 +501,28 @@ async function performSwapUntilQuoteSelectionStep(
await app.swap.fillInOriginCurrencyAmount(electronApp, swap.amount);
}

async function switchFromToCurrencySwap(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function should be about switching currencies in a swap but it does ton of other stuff (looks like a duplicate of performSwapUntilQuoteSelectionStep but with reverseSwapPair() as additional step)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, this method is used only once, so I don't see a utility of having separate method for this code

await app.swapDrawer.selectAccountByName(swap.accountToDebit);
await app.swap.selectAssetTo(electronApp, swap.accountToCredit.currency.name);
await app.swapDrawer.selectAccountByName(swap.accountToCredit);
await app.swap.reverseSwapPair();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function doesn't seem to verify that currencies have been inverted

},
];

for (const { swap, xrayTicket } of switchFromToSwaps) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need "for" loop here since you have only one element in switchFromToSwaps

@@ -436,6 +501,28 @@ async function performSwapUntilQuoteSelectionStep(
await app.swap.fillInOriginCurrencyAmount(electronApp, swap.amount);
}

async function switchFromToCurrencySwap(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, this method is used only once, so I don't see a utility of having separate method for this code

await addTmsLink(getDescription(test.info().annotations, "TMS").split(", "));
await switchFromToCurrencySwap(app, electronApp, swap);
await app.swap.selectQuote(electronApp, swap.provider.name, swap.rate);
await performSwapUntilDeviceVerificationStep(app, electronApp, swap);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I understand this test suppose to check that user is able to inverse "from" and "to" therefore I don't see the reason of doing full e2e swap scenario here

@github-actions github-actions bot closed this Jan 15, 2025
@stual-ledger stual-ledger reopened this Jan 15, 2025
@VicAlbr VicAlbr removed their request for review January 15, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop Has changes in LLD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants