aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorEsteban MIno <efmino@uc.cl>2018-07-04 03:24:23 +0800
committerEsteban MIno <efmino@uc.cl>2018-07-04 03:24:23 +0800
commit63b9c8796bf744f05a3b7d88319460eed772efa9 (patch)
treecf67bdb204f292a5f83049b78067135a15648ebd /test/unit
parent0494b2fc8a84a533227d25e869a95226f99734af (diff)
downloadtangerine-wallet-browser-63b9c8796bf744f05a3b7d88319460eed772efa9.tar.gz
tangerine-wallet-browser-63b9c8796bf744f05a3b7d88319460eed772efa9.tar.zst
tangerine-wallet-browser-63b9c8796bf744f05a3b7d88319460eed772efa9.zip
fix lint
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/app/controllers/detect-tokens-test.js100
1 files changed, 46 insertions, 54 deletions
diff --git a/test/unit/app/controllers/detect-tokens-test.js b/test/unit/app/controllers/detect-tokens-test.js
index f9f5c902d..82e86bfcc 100644
--- a/test/unit/app/controllers/detect-tokens-test.js
+++ b/test/unit/app/controllers/detect-tokens-test.js
@@ -13,89 +13,81 @@ describe('DetectTokensController', () => {
})
it('should not check tokens while in test network', async () => {
- var network = new ObservableStore({provider: {type:'rinkeby'}})
+ var network = new ObservableStore({provider: {type: 'rinkeby'}})
const preferences = new PreferencesController()
const controller = new DetectTokensController({preferences: preferences, network: network})
controller.isActive = true
controller.contracts = {
- "0x0D262e5dC4A06a0F1c90cE79C7a60C09DfC884E4": {
- "name": "JET8 Token",
- "logo": "J8T.svg",
- "erc20": true,
- "symbol": "J8T",
- "decimals": 8
+ '0x0D262e5dC4A06a0F1c90cE79C7a60C09DfC884E4': {
+ 'name': 'JET8 Token',
+ 'logo': 'J8T.svg',
+ 'erc20': true,
+ 'symbol': 'J8T',
+ 'decimals': 8,
+ },
+ '0xBC86727E770de68B1060C91f6BB6945c73e10388': {
+ 'name': 'Ink Protocol',
+ 'logo': 'ink_protocol.svg',
+ 'erc20': true,
+ 'symbol': 'XNK',
+ 'decimals': 18,
},
- "0xBC86727E770de68B1060C91f6BB6945c73e10388": {
- "name": "Ink Protocol",
- "logo": "ink_protocol.svg",
- "erc20": true,
- "symbol": "XNK",
- "decimals": 18
- }
}
controller.fetchContractAccountBalance = address => address
-
await controller.exploreNewTokens()
assert.deepEqual(preferences.store.getState().tokens, [])
-
- })
+})
it('should only check and add tokens while in main network', async () => {
- const network = new ObservableStore({provider: {type:'mainnet'}})
+ const network = new ObservableStore({provider: {type: 'mainnet'}})
const preferences = new PreferencesController()
const controller = new DetectTokensController({preferences: preferences, network: network})
controller.isActive = true
controller.contracts = {
- "0x0D262e5dC4A06a0F1c90cE79C7a60C09DfC884E4": {
- "name": "JET8 Token",
- "logo": "J8T.svg",
- "erc20": true,
- "symbol": "J8T",
- "decimals": 8
+ '0x0D262e5dC4A06a0F1c90cE79C7a60C09DfC884E4': {
+ 'name': 'JET8 Token',
+ 'logo': 'J8T.svg',
+ 'erc20': true,
+ 'symbol': 'J8T',
+ 'decimals': 8,
+ },
+ '0xBC86727E770de68B1060C91f6BB6945c73e10388': {
+ 'name': 'Ink Protocol',
+ 'logo': 'ink_protocol.svg',
+ 'erc20': true,
+ 'symbol': 'XNK',
+ 'decimals': 18,
},
- "0xBC86727E770de68B1060C91f6BB6945c73e10388": {
- "name": "Ink Protocol",
- "logo": "ink_protocol.svg",
- "erc20": true,
- "symbol": "XNK",
- "decimals": 18
- }
}
controller.fetchContractAccountBalance = address => address
-
await controller.exploreNewTokens()
- assert.deepEqual(preferences.store.getState().tokens,
- [{address: "0x0d262e5dc4a06a0f1c90ce79c7a60c09dfc884e4", decimals: 8, symbol: "J8T"},
- {address: "0xbc86727e770de68b1060c91f6bb6945c73e10388", decimals: 18, symbol: "XNK"}])
+ assert.deepEqual(preferences.store.getState().tokens, [{address: '0x0d262e5dc4a06a0f1c90ce79c7a60c09dfc884e4', decimals: 8, symbol: 'J8T'}, {address: '0xbc86727e770de68b1060c91f6bb6945c73e10388', decimals: 18, symbol: 'XNK'}])
})
it('should not detect same token while in main network', async () => {
- const network = new ObservableStore({provider: {type:'mainnet'}})
+ const network = new ObservableStore({provider: {type: 'mainnet'}})
const preferences = new PreferencesController()
- preferences.addToken("0x0d262e5dc4a06a0f1c90ce79c7a60c09dfc884e4", 8, "J8T")
+ preferences.addToken('0x0d262e5dc4a06a0f1c90ce79c7a60c09dfc884e4', 8, 'J8T')
const controller = new DetectTokensController({preferences: preferences, network: network})
controller.isActive = true
controller.contracts = {
- "0x0D262e5dC4A06a0F1c90cE79C7a60C09DfC884E4": {
- "name": "JET8 Token",
- "logo": "J8T.svg",
- "erc20": true,
- "symbol": "J8T",
- "decimals": 8
+ '0x0D262e5dC4A06a0F1c90cE79C7a60C09DfC884E4': {
+ 'name': 'JET8 Token',
+ 'logo': 'J8T.svg',
+ 'erc20': true,
+ 'symbol': 'J8T',
+ 'decimals': 8,
+ },
+ '0xBC86727E770de68B1060C91f6BB6945c73e10388': {
+ 'name': 'Ink Protocol',
+ 'logo': 'ink_protocol.svg',
+ 'erc20': true,
+ 'symbol': 'XNK',
+ 'decimals': 18,
},
- "0xBC86727E770de68B1060C91f6BB6945c73e10388": {
- "name": "Ink Protocol",
- "logo": "ink_protocol.svg",
- "erc20": true,
- "symbol": "XNK",
- "decimals": 18
- }
}
controller.fetchContractAccountBalance = address => address
-
await controller.exploreNewTokens()
- assert.deepEqual(preferences.store.getState().tokens,
- [{address: "0x0d262e5dc4a06a0f1c90ce79c7a60c09dfc884e4", decimals: 8, symbol: "J8T"},
- {address: "0xbc86727e770de68b1060c91f6bb6945c73e10388", decimals: 18, symbol: "XNK"}])
+ assert.deepEqual(preferences.store.getState().tokens, [{address: '0x0d262e5dc4a06a0f1c90ce79c7a60c09dfc884e4', decimals: 8, symbol: 'J8T'}, {address: '0xbc86727e770de68b1060c91f6bb6945c73e10388', decimals: 18, symbol: 'XNK'}])
})
})