@@ -102,12 +103,12 @@ class Setting extends React.Component {
: null
}
- {/* TODO: will be re-enabled when the functionality is updated
{!hasSecondPassphrase ?
+ to={`${routes.main.path}${routes.secondPassphrase.path}`}
+ onClick={toggleMenu}>
{t('Add')}
:
{t('Register 2nd passphrase')}
+ {/* TODO: will be re-enabled when the functionality is updated
+ {/* TODO: will be re-enabled when the functionality is updated
- {[...Array(this.showOnboardingSetting() ? 3 : 2)].map((x, i) =>
+ {[...Array(this.showOnboardingSetting() ? 4 : 3)].map((x, i) =>
- {
accountUpdated: sinon.spy(),
settings,
t,
- menuToggle: sinon.spy(),
+ toggleMenu: sinon.spy(),
startOnboarding: sinon.spy(),
isAuthenticated: true,
};
@@ -59,10 +60,11 @@ describe('Setting', () => {
beforeEach(() => {
window.innerWidth = breakpoints.l;
- wrapper = mount(
+ wrapper = mount(
, options);
+ {...props}/>
+ , options);
clock = sinon.useFakeTimers({
toFake: ['setTimeout', 'clearTimeout', 'Date', 'setInterval'],
@@ -92,22 +94,30 @@ describe('Setting', () => {
});
it('should show the onboarding setting when authenticated and not on mobile', () => {
- expect(wrapper.find('#carouselNav li')).to.have.length(3);
+ expect(wrapper.find('#carouselNav li')).to.have.length(4);
wrapper.find('button').props().onClick();
- expect(props.menuToggle).to.have.been.calledWith();
+ expect(props.toggleMenu).to.have.been.calledWith();
expect(props.startOnboarding).to.have.been.calledWith();
});
it('should not show the onboarding setting when on mobile', () => {
window.innerWidth = breakpoints.m;
- wrapper = mount(, options);
- expect(wrapper.find('#carouselNav li')).to.have.length(2);
+ wrapper = mount(
+
+ , options);
+ expect(wrapper.find('#carouselNav li')).to.have.length(3);
});
it('should not show the onboarding setting when not authenticated', () => {
props.isAuthenticated = false;
- wrapper = mount(, options);
- expect(wrapper.find('#carouselNav li')).to.have.length(2);
+ wrapper = mount(
+
+ , options);
+ expect(wrapper.find('#carouselNav li')).to.have.length(3);
});
it.skip('should click on .autoLog update the setting', () => {
@@ -137,8 +147,14 @@ describe('Setting', () => {
const settingsToExpireTime = { ...settings };
settingsToExpireTime.autoLog = false;
accountToExpireTime.passphrase = accounts.genesis.passphrase;
- wrapper.setProps({ account: accountToExpireTime, settings: settingsToExpireTime });
- wrapper.update();
+ wrapper = mount(
+
+ , options);
wrapper.find('.autoLog').at(0).find('input').simulate('change', { target: { checked: true, value: true } });
clock.tick(300);