This repository has been archived by the owner on Mar 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from andrerfneves/develop
Release Candidate 1
- Loading branch information
Showing
218 changed files
with
24,516 additions
and
19,267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
flow-custom-typedefs/*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
[ignore] | ||
.*/node_modules/polished/.* | ||
./__tests__ | ||
./__tests__/**.js | ||
./flow-typed/npm/styled-components_v4.x.x.js | ||
|
||
[include] | ||
|
||
[libs] | ||
flow-typed | ||
flow-custom-typedefs | ||
|
||
[lints] | ||
|
||
[options] | ||
esproposal.optional_chaining=enable | ||
|
||
[strict] | ||
[strict] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
app: { | ||
isPackaged: false, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// @flow | ||
|
||
import configureStore from 'redux-mock-store'; | ||
|
||
import { | ||
LOAD_ADDRESSES_SUCCESS, | ||
LOAD_ADDRESSES_ERROR, | ||
loadAddressesSuccess, | ||
loadAddressesError, | ||
} from '../../app/redux/modules/receive'; | ||
|
||
const store = configureStore()(); | ||
|
||
describe('Receive Actions', () => { | ||
beforeEach(() => store.clearActions()); | ||
|
||
test('should create an action to load addresses with success', () => { | ||
const payload = { | ||
addresses: [ | ||
'tm0a9si0ds09gj02jj', | ||
'smas098gk02jf0kskk', | ||
], | ||
}; | ||
|
||
store.dispatch(loadAddressesSuccess(payload)); | ||
|
||
expect(store.getActions()[0]).toEqual( | ||
expect.objectContaining({ | ||
type: LOAD_ADDRESSES_SUCCESS, | ||
payload, | ||
}), | ||
); | ||
}); | ||
|
||
test('should create an action to load addresses with error', () => { | ||
const payload = { | ||
error: 'Something went wrong!', | ||
}; | ||
|
||
store.dispatch(loadAddressesError(payload)); | ||
|
||
expect(store.getActions()[0]).toEqual( | ||
expect.objectContaining({ | ||
type: LOAD_ADDRESSES_ERROR, | ||
payload, | ||
}), | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
// @flow | ||
|
||
import configureStore from 'redux-mock-store'; | ||
|
||
import { | ||
SEND_TRANSACTION, | ||
SEND_TRANSACTION_SUCCESS, | ||
SEND_TRANSACTION_ERROR, | ||
RESET_SEND_TRANSACTION, | ||
VALIDATE_ADDRESS_SUCCESS, | ||
VALIDATE_ADDRESS_ERROR, | ||
LOAD_ZEC_PRICE, | ||
sendTransaction, | ||
sendTransactionSuccess, | ||
sendTransactionError, | ||
resetSendTransaction, | ||
validateAddressSuccess, | ||
validateAddressError, | ||
loadZECPrice, | ||
} from '../../app/redux/modules/send'; | ||
|
||
const store = configureStore()(); | ||
|
||
describe('Send Actions', () => { | ||
beforeEach(() => store.clearActions()); | ||
|
||
test('should create an action to send a transaction', () => { | ||
store.dispatch(sendTransaction()); | ||
|
||
expect(store.getActions()[0]).toEqual( | ||
expect.objectContaining({ | ||
type: SEND_TRANSACTION, | ||
}), | ||
); | ||
}); | ||
|
||
test('should create an action to send transaction with success', () => { | ||
const payload = { | ||
operationId: '0b9ii4590ab-1d012klfo', | ||
}; | ||
|
||
store.dispatch(sendTransactionSuccess(payload)); | ||
|
||
expect(store.getActions()[0]).toEqual( | ||
expect.objectContaining({ | ||
type: SEND_TRANSACTION_SUCCESS, | ||
payload, | ||
}), | ||
); | ||
}); | ||
|
||
test('should create an action to send transaction with error', () => { | ||
const payload = { | ||
error: 'Something went wrong!', | ||
}; | ||
|
||
store.dispatch(sendTransactionError(payload)); | ||
|
||
expect(store.getActions()[0]).toEqual( | ||
expect.objectContaining({ | ||
type: SEND_TRANSACTION_ERROR, | ||
payload, | ||
}), | ||
); | ||
}); | ||
|
||
test('should reset a transaction', () => { | ||
store.dispatch(resetSendTransaction()); | ||
|
||
expect(store.getActions()[0]).toEqual( | ||
expect.objectContaining({ | ||
type: RESET_SEND_TRANSACTION, | ||
}), | ||
); | ||
}); | ||
|
||
test('should validate a address with success', () => { | ||
const payload = { | ||
isValid: true, | ||
}; | ||
|
||
store.dispatch(validateAddressSuccess(payload)); | ||
|
||
expect(store.getActions()[0]).toEqual( | ||
expect.objectContaining({ | ||
type: VALIDATE_ADDRESS_SUCCESS, | ||
payload, | ||
}), | ||
); | ||
}); | ||
|
||
test('should validate a address with error', () => { | ||
store.dispatch(validateAddressError()); | ||
|
||
expect(store.getActions()[0]).toEqual( | ||
expect.objectContaining({ | ||
type: VALIDATE_ADDRESS_ERROR, | ||
}), | ||
); | ||
}); | ||
|
||
test('should load ZEC price', () => { | ||
const payload = { | ||
value: 1.35, | ||
}; | ||
|
||
store.dispatch(loadZECPrice(payload)); | ||
|
||
expect(store.getActions()[0]).toEqual( | ||
expect.objectContaining({ | ||
type: LOAD_ZEC_PRICE, | ||
payload, | ||
}), | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// @flow | ||
|
||
import configureStore from 'redux-mock-store'; | ||
|
||
import { | ||
LOAD_TRANSACTIONS, | ||
LOAD_TRANSACTIONS_SUCCESS, | ||
LOAD_TRANSACTIONS_ERROR, | ||
loadTransactions, | ||
loadTransactionsSuccess, | ||
loadTransactionsError, | ||
} from '../../app/redux/modules/transactions'; | ||
|
||
const store = configureStore()(); | ||
|
||
describe('Transactions Actions', () => { | ||
beforeEach(() => store.clearActions()); | ||
|
||
test('should create an action to load transactions', () => { | ||
store.dispatch(loadTransactions()); | ||
|
||
expect(store.getActions()[0]).toEqual( | ||
expect.objectContaining({ | ||
type: LOAD_TRANSACTIONS, | ||
}), | ||
); | ||
}); | ||
|
||
test('should create an action to load transactions with success', () => { | ||
const payload = { | ||
list: [], | ||
zecPrice: 0, | ||
hasNextPage: false, | ||
}; | ||
|
||
store.dispatch(loadTransactionsSuccess(payload)); | ||
|
||
expect(store.getActions()[0]).toEqual( | ||
expect.objectContaining({ | ||
type: LOAD_TRANSACTIONS_SUCCESS, | ||
payload, | ||
}), | ||
); | ||
}); | ||
|
||
test('should create an action to load transactions with error', () => { | ||
const payload = { | ||
error: 'Something went wrong!', | ||
}; | ||
|
||
store.dispatch(loadTransactionsError(payload)); | ||
|
||
expect(store.getActions()[0]).toEqual( | ||
expect.objectContaining({ | ||
type: LOAD_TRANSACTIONS_ERROR, | ||
payload, | ||
}), | ||
); | ||
}); | ||
}); |
Oops, something went wrong.