Skip to content

Commit

Permalink
Merge pull request #387 from Bit-Nation/release/0.4.1
Browse files Browse the repository at this point in the history
Release/0.4.1
  • Loading branch information
florianlenz committed Jun 8, 2018
2 parents 209bb7f + 53159ac commit 36bdcd3
Show file tree
Hide file tree
Showing 14 changed files with 4,542 additions and 65 deletions.
40 changes: 28 additions & 12 deletions __tests__/src/reducers/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,37 @@ describe('wallet reducer action handling', () => {
});
});

test('walletSyncFailed', () => {
const stateBefore = stateWithWallets;
const stateAfter = reducer(stateBefore, walletSyncFailed(mockWallet.ethAddress, mockError));
expect(stateAfter).toEqual({
...stateBefore,
wallets: [{ ...mockWallet, synchronizationError: mockError }],
describe('walletSyncFailed', () => {
test('with wallets', () => {
const stateBefore = stateWithWallets;
const stateAfter = reducer(stateBefore, walletSyncFailed(mockWallet.ethAddress, mockError));
expect(stateAfter).toEqual({
...stateBefore,
wallets: [{ ...mockWallet, synchronizationError: mockError }],
});
});

test('without wallets', () => {
const stateBefore = initialState;
const stateAfter = reducer(stateBefore, walletSyncFailed(mockWallet.ethAddress, mockError));
expect(stateAfter).toEqual(stateBefore);
});
});

test('updateWalletBalance', () => {
const stateBefore = stateWithWallets;
const stateAfter = reducer(stateBefore, updateWalletBalance(mockWallet.ethAddress));
expect(stateAfter).toEqual({
...stateBefore,
wallets: [{ ...mockWallet, synchronizationError: undefined }],
describe('updateWalletBalance', () => {
test('with wallets', () => {
const stateBefore = stateWithWallets;
const stateAfter = reducer(stateBefore, updateWalletBalance(mockWallet.ethAddress));
expect(stateAfter).toEqual({
...stateBefore,
wallets: [{ ...mockWallet, synchronizationError: undefined }],
});
});

test('without wallets', () => {
const stateBefore = initialState;
const stateAfter = reducer(stateBefore, updateWalletBalance(mockWallet.ethAddress));
expect(stateAfter).toEqual(stateBefore);
});
});

Expand Down

0 comments on commit 36bdcd3

Please sign in to comment.