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

refactor(earn): check allow X chain swaps gate when showing deposit options #6389

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

satish-ravi
Copy link
Contributor

Description

Currently, cross chain swaps show up even if the cross chain swaps gate is off. This updates the before deposit bottom sheet to check for the gate before showing the cross chain swap option. Also simplified the booleans a bit to make it more readable and added more thorough tests

Test plan

Unit tests

Related issues

Backwards compatibility

Yes

Network scalability

N/A

@satish-ravi satish-ravi force-pushed the satish/act-1507-deposit-entrypoint-tests branch from 792724d to 12fd317 Compare December 23, 2024 21:25
expect(getByTestId('Earn/ActionCard/Add')).toBeTruthy()
expect(getByTestId('Earn/ActionCard/Transfer')).toBeTruthy()
})
it.each`
Copy link
Contributor Author

@satish-ravi satish-ravi Dec 23, 2024

Choose a reason for hiding this comment

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

These are a LOT, but much more thorough. This is based on the table here (the table is out of date, beefy pool doesn't support Buy, which is replaced with Transfer).

This should get simpler with cross chain swap and deposit as the number of variants reduce significantly as we don't need to differentiate between having tokens on same chain or different chain.

Comment on lines -36 to -37
expect(getByTestId('Earn/ActionCard/Deposit')).toBeTruthy()
expect(getByTestId('Earn/ActionCard/AddMore')).toBeTruthy()
Copy link
Contributor Author

@satish-ravi satish-ravi Dec 23, 2024

Choose a reason for hiding this comment

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

these tests were only asserting for presence, which means if the code returns all actions for all variations, all tests will pass 😅

Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.05%. Comparing base (4058c6e) to head (12fd317).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6389      +/-   ##
==========================================
+ Coverage   89.04%   89.05%   +0.01%     
==========================================
  Files         735      735              
  Lines       31345    31350       +5     
  Branches     5818     5823       +5     
==========================================
+ Hits        27910    27918       +8     
- Misses       3241     3386     +145     
+ Partials      194       46     -148     
Files with missing lines Coverage Δ
...c/earn/poolInfoScreen/BeforeDepositBottomSheet.tsx 100.00% <100.00%> (ø)

... and 67 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4058c6e...12fd317. Read the comment docs.

@satish-ravi satish-ravi changed the title refactor(earn): honor allow X chain swaps gate when showing deposit options refactor(earn): check allow X chain swaps gate when showing deposit options Dec 23, 2024
@satish-ravi satish-ravi added this pull request to the merge queue Dec 23, 2024
Merged via the queue into main with commit 8891d00 Dec 23, 2024
16 checks passed
@satish-ravi satish-ravi deleted the satish/act-1507-deposit-entrypoint-tests branch December 23, 2024 22:33
sviderock pushed a commit that referenced this pull request Jan 2, 2025
…ptions (#6389)

### Description

Currently, cross chain swaps show up even if the cross chain swaps gate
is off. This updates the before deposit bottom sheet to check for the
gate before showing the cross chain swap option. Also simplified the
booleans a bit to make it more readable and added more thorough tests

### Test plan

Unit tests

### Related issues

- Part of ACT-1507

### Backwards compatibility

Yes

### Network scalability

N/A
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.

2 participants