Skip to content

Commit

Permalink
Hide unfinished UI elements - Closes #206
Browse files Browse the repository at this point in the history
  • Loading branch information
slaweet committed Jan 17, 2018
1 parent 1fc8ec4 commit 95abeb1
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 40 deletions.
1 change: 0 additions & 1 deletion i18n/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"Block Id": "Block Id",
"Block height": "Block height",
"Blockchain Application Registration": "Blockchain Application Registration",
"Buy Lisk": "Buy Lisk",
"Cancel": "Cancel",
"Check for updates...": "Check for updates...",
"Choose the correct phrases to confirm.": "Choose the correct phrases to confirm.",
Expand Down
7 changes: 0 additions & 7 deletions src/components/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ const Header = props => (
menuRipple
theme={styles}
>
{
!props.account.isDelegate &&
<MenuItem theme={styles}>
<RelativeLink className={`register-as-delegate ${styles.link}`}
to='register-delegate'>{props.t('Register as delegate')}</RelativeLink>
</MenuItem>
}
<MenuItem theme={styles}>
<RelativeLink className={`sign-message ${styles.link}`} to='sign-message'>{props.t('Sign message')}</RelativeLink>
</MenuItem>
Expand Down
4 changes: 2 additions & 2 deletions src/components/header/header.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
4 changes: 0 additions & 4 deletions src/components/mainMenu/mainMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ class MainMenu extends React.Component {
label: t('Wallet'),
id: 'transactions',
image: menuLogos.wallet,
}, {
label: t('Buy Lisk'),
id: 'butLisk',
image: menuLogos.buyLisk,
}, {
label: t('Delegates'),
id: 'voting',
Expand Down
7 changes: 3 additions & 4 deletions src/components/setting/setting.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -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 <footer className={styles.wrapper}>
<ReactSwipe
className={styles.carousel}
Expand Down Expand Up @@ -70,6 +67,7 @@ class Setting extends React.Component {
<p>{t('Delegate section will be displayed.')}</p>
</article>
</div>
{/* TODO: will be re-enabled when the functionality is updated
<div>
<SliderCheckbox
theme={languageSwitcherTheme}
Expand Down Expand Up @@ -109,6 +107,7 @@ class Setting extends React.Component {
<p>{t('Register 2nd passphrase')}</p>
</article>
</div>
*/}
</ReactSwipe>
<ul className={ styles.carouselNav } id='carouselNav'>
{[...Array(4)].map((x, i) =>
Expand Down
6 changes: 4 additions & 2 deletions src/components/setting/setting.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ describe('Setting', () => {
expect(wrapper.find('#carouselNav li').at(2).props().className).to.be.include('activeSlide');
});

it('should click on "languageSwitcher" change the language to "de"', () => {
// TODO: will be re-enabled when the functionality is re-enabled
it.skip('should click on "languageSwitcher" change the language to "de"', () => {
// const languageSpy = sinon.spy(i18n, 'changeLanguage');
wrapper.find('.language-switcher .circle').simulate('click');
wrapper.update();
expect(i18n.language).to.be.equal('de');
});

it('should second click on "languageSwitcher" change the language to "en"', () => {
// TODO: will be re-enabled when the functionality is re-enabled
it.skip('should second click on "languageSwitcher" change the language to "en"', () => {
wrapper.find('.language-switcher .circle').simulate('click');
wrapper.update();
expect(i18n.language).to.be.equal('de');
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/registerDelegate.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Register delegate
Scenario: should allow to register a delegate
Given I'm logged in as "delegate candidate"
When I click "register as delegate" in main menu
When I go to "main/dashboard/register-delegate"
And I fill in "test" to "username" field
And I click "register button"
Then I should see alert dialog with title "Success" and text "Delegate registration was successfully submitted with username: "test". It can take several seconds before it is processed."
Expand All @@ -12,7 +12,7 @@ Feature: Register delegate

Scenario: should allow to register a delegate with second passphrase
Given I'm logged in as "second passphrase account"
When I click "register as delegate" in main menu
When I go to "main/dashboard/register-delegate"
And I fill in "test2" to "username" field
And I fill in second passphrase of "second passphrase account" to "second passphrase" field
And I click "register button"
Expand All @@ -21,14 +21,14 @@ Feature: Register delegate
@integration
Scenario: should allow to exit delegate registration dialog
Given I'm logged in as "genesis"
When I click "register as delegate" in main menu
When I go to "main/dashboard/register-delegate"
And I click "cancel button"
Then I should see no "modal dialog"

@integration
Scenario: should not allow to register delegate if not enough funds for the fee
Given I'm logged in as "empty account"
When I click "register as delegate" in main menu
When I go to "main/dashboard/register-delegate"
Then I should see "Insufficient funds for 25 LSK fee" error message
And "register button" should be disabled

Expand Down
22 changes: 6 additions & 16 deletions test/e2e/registerSecondPassphrase.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Feature: Register second passphrase
# TODO: will be re-enabled when the functionality is re-enabled
@ignore
Scenario: should allow to set 2nd passphrase
Given I'm logged in as "second passphrase candidate"
When I click "more menu"
Expand Down Expand Up @@ -30,11 +32,7 @@ Feature: Register second passphrase
And I wait 1 seconds
And I refresh the page
And I wait 2 seconds
When I click "more menu"
And I wait 0.4 seconds
And I click 4 item in setting carousel
And I wait 0.4 seconds
And I click "register second passphrase"
When I go to "main/dashboard/register-second-passphrase"
And I fill in passphrase of "empty account" to "passphrase" field
And I click "authenticate button"
Then I should see "Insufficient funds for 5 LSK fee" error message
Expand All @@ -43,21 +41,13 @@ Feature: Register second passphrase
@integration
Scenario: should not allow to set 2nd passphrase if not enough funds for the fee
Given I'm logged in as "empty account"
When I click "more menu"
And I wait 0.4 seconds
And I click 4 item in setting carousel
And I wait 0.4 seconds
And I click "register second passphrase"
When I go to "main/dashboard/register-second-passphrase"
Then I should see "Insufficient funds for 5 LSK fee" error message
And "next button" should be disabled

@integration
Scenario: should allow to exit 2nd passphrase registration dialog
Given I'm logged in as "genesis"
When I click "more menu"
And I wait 0.4 seconds
And I click 4 item in setting carousel
And I wait 0.4 seconds
And I click "register second passphrase"
When I go to "main/dashboard/register-second-passphrase"
And I click "cancel button"
Then I should see no "modal dialog"
Then I should see no "modal dialog"
2 changes: 2 additions & 0 deletions test/e2e/settings.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Feature: Settings dialog
# TODO: will be re-enabled when the functionality is re-enabled
@ignore
Scenario: should allow to change language
Given I'm logged in as "any account"
When I click "more menu"
Expand Down

0 comments on commit 95abeb1

Please sign in to comment.