mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
0ef7f603d6
add ipfs gateway to advanced settings use ipfs gateway from settings use ipfs.dweb.link as default CID gateway disallow gateway.ipfs.io as gateway
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
import React from 'react'
|
|
import assert from 'assert'
|
|
import sinon from 'sinon'
|
|
import { shallow } from 'enzyme'
|
|
import AdvancedTab from '../advanced-tab.component'
|
|
import TextField from '../../../../components/ui/text-field'
|
|
|
|
describe('AdvancedTab Component', () => {
|
|
it('should render correctly when threeBoxFeatureFlag', () => {
|
|
const root = shallow(
|
|
<AdvancedTab />,
|
|
{
|
|
context: {
|
|
t: s => `_${s}`,
|
|
},
|
|
}
|
|
)
|
|
|
|
assert.equal(root.find('.settings-page__content-row').length, 10)
|
|
})
|
|
|
|
it('should update autoLogoutTimeLimit', () => {
|
|
const setAutoLogoutTimeLimitSpy = sinon.spy()
|
|
const root = shallow(
|
|
<AdvancedTab
|
|
setAutoLogoutTimeLimit={setAutoLogoutTimeLimitSpy}
|
|
/>,
|
|
{
|
|
context: {
|
|
t: s => `_${s}`,
|
|
},
|
|
}
|
|
)
|
|
|
|
const autoTimeout = root.find('.settings-page__content-row').at(7)
|
|
const textField = autoTimeout.find(TextField)
|
|
|
|
textField.props().onChange({ target: { value: 1440 } })
|
|
assert.equal(root.state().autoLogoutTimeLimit, 1440)
|
|
|
|
autoTimeout.find('.settings-tab__rpc-save-button').simulate('click')
|
|
assert.equal(setAutoLogoutTimeLimitSpy.args[0][0], 1440)
|
|
})
|
|
})
|