MyCrypto/spec/reducers/rates.spec.ts
Daniel Ternyak e7f88a6a0a
Remove redux-promise-middleware (#1022)
* Use shapeshift for all swaps.

* Replace existing redux-promise-middleware based CCRequest action with saga based action.

* Remove module from package.json, store middleware, webpack_config.

* fix snapshot

* Add return typing

* Add test for saga
2018-02-07 17:59:55 -06:00

32 lines
768 B
TypeScript

import { rates, INITIAL_STATE } from 'reducers/rates';
import * as ratesActions from 'actions/rates';
import { CCResponse } from 'api/rates';
describe('rates reducer', () => {
it('should handle RATES_FETCH_CC_SUCCEEDED', () => {
const fakeCCResp: CCResponse = {
ETH: {
USD: 0,
BTC: 1,
EUR: 2,
GBP: 3,
CHF: 4,
REP: 5,
ETH: 6
}
};
expect(rates(undefined, ratesActions.fetchCCRatesSucceeded(fakeCCResp))).toEqual({
...INITIAL_STATE,
rates: {
...INITIAL_STATE.rates,
...fakeCCResp
}
});
});
it('should handle RATES_FETCH_CC_FAILED', () => {
expect(rates(undefined, ratesActions.fetchCCRatesFailed())).toHaveProperty('ratesError');
});
});