+ { savedAccounts.length === 0 ?
+
+ {t('This will save public key of your account on this device, so next time it will launch without the need to log in. However, you will be prompted to enter the passphrase once you want to do any transaction.')}
+ :
+
+
+
+ {t('Switch')}
+ {t('Address')}
+ {t('Network')}
+ {t('Forget')}
+
+ {savedAccounts.map(account => (
+
+
+
+
+
+ {extractAddress(account.publicKey)}
+
+
+ {account.network === networks.customNode.code ?
+ account.address :
+ t(getNetwork(account.network).name)}
+
+
+
+
+
+ ))}
+
+
+ }
+
+
+ );
+};
+
+export default SavedAccounts;
diff --git a/src/components/savedAccounts/savedAccounts.test.js b/src/components/savedAccounts/savedAccounts.test.js
new file mode 100644
index 000000000..30ee7968f
--- /dev/null
+++ b/src/components/savedAccounts/savedAccounts.test.js
@@ -0,0 +1,92 @@
+import React from 'react';
+import { expect } from 'chai';
+import { mount } from 'enzyme';
+import { spy } from 'sinon';
+import configureStore from 'redux-mock-store';
+import PropTypes from 'prop-types';
+import i18n from '../../i18n';
+import SavedAccounts from './savedAccounts';
+
+const fakeStore = configureStore();
+
+describe('SavedAccounts', () => {
+ let wrapper;
+ let closeDialogSpy;
+ let accountSavedSpy;
+ const publicKey = 'fab9d261ea050b9e326d7e11587eccc343a20e64e29d8781b50fd06683cacc88';
+ const savedAccounts = [
+ {
+ publicKey: 'hab9d261ea050b9e326d7e11587eccc343a20e64e29d8781b50fd06683cacc88',
+ network: 0,
+ },
+ {
+ network: 2,
+ publicKey,
+ address: 'http://localhost:4000',
+ },
+ {
+ network: 0,
+ publicKey,
+ },
+ ];
+
+ const props = {
+ closeDialog: () => {},
+ accountSaved: () => {},
+ accountRemoved: () => {},
+ accountSwitched: () => {},
+ networkOptions: {
+ code: 0,
+ },
+ publicKey,
+ savedAccounts: [],
+ t: key => key,
+ };
+
+ beforeEach(() => {
+ closeDialogSpy = spy(props, 'closeDialog');
+ accountSavedSpy = spy(props, 'accountSaved');
+ const store = fakeStore({
+ account: {
+ balance: 100e8,
+ },
+ });
+ wrapper = mount(