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

Commit

Permalink
Rename saveAccount to savedAccounts
Browse files Browse the repository at this point in the history
  • Loading branch information
slaweet committed Nov 9, 2017
1 parent 0732679 commit 04921d1
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: Account management
Feature: Saved Accounts
Scenario: should allow to save account locally, after page reload it should require passphrase to do the first transaction, and remember the passphrase for next transactions
Given I'm logged in as "genesis"
When I click "saved accounts" in main menu
Expand Down
2 changes: 1 addition & 1 deletion src/actions/savedAccounts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import actionTypes from '../constants/actions';
import { getSavedAccounts, setSavedAccount, removeSavedAccount, setLastActiveAccount } from '../utils/saveAccount';
import { getSavedAccounts, setSavedAccount, removeSavedAccount, setLastActiveAccount } from '../utils/savedAccounts';

/**
* An action to dispatch accountSaved
Expand Down
4 changes: 2 additions & 2 deletions src/actions/savedAccounts.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'chai';
import sinon from 'sinon';
import actionTypes from '../constants/actions';
import * as saveAccountUtils from '../utils/saveAccount';
import * as savedAccountsUtils from '../utils/savedAccounts';
import {
accountSaved,
accountRemoved,
Expand All @@ -18,7 +18,7 @@ describe('actions: savedAccount', () => {

describe('accountsRetrieved', () => {
it('should create an action to retrieved the saved accounts list', () => {
sinon.stub(saveAccountUtils, 'getSavedAccounts').returns([data]);
sinon.stub(savedAccountsUtils, 'getSavedAccounts').returns([data]);
const expectedAction = {
data: [data],
type: actionTypes.accountsRetrieved,
Expand Down
4 changes: 2 additions & 2 deletions src/components/dialog/dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import i18next from 'i18next';
import ReceiveDialog from '../receiveDialog';
import Register from '../register';
import RegisterDelegate from '../registerDelegate';
import SaveAccount from '../saveAccount';
import SavedAccounts from '../savedAccounts';
import SecondPassphrase from '../secondPassphrase';
import Send from '../send';
import Settings from '../settings';
Expand Down Expand Up @@ -47,7 +47,7 @@ export default () => ({
},
'saved-accounts': {
title: i18next.t('Saved accounts'),
component: SaveAccount,
component: SavedAccounts,
},
settings: {
title: i18next.t('Settings'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { connect } from 'react-redux';
import { translate } from 'react-i18next';
import { accountSaved, accountRemoved, accountSwitched } from '../../actions/savedAccounts';
import SaveAccount from './saveAccount';
import SavedAccounts from './savedAccounts';

const mapStateToProps = state => ({
publicKey: state.account.publicKey,
Expand All @@ -18,4 +18,4 @@ const mapDispatchToProps = dispatch => ({
export default connect(
mapStateToProps,
mapDispatchToProps,
)(translate()(SaveAccount));
)(translate()(SavedAccounts));
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import configureMockStore from 'redux-mock-store';
import sinon from 'sinon';
import PropTypes from 'prop-types';
import i18n from '../../i18n';
import SaveAccountHOC from './index';
import SavedAccountsHOC from './index';
import * as savedAccounts from '../../actions/savedAccounts';


describe('SaveAccountHOC', () => {
describe('SavedAccountsHOC', () => {
let wrapper;

const account = {
Expand All @@ -30,7 +30,7 @@ describe('SaveAccountHOC', () => {
});

beforeEach(() => {
wrapper = mount(<SaveAccountHOC closeDialog={() => {}} t={(key => key)} />, {
wrapper = mount(<SavedAccountsHOC closeDialog={() => {}} t={(key => key)} />, {
context: { store, i18n },
childContextTypes: {
store: PropTypes.object.isRequired,
Expand All @@ -39,13 +39,13 @@ describe('SaveAccountHOC', () => {
});
});

it('should render SaveAccount', () => {
expect(wrapper.find('SaveAccount')).to.have.lengthOf(1);
it('should render SavedAccounts', () => {
expect(wrapper.find('SavedAccounts')).to.have.lengthOf(1);
});

it('should bind accountSaved action to SaveAccount props.accountSaved', () => {
it('should bind accountSaved action to SavedAccounts props.accountSaved', () => {
const actionsSpy = sinon.spy(savedAccounts, 'accountSaved');
wrapper.find('SaveAccount button.add-active-account-button').simulate('click');
wrapper.find('SavedAccounts button.add-active-account-button').simulate('click');
expect(actionsSpy).to.be.calledWith();
actionsSpy.restore();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import networks from '../../constants/networks';
import getNetwork from '../../utils/getNetwork';
import { extractAddress } from '../../utils/api/account';

const SaveAccount = ({
const SavedAccounts = ({
networkOptions,
publicKey,
closeDialog,
Expand Down Expand Up @@ -85,4 +85,4 @@ const SaveAccount = ({
);
};

export default SaveAccount;
export default SavedAccounts;
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { spy } from 'sinon';
import configureStore from 'redux-mock-store';
import PropTypes from 'prop-types';
import i18n from '../../i18n';
import SaveAccount from './saveAccount';
import SavedAccounts from './savedAccounts';

const fakeStore = configureStore();

describe('SaveAccount', () => {
describe('SavedAccounts', () => {
let wrapper;
let closeDialogSpy;
let accountSavedSpy;
Expand All @@ -36,7 +36,7 @@ describe('SaveAccount', () => {
balance: 100e8,
},
});
wrapper = mount(<SaveAccount {...props} />, {
wrapper = mount(<SavedAccounts {...props} />, {
context: { store, i18n },
childContextTypes: {
store: PropTypes.object.isRequired,
Expand All @@ -56,7 +56,7 @@ describe('SaveAccount', () => {

it('should call props.accountSaved on "save button" click', () => {
wrapper.find('button.add-active-account-button').simulate('click');
const componentProps = wrapper.find(SaveAccount).props();
const componentProps = wrapper.find(SavedAccounts).props();
expect(componentProps.accountSaved).to.have.been.calledWith();
});
});
Expand Down
File renamed without changes.

0 comments on commit 04921d1

Please sign in to comment.