You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.1 KiB
65 lines
2.1 KiB
import React from 'react';
|
|
import sinon from 'sinon';
|
|
import { shallow } from 'enzyme';
|
|
import TextField from '../../../components/ui/text-field';
|
|
import AdvancedTab from './advanced-tab.component';
|
|
|
|
describe('AdvancedTab Component', () => {
|
|
it('should render correctly when threeBoxFeatureFlag', () => {
|
|
const root = shallow(
|
|
<AdvancedTab
|
|
ipfsGateway=""
|
|
setAutoLockTimeLimit={() => undefined}
|
|
setIpfsGateway={() => undefined}
|
|
setShowFiatConversionOnTestnetsPreference={() => undefined}
|
|
setThreeBoxSyncingPermission={() => undefined}
|
|
threeBoxDisabled
|
|
threeBoxSyncingAllowed={false}
|
|
useLedgerLive={false}
|
|
setLedgerLivePreference={() => undefined}
|
|
setDismissSeedBackUpReminder={() => undefined}
|
|
dismissSeedBackUpReminder={false}
|
|
/>,
|
|
{
|
|
context: {
|
|
t: (s) => `_${s}`,
|
|
},
|
|
},
|
|
);
|
|
|
|
expect(root.find('.settings-page__content-row')).toHaveLength(12);
|
|
});
|
|
|
|
it('should update autoLockTimeLimit', () => {
|
|
const setAutoLockTimeLimitSpy = sinon.spy();
|
|
const root = shallow(
|
|
<AdvancedTab
|
|
ipfsGateway=""
|
|
setAutoLockTimeLimit={setAutoLockTimeLimitSpy}
|
|
setIpfsGateway={() => undefined}
|
|
setShowFiatConversionOnTestnetsPreference={() => undefined}
|
|
setThreeBoxSyncingPermission={() => undefined}
|
|
threeBoxDisabled
|
|
threeBoxSyncingAllowed={false}
|
|
useLedgerLive={false}
|
|
setLedgerLivePreference={() => undefined}
|
|
setDismissSeedBackUpReminder={() => undefined}
|
|
dismissSeedBackUpReminder={false}
|
|
/>,
|
|
{
|
|
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 } });
|
|
expect(root.state().autoLockTimeLimit).toStrictEqual(1440);
|
|
|
|
autoTimeout.find('.settings-tab__rpc-save-button').simulate('click');
|
|
expect(setAutoLockTimeLimitSpy.args[0][0]).toStrictEqual(1440);
|
|
});
|
|
});
|
|
|