mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-08 01:03:25 +00:00
* Fix #1569 * Use common component for handling "to" address * If to address becomes invalid, hide contract interact explorer * Add IS_CONTRACT_INTERACTION mode - fix bugs related to contract interact * Bump shepherd version to fix bugs related to metamask + network switches * Update mycrypto link downloads * Update facebook link * Remove console log from checktx * Fix dollar sign on contract address in conf modal * Fix unchecksummed address for metamask signing * Cleanup unused classname * Update generate keystore file description to be correct * Add space to create new wallet banner * Remove extra variable * Do checksumming in library function instead of component * Clear state on address change
35 lines
1.4 KiB
TypeScript
35 lines
1.4 KiB
TypeScript
import { configuredStore } from 'store';
|
|
import { cloneableGenerator, createMockTask } from 'redux-saga/utils';
|
|
import { take, race, fork } from 'redux-saga/effects';
|
|
import { TypeKeys as TransactionTK } from 'actions/transaction';
|
|
import { TypeKeys as WalletTK } from 'actions/wallet';
|
|
import { TypeKeys as SwapTK } from 'actions/swap/constants';
|
|
import { configureLiteSendSaga, handleConfigureLiteSend } from 'sagas/swap/liteSend';
|
|
|
|
// init module
|
|
configuredStore.getState();
|
|
|
|
describe('Testing handle configure lite send', () => {
|
|
const generators = {
|
|
original: cloneableGenerator(handleConfigureLiteSend)()
|
|
};
|
|
const { original } = generators;
|
|
|
|
it('forks a configureLiteSend saga', () => {
|
|
const expectedYield = fork(configureLiteSendSaga);
|
|
expect(original.next().value).toEqual(expectedYield);
|
|
});
|
|
|
|
it('races between three conditions, either the transaction state is reset, the user navigated away from the page, or bitty/shapeshift polling as finished', () => {
|
|
const mockedTask = createMockTask();
|
|
const expectedYield = race({
|
|
transactionReset: take(TransactionTK.RESET_REQUESTED),
|
|
userNavigatedAway: take(WalletTK.WALLET_RESET),
|
|
bityPollingFinished: take(SwapTK.SWAP_STOP_POLL_BITY_ORDER_STATUS),
|
|
shapeshiftPollingFinished: take(SwapTK.SWAP_STOP_POLL_SHAPESHIFT_ORDER_STATUS)
|
|
});
|
|
|
|
expect(original.next(mockedTask).value).toEqual(expectedYield);
|
|
});
|
|
});
|