-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
only add custom tokens if not in mainnet (#2470)
* checkchainid * tests
- Loading branch information
1 parent
b4c82e6
commit 57ba915
Showing
2 changed files
with
40 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,27 @@ | ||
import React from 'react'; | ||
import configureMockStore from 'redux-mock-store'; | ||
import { shallow } from 'enzyme'; | ||
import AddAsset from './'; | ||
|
||
const mockStore = configureMockStore(); | ||
|
||
describe('AddAsset', () => { | ||
it('should render correctly', () => { | ||
const wrapper = shallow(<AddAsset navigation={{ state: { params: { assetType: 'token' } } }} />); | ||
expect(wrapper).toMatchSnapshot(); | ||
const initialState = { | ||
engine: { | ||
backgroundState: { | ||
NetworkController: { | ||
provider: { | ||
chainId: '1' | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
const wrapper = shallow(<AddAsset navigation={{ state: { params: { assetType: 'token' } } }} />, { | ||
context: { store: mockStore(initialState) } | ||
}); | ||
expect(wrapper.dive()).toMatchSnapshot(); | ||
}); | ||
}); |