2019-05-08 20:57:21 +02:00
|
|
|
import assert from 'assert'
|
|
|
|
import { mapStateToProps, mapDispatchToProps } from '../advanced-tab.container'
|
|
|
|
|
|
|
|
const defaultState = {
|
|
|
|
appState: {
|
|
|
|
warning: null,
|
|
|
|
},
|
|
|
|
metamask: {
|
|
|
|
featureFlags: {
|
|
|
|
sendHexData: false,
|
|
|
|
advancedInlineGas: false,
|
|
|
|
},
|
|
|
|
preferences: {
|
|
|
|
autoLogoutTimeLimit: 0,
|
|
|
|
showFiatInTestnets: false,
|
|
|
|
useNativeCurrencyAsPrimaryCurrency: true,
|
|
|
|
},
|
2019-09-16 19:11:01 +02:00
|
|
|
threeBoxSyncingAllowed: false,
|
|
|
|
threeBoxDisabled: false,
|
2019-09-27 06:30:36 +02:00
|
|
|
useNonceField: false,
|
2019-05-08 20:57:21 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
describe('AdvancedTab Container', () => {
|
|
|
|
it('should map state to props correctly', () => {
|
|
|
|
const props = mapStateToProps(defaultState)
|
|
|
|
const expected = {
|
|
|
|
warning: null,
|
|
|
|
sendHexData: false,
|
|
|
|
advancedInlineGas: false,
|
|
|
|
showFiatInTestnets: false,
|
|
|
|
autoLogoutTimeLimit: 0,
|
2019-09-16 19:11:01 +02:00
|
|
|
threeBoxSyncingAllowed: false,
|
|
|
|
threeBoxDisabled: false,
|
2019-09-27 06:30:36 +02:00
|
|
|
useNonceField: false,
|
2019-05-08 20:57:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
assert.deepEqual(props, expected)
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should map dispatch to props correctly', () => {
|
|
|
|
const props = mapDispatchToProps(() => 'mockDispatch')
|
|
|
|
|
2019-07-31 22:17:11 +02:00
|
|
|
assert.ok(typeof props.setHexDataFeatureFlag === 'function')
|
|
|
|
assert.ok(typeof props.setRpcTarget === 'function')
|
|
|
|
assert.ok(typeof props.displayWarning === 'function')
|
|
|
|
assert.ok(typeof props.showResetAccountConfirmationModal === 'function')
|
|
|
|
assert.ok(typeof props.setAdvancedInlineGasFeatureFlag === 'function')
|
|
|
|
assert.ok(typeof props.setShowFiatConversionOnTestnetsPreference === 'function')
|
|
|
|
assert.ok(typeof props.setAutoLogoutTimeLimit === 'function')
|
2019-09-27 06:30:36 +02:00
|
|
|
assert.ok(typeof props.setUseNonceField === 'function')
|
2019-05-08 20:57:21 +02:00
|
|
|
})
|
|
|
|
})
|