From c9eb37a2778ab51be044cfce1115bc93d7b9d955 Mon Sep 17 00:00:00 2001 From: Vit Stanislav Date: Wed, 17 Jan 2018 08:22:57 +0100 Subject: [PATCH] Hide unfinished UI elements - Closes #206 --- src/components/header/header.js | 7 ------- src/components/header/header.test.js | 4 ++-- src/components/mainMenu/index.test.js | 4 ++-- src/components/mainMenu/mainMenu.js | 4 ++++ src/components/mainMenu/mainMenu.test.js | 9 +++++---- src/components/setting/setting.js | 7 +++---- src/components/setting/setting.test.js | 6 ++++-- test/e2e/forging.feature | 2 +- test/e2e/registerDelegate.feature | 8 ++++---- test/e2e/registerSecondPassphrase.feature | 22 ++++++---------------- test/e2e/settings.feature | 2 ++ 11 files changed, 33 insertions(+), 42 deletions(-) diff --git a/src/components/header/header.js b/src/components/header/header.js index 60085d0d48e..aa52e5cf036 100644 --- a/src/components/header/header.js +++ b/src/components/header/header.js @@ -49,13 +49,6 @@ const Header = props => ( menuRipple theme={styles} > - { - !props.account.isDelegate && - - {props.t('Register as delegate')} - - } {props.t('Sign message')} diff --git a/src/components/header/header.test.js b/src/components/header/header.test.js index 7892ee32383..7aa7299a515 100644 --- a/src/components/header/header.test.js +++ b/src/components/header/header.test.js @@ -38,7 +38,7 @@ describe('Header', () => { propsMock.restore(); }); - it('renders 9 RelativeLink components', () => { - expect(wrapper.find(RelativeLink)).to.have.length(7); + it('renders 6 RelativeLink components', () => { + expect(wrapper.find(RelativeLink)).to.have.length(6); }); }); diff --git a/src/components/mainMenu/index.test.js b/src/components/mainMenu/index.test.js index 14f0ef669cf..2585773c47c 100644 --- a/src/components/mainMenu/index.test.js +++ b/src/components/mainMenu/index.test.js @@ -49,7 +49,7 @@ describe('MainMenuHOC', () => { expect(wrapper.find('MainMenu')).to.have.lengthOf(1); }); - it('should mount 7 Tab inside MainMenu', () => { - expect(wrapper.find('Tab')).to.have.lengthOf(6); + it('should mount 5 Tab inside MainMenu', () => { + expect(wrapper.find('Tab')).to.have.lengthOf(5); }); }); diff --git a/src/components/mainMenu/mainMenu.js b/src/components/mainMenu/mainMenu.js index c7cc23774ba..6c603ab9c0d 100644 --- a/src/components/mainMenu/mainMenu.js +++ b/src/components/mainMenu/mainMenu.js @@ -55,18 +55,22 @@ class MainMenu extends React.Component { id: 'transactions', image: menuLogos.wallet, }, { + /* TODO: uncomment when the page is updated label: t('Buy Lisk'), id: 'butLisk', image: menuLogos.buyLisk, }, { + */ label: t('Delegates'), id: 'voting', image: menuLogos.delegates, }, { + /* TODO: uncomment when the page is updated label: t('Forging'), id: 'forging', image: menuLogos.sidechains, }, { + */ label: t('Sidechains'), id: 'sidechains', image: menuLogos.sidechains, diff --git a/src/components/mainMenu/mainMenu.test.js b/src/components/mainMenu/mainMenu.test.js index b130979601e..dec39ab0064 100644 --- a/src/components/mainMenu/mainMenu.test.js +++ b/src/components/mainMenu/mainMenu.test.js @@ -72,18 +72,19 @@ describe('MainMenu', () => { expect(wrapper.find(ToolboxTabs).exists()).to.equal(true); }); - it('should render 8 Button components if props.isDelegate', () => { + // TODO: re-enable if the functionality is re-enabled + it.skip('should render 6 Button components if props.isDelegate', () => { const wrapper = mount( , options); - expect(wrapper.find(Tab)).to.have.lengthOf(7); + expect(wrapper.find(Tab)).to.have.lengthOf(6); }); - it('should render 7 menu item components if !props.isDelegate', () => { + it('should render 5 menu item components if !props.isDelegate', () => { const wrapper = mount( , options); - expect(wrapper.find(Tab)).to.have.lengthOf(6); + expect(wrapper.find(Tab)).to.have.lengthOf(5); }); it('should allow to change active menu item', () => { diff --git a/src/components/setting/setting.js b/src/components/setting/setting.js index 0883ee79782..45cbf6e369d 100644 --- a/src/components/setting/setting.js +++ b/src/components/setting/setting.js @@ -1,12 +1,9 @@ import React from 'react'; import ReactSwipe from 'react-swipe'; import styles from './setting.css'; -import languageSwitcherTheme from './languageSwitcher.css'; // eslint-disable-next-line import/no-named-as-default import SliderCheckbox from '../toolbox/checkbox'; -import RelativeLink from '../relativeLink'; import i18n from '../../i18n'; -import { FontIcon } from '../fontIcon'; class Setting extends React.Component { constructor() { @@ -33,7 +30,7 @@ class Setting extends React.Component { render() { this.language = (i18n.language === 'de'); - const { t, hasSecondPassphrase } = this.props; + const { t } = this.props; return