Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Merge branch 'development' into 545-fix-offline-behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
slaweet committed Aug 21, 2017
2 parents 0c83487 + fa4c2ca commit 94261e8
Show file tree
Hide file tree
Showing 27 changed files with 325 additions and 89 deletions.
9 changes: 8 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@
"no-restricted-properties": "off",
"no-return-assign": "off",
"no-underscore-dangle": "off",
"import/no-extraneous-dependencies": "off",
"import/no-extraneous-dependencies": ["error", {
devDependencies: [
"./src/**/*.test.js",
"./features/*/*.js",
"./src/**/stories.js"
]
}
],
"no-param-reassign": "off"
}
}
26 changes: 24 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,37 @@ node('lisk-nano-01'){
}
}

stage ('Build Nano') {
stage ('Install npm dependencies') {
try {
sh '''#!/bin/bash
# Install Electron
npm install
# Build nano
cd $WORKSPACE
npm install
'''
} catch (err) {
currentBuild.result = 'FAILURE'
milestone 1
error('Stopping build, npm install failed')
}
}

stage ('Run Eslint') {
try {
sh '''
cd $WORKSPACE
npm run eslint
'''
} catch (err) {
currentBuild.result = 'FAILURE'
error('Stopping build, Eslint failed')
}
}

stage ('Build Nano') {
try {
sh '''#!/bin/bash
# Add coveralls config file
cp ~/.coveralls.yml-nano .coveralls.yml
Expand Down
1 change: 1 addition & 0 deletions features/login.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Feature: Login page
Then I should be logged in
And I should see text "Testnet" in "peer network" element

@ignore
Scenario: should remember the selected network
Given I'm on login page
When I fill in "wagon stock borrow episode laundry kitten salute link globe zero feed marble" to "passphrase" field
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/forging.step.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies */
const { defineSupportCode } = require('cucumber');
const { waitForElemAndCheckItsText } = require('../support/util.js');


defineSupportCode(({ Then }) => {
Then('I should see forging center', (callback) => {
waitForElemAndCheckItsText('.delegate-name', 'genesis_17', callback);
Expand Down
6 changes: 3 additions & 3 deletions features/step_definitions/generic.step.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */
const { defineSupportCode } = require('cucumber');
const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
Expand Down Expand Up @@ -114,9 +115,8 @@ defineSupportCode(({ Given, When, Then, setDefaultTimeout }) => {
* Generates a sequence of random pairs of x,y coordinates on the screen that simulates
* the movement of mouse to produce a pass phrase.
*/
for (let i = 0; i < iterations; i++) {
actions
.mouseMove(element(by.css('body')), {
for (let i = 0; i < iterations; i += 1) {
actions.mouseMove(element(by.css('body')), {
x: 500 + (Math.floor((((i % 2) * 2) - 1) * (249 + (Math.random() * 250)))),
y: 500 + (Math.floor((((i % 2) * 2) - 1) * (249 + (Math.random() * 250)))),
});
Expand Down
1 change: 1 addition & 0 deletions features/step_definitions/hooks.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */
const { defineSupportCode } = require('cucumber');
const fs = require('fs');

Expand Down
1 change: 1 addition & 0 deletions features/step_definitions/login.step.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */
const { defineSupportCode } = require('cucumber');
const { waitForElemAndCheckItsText } = require('../support/util.js');

Expand Down
1 change: 1 addition & 0 deletions features/step_definitions/menu.step.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */
const { defineSupportCode } = require('cucumber');
const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
Expand Down
1 change: 1 addition & 0 deletions features/step_definitions/top.step.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */
const { defineSupportCode } = require('cucumber');
const { waitForElemAndCheckItsText } = require('../support/util.js');

Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/transactions.step.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies */
const { defineSupportCode } = require('cucumber');
const { waitForElemAndClickIt } = require('../support/util.js');


defineSupportCode(({ When }) => {
When('I click "{elementName}" element on table row no. {index}', (elementName, index, callback) => {
const selectorClass = `.${elementName.replace(/ /g, '-')}`;
Expand Down
1 change: 1 addition & 0 deletions features/step_definitions/voting.step.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */
const { defineSupportCode } = require('cucumber');
const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
Expand Down
1 change: 1 addition & 0 deletions features/support/util.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */
const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');

Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
"dist:win": "build --win --ia32 --x64",
"dist:mac": "build --mac",
"dist:linux": "build --linux --ia32 --x64 --armv7l",
"copy-files": "mkdir dist && cp -r ./src/index.html ./src/assets ./dist",
"clean": "del dist -f",
"copy-files": "mkdir app/dist && cp -r ./src/index.html ./app/dist",
"clean": "del app/dist -f",
"eslint": "eslint ./src/ ./app/ ./features/",
"storybook": "start-storybook -p 6006 -s ./src/",
"build-storybook": "build-storybook"
},
Expand All @@ -40,14 +41,18 @@
"react": "=15.6.x",
"react-animate-on-change": "^1.0.0",
"react-circular-progressbar": "=0.1.5",
"react-css-themr": "=2.1.2",
"react-dom": "=15.6.x",
"react-redux": "=5.0.5",
"react-router": "=4.1.2",
"react-router-dom": "=4.1.2",
"react-toolbox": "=2.0.0-beta.12",
"react-waypoint": "=7.0.4",
"redux": "=3.6.0",
"redux-logger": "=3.0.6"
},
"devDependencies": {
"@storybook/addon-actions": "=3.2.0",
"@storybook/react": "=3.1.8",
"babel-core": "=6.20.0",
"babel-loader": "=7.0.0-beta.1",
Expand Down Expand Up @@ -98,7 +103,6 @@
"react-addons-test-utils": "=15.6.0",
"react-hot-loader": "^1.3.1",
"react-test-renderer": "=15.6.1",
"react-waypoint": "^7.0.4",
"redux-mock-store": "=1.2.3",
"should": "=11.2.0",
"sinon": "=2.0.0",
Expand Down
8 changes: 4 additions & 4 deletions src/assets/fonts/material-design-icons/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url('/assets/fonts/material-design-icons/MaterialIcons-Regular.eot'); /* For IE6-8 */
src: url('../../assets/fonts/material-design-icons/MaterialIcons-Regular.eot'); /* For IE6-8 */
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url('/assets/fonts/material-design-icons/MaterialIcons-Regular.woff2') format('woff2'),
url('/assets/fonts/material-design-icons/MaterialIcons-Regular.woff') format('woff'),
url('/assets/fonts/material-design-icons/MaterialIcons-Regular.ttf') format('truetype');
url('../../assets/fonts/material-design-icons/MaterialIcons-Regular.woff2') format('woff2'),
url('../../assets/fonts/material-design-icons/MaterialIcons-Regular.woff') format('woff'),
url('../../assets/fonts/material-design-icons/MaterialIcons-Regular.ttf') format('truetype');
}
:global .material-icons {
font-family: 'Material Icons';
Expand Down
36 changes: 18 additions & 18 deletions src/assets/fonts/roboto-mono/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@
font-family: 'Roboto Mono';
font-style: normal;
font-weight: 400;
src: url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-regular.eot'); /* IE9 Compat Modes */
src: url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-regular.eot'); /* IE9 Compat Modes */
src: local('Roboto Mono'), local('RobotoMono-Regular'),
url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-regular.woff') format('woff'), /* Modern Browsers */
url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-regular.svg#RobotoMono') format('svg'); /* Legacy iOS */
url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-regular.woff') format('woff'), /* Modern Browsers */
url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-regular.svg#RobotoMono') format('svg'); /* Legacy iOS */
}
/* roboto-mono-500 - latin */
@font-face {
font-family: 'Roboto Mono';
font-style: normal;
font-weight: 500;
src: url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-500.eot'); /* IE9 Compat Modes */
src: url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-500.eot'); /* IE9 Compat Modes */
src: local('Roboto Mono Medium'), local('RobotoMono-Medium'),
url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-500.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-500.woff2') format('woff2'), /* Super Modern Browsers */
url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-500.woff') format('woff'), /* Modern Browsers */
url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-500.ttf') format('truetype'), /* Safari, Android, iOS */
url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-500.svg#RobotoMono') format('svg'); /* Legacy iOS */
url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-500.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-500.woff2') format('woff2'), /* Super Modern Browsers */
url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-500.woff') format('woff'), /* Modern Browsers */
url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-500.ttf') format('truetype'), /* Safari, Android, iOS */
url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-500.svg#RobotoMono') format('svg'); /* Legacy iOS */
}
/* roboto-mono-700 - latin */
@font-face {
font-family: 'Roboto Mono';
font-style: normal;
font-weight: 700;
src: url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-700.eot'); /* IE9 Compat Modes */
src: url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-700.eot'); /* IE9 Compat Modes */
src: local('Roboto Mono Bold'), local('RobotoMono-Bold'),
url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-700.woff2') format('woff2'), /* Super Modern Browsers */
url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-700.woff') format('woff'), /* Modern Browsers */
url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */
url('/assets/fonts/roboto-mono/roboto-mono-v4-latin-700.svg#RobotoMono') format('svg'); /* Legacy iOS */
url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-700.woff2') format('woff2'), /* Super Modern Browsers */
url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-700.woff') format('woff'), /* Modern Browsers */
url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */
url('../../assets/fonts/roboto-mono/roboto-mono-v4-latin-700.svg#RobotoMono') format('svg'); /* Legacy iOS */
}
36 changes: 18 additions & 18 deletions src/assets/fonts/roboto/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: url('/assets/fonts/roboto/roboto-v15-latin-regular.eot'); /* IE9 Compat Modes */
src: url('../../assets/fonts/roboto/roboto-v15-latin-regular.eot'); /* IE9 Compat Modes */
src: local('Roboto'), local('Roboto-Regular'),
url('/assets/fonts/roboto/roboto-v15-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/assets/fonts/roboto/roboto-v15-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('/assets/fonts/roboto/roboto-v15-latin-regular.woff') format('woff'), /* Modern Browsers */
url('/assets/fonts/roboto/roboto-v15-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('/assets/fonts/roboto/roboto-v15-latin-regular.svg#Roboto') format('svg'); /* Legacy iOS */
url('../../assets/fonts/roboto/roboto-v15-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../../assets/fonts/roboto/roboto-v15-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('../../assets/fonts/roboto/roboto-v15-latin-regular.woff') format('woff'), /* Modern Browsers */
url('../../assets/fonts/roboto/roboto-v15-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('../../assets/fonts/roboto/roboto-v15-latin-regular.svg#Roboto') format('svg'); /* Legacy iOS */
}
/* roboto-500 - latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
src: url('/assets/fonts/roboto/roboto-v15-latin-500.eot'); /* IE9 Compat Modes */
src: url('../../assets/fonts/roboto/roboto-v15-latin-500.eot'); /* IE9 Compat Modes */
src: local('Roboto Medium'), local('Roboto-Medium'),
url('/assets/fonts/roboto/roboto-v15-latin-500.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/assets/fonts/roboto/roboto-v15-latin-500.woff2') format('woff2'), /* Super Modern Browsers */
url('/assets/fonts/roboto/roboto-v15-latin-500.woff') format('woff'), /* Modern Browsers */
url('/assets/fonts/roboto/roboto-v15-latin-500.ttf') format('truetype'), /* Safari, Android, iOS */
url('/assets/fonts/roboto/roboto-v15-latin-500.svg#Roboto') format('svg'); /* Legacy iOS */
url('../../assets/fonts/roboto/roboto-v15-latin-500.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../../assets/fonts/roboto/roboto-v15-latin-500.woff2') format('woff2'), /* Super Modern Browsers */
url('../../assets/fonts/roboto/roboto-v15-latin-500.woff') format('woff'), /* Modern Browsers */
url('../../assets/fonts/roboto/roboto-v15-latin-500.ttf') format('truetype'), /* Safari, Android, iOS */
url('../../assets/fonts/roboto/roboto-v15-latin-500.svg#Roboto') format('svg'); /* Legacy iOS */
}
/* roboto-700 - latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
src: url('/assets/fonts/roboto/roboto-v15-latin-700.eot'); /* IE9 Compat Modes */
src: url('../../assets/fonts/roboto/roboto-v15-latin-700.eot'); /* IE9 Compat Modes */
src: local('Roboto Bold'), local('Roboto-Bold'),
url('/assets/fonts/roboto/roboto-v15-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/assets/fonts/roboto/roboto-v15-latin-700.woff2') format('woff2'), /* Super Modern Browsers */
url('/assets/fonts/roboto/roboto-v15-latin-700.woff') format('woff'), /* Modern Browsers */
url('/assets/fonts/roboto/roboto-v15-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */
url('/assets/fonts/roboto/roboto-v15-latin-700.svg#Roboto') format('svg'); /* Legacy iOS */
url('../../assets/fonts/roboto/roboto-v15-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../../assets/fonts/roboto/roboto-v15-latin-700.woff2') format('woff2'), /* Super Modern Browsers */
url('../../assets/fonts/roboto/roboto-v15-latin-700.woff') format('woff'), /* Modern Browsers */
url('../../assets/fonts/roboto/roboto-v15-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */
url('../../assets/fonts/roboto/roboto-v15-latin-700.svg#Roboto') format('svg'); /* Legacy iOS */
}
48 changes: 27 additions & 21 deletions src/components/account/stories.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
import React from 'react';
import { Provider } from 'react-redux';

import { storiesOf } from '@storybook/react';
import Account from './accountComponent';
import Account from './account';
import Address from './address';
import store from '../../store';

storiesOf('Account', module)
.add('delegate', () => (
<Account
peers={{
status: {
online: true,
},
data: {
options: {
name: 'testy',
<Provider store={store}>
<Account
peers={{
status: {
online: true,
},
currentPeer: 'testpeer',
port: 8000,
},
}}
account={{
isDelegate: true,
username: 'testy',
address: '9396639332432599292L',
}}
balance="3.1415926535"
/>
data: {
options: {
name: 'testy',
},
currentPeer: 'testpeer',
port: 8000,
},
}}
account={{
isDelegate: true,
address: '9396639332432599292L',
delegate: {
username: 'testy',
},
}}
balance="3.1415926535"
/>
</Provider>
));

storiesOf('Address', module)
.add('delegate', () => (
<Address
isDelegate={true}
username="testy"
delegate= {{ username: 'testy' }}
address="9396639332432599292L"
/>
))
Expand Down
6 changes: 3 additions & 3 deletions src/components/registerDelegate/registerDelegate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('RegisterDelegate', () => {
it('allows register as delegate for a non delegate account', () => {
delegateApiMock.expects('registerDelegate').resolves({ success: true });
wrapper.find('.username input').simulate('change', { target: { value: 'sample_username' } });
wrapper.find('.next-button').simulate('click')
wrapper.find('.next-button').simulate('click');
expect(wrapper.find('.primary-button button').props().disabled).to.not.equal(true);
// TODO: this doesn't work for some reason
// expect(props.showSuccessAlert).to.have.been.calledWith();
Expand All @@ -98,15 +98,15 @@ describe('RegisterDelegate', () => {
const message = 'Username already exists';
delegateApiMock.expects('registerDelegate').rejects({ message });
wrapper.find('.username input').simulate('change', { target: { value: 'sample_username' } });
wrapper.find('.next-button').simulate('click')
wrapper.find('.next-button').simulate('click');
// TODO: this doesn't work for some reason
// expect(wrapper.find('RegisterDelegate .username').text()).to.contain(message);
});

it('handles register as delegate failure', () => {
delegateApiMock.expects('registerDelegate').rejects({ success: false });
wrapper.find('.username input').simulate('change', { target: { value: 'sample_username' } });
wrapper.find('.next-button').simulate('click')
wrapper.find('.next-button').simulate('click');
expect(wrapper.find('.primary-button button').props().disabled).to.not.equal(true);
// TODO: this doesn't work for some reason
// expect(props.showErrorAlert).to.have.been.calledWith();
Expand Down
Loading

0 comments on commit 94261e8

Please sign in to comment.