Skip to content

Commit

Permalink
test(ramps): fixes btc native token test (#27601)
Browse files Browse the repository at this point in the history
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

The ramps ducks test incorrectly tested for BTC as a native asset. This
scenario is not possible and should not have been tested. Bitcoin
doesn't use the NetworkController, so BTC cannot be passed to the
`getCurrentChainIdMock`.


[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27601?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
  • Loading branch information
georgeweiler authored Oct 29, 2024
1 parent f6b9e79 commit 6b321c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/ducks/ramps/ramps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ describe('rampsSlice', () => {
});

it('should return true when Bitcoin is buyable and current chain is Bitcoin', () => {
getCurrentChainIdMock.mockReturnValue(MultichainNetworks.BITCOIN);
getCurrentChainIdMock.mockReturnValue(CHAIN_IDS.MAINNET);
getMultichainIsBitcoinMock.mockReturnValue(true);
const mockBuyableChains = [
{ chainId: MultichainNetworks.BITCOIN, active: true },
Expand All @@ -219,7 +219,7 @@ describe('rampsSlice', () => {
});

it('should return false when Bitcoin is not buyable and current chain is Bitcoin', () => {
getCurrentChainIdMock.mockReturnValue(MultichainNetworks.BITCOIN);
getCurrentChainIdMock.mockReturnValue(CHAIN_IDS.MAINNET);
getMultichainIsBitcoinMock.mockReturnValue(true);
const mockBuyableChains = [
{ chainId: MultichainNetworks.BITCOIN, active: false },
Expand Down

0 comments on commit 6b321c8

Please sign in to comment.