Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/action/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ class WalletAction {
this._nav.goWait();
observe(this._store, 'lndReady', () => this._nav.goHome());
} catch (err) {
this.setPassword({ password: '' });
this._notification.display({ type: 'error', msg: 'Invalid password' });
}
}
Expand Down
5 changes: 4 additions & 1 deletion test/unit/action/wallet.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,16 @@ describe('Action Wallet Unit Tests', () => {
expect(nav.goHome, 'was called once');
});

it('should display error notification on failure', async () => {
it('should display error notification on failure and clear password', async () => {
wallet.setPassword('not-empty');
expect(store.wallet.password, 'not to be', '');
grpc.sendUnlockerCommand
.withArgs('UnlockWallet')
.rejects(new Error('Boom!'));
await wallet.unlockWallet({ walletPassword: 'baz' });
expect(notification.display, 'was called once');
expect(nav.goWait, 'was not called');
expect(store.wallet.password, 'to be', '');
});
});

Expand Down