1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-26 05:13:37 +02:00
metamask-extension/ui/app/pages/settings/advanced-tab/tests/advanced-tab-container.test.js
Dan J Miller 970e90ea70
Add migration on 3box imports and remove feature flag (#7209)
* Delete unused code

* Run threebox imports through migrations

* Remove 3box feature flag

* Remove unnecessary use of 'type' in threebox._updatePlugin

* Fix threebox controller getLastUpdated

* Turn off threebox by default

* Rename restoredFromThreeBox to showRestorePrompt

* Remove accientally added method from threebox controller

* Restore from threebox on import from unlock screen

* Throw on non 404 errors from Box.getconfig in new3Box
2019-09-26 03:24:52 -04:00

51 lines
1.5 KiB
JavaScript

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,
},
threeBoxSyncingAllowed: false,
threeBoxDisabled: false,
},
}
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,
threeBoxSyncingAllowed: false,
threeBoxDisabled: false,
}
assert.deepEqual(props, expected)
})
it('should map dispatch to props correctly', () => {
const props = mapDispatchToProps(() => 'mockDispatch')
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')
})
})