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

Feat/suite desktop core/invity mock for tests #16429

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Vere-Grey
Copy link
Contributor

Description

Setups invity mocking for buy test. So far only web is working. I will work on desktop as next step

Related Issue

Resolve 15606, #16041

@Vere-Grey Vere-Grey requested a review from HajekOndrej January 16, 2025 20:47
@Vere-Grey Vere-Grey self-assigned this Jan 16, 2025
Copy link
Contributor Author

Choose a reason for hiding this comment

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

At this stage, I just copy pasted the responses from the life invity API.
Once we have first tests for buy, sell and exchange, we will optimize and slim down these files. Because then we will know what we need and don't.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hurray, Mocked API means we will always have same results. No need of masking that was anyway flaky.

Comment on lines +11 to +12
const quoteProviderLocator = '@coinmarket/offers/quote/provider';
const quoteAmountLocator = '@coinmarket/offers/quote/crypto-amount';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't like this approach, but I could not find better way.
I need to do a locator chaining and for some reason
this.page.getByTestId('@coinmarket/offers/quote').and(this.page.getByTestId('@coinmarket/offers/quote/provider')) didnt work for me and I had to use:

this.page.getByTestId('@coinmarket/offers/quote').getByTestId('@coinmarket/offers/quote/provider')

So i pulled '@coinmarket/offers/quote/provider' to a const definition so it woudn't be once in constructor and once in method validateBuyQuotes

@Vere-Grey Vere-Grey force-pushed the feat/suite-desktop-core/invity-mock-for-tests branch 2 times, most recently from 66aef75 to c223236 Compare January 17, 2025 15:31
@Vere-Grey Vere-Grey force-pushed the feat/suite-desktop-core/invity-mock-for-tests branch from c223236 to e7a18da Compare January 18, 2025 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant