Skip to content

Commit

Permalink
chore(register): passphrase removal (#235)
Browse files Browse the repository at this point in the history
* feat(register): remove passphrase from post-register screen

* chore(register): fix AccountDatum component name

* chore(register): added AccountDetails component tests
  • Loading branch information
mhuggins authored Jun 14, 2018
1 parent cb439b3 commit 922b254
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from 'react';
import { shallow } from 'enzyme';

import AccountDetails from 'register/components/AccountDetails/AccountDetails';

describe('<AccountDetails />', () => {
const account = {
address: 'my-address',
key: 'my-key',
encryptedKey: 'my-encrypted-key',
passphrase: 'my-passphrase'
};
let wrapper;

const findDatum = (label) => {
return wrapper.find('AccountDatum').findWhere((node) => node.prop('label') === label);
};

beforeEach(() => {
wrapper = shallow(<AccountDetails account={account} />);
});

it('renders address', () => {
expect(findDatum('Address').prop('value')).toEqual(account.address);
});

it('renders private key', () => {
expect(findDatum('Private Key').prop('value')).toEqual(account.key);
});

it('renders encrypted key', () => {
expect(findDatum('Encrypted Key').prop('value')).toEqual(account.encryptedKey);
});

it('does not render passphrase', () => {
expect(findDatum('Passphrase')).toHaveLength(0);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import styles from './AccountDatum.scss';

const COPIED_DURATION = 2000;

export default class AccountDetails extends React.Component {
export default class AccountDatum extends React.Component {
static propTypes = {
label: string.isRequired,
value: string.isRequired
Expand Down
1 change: 0 additions & 1 deletion src/register/components/AccountDetails/AccountDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default function AccountDetails(props) {
<AccountDatum label="Address" value={account.address} />
<AccountDatum label="Private Key" value={account.key} />
<AccountDatum label="Encrypted Key" value={account.encryptedKey} />
<AccountDatum label="Passphrase" value={account.passphrase} />
</div>
<div className={styles.actions}>
<Link to="/login">Login</Link>
Expand Down

0 comments on commit 922b254

Please sign in to comment.