mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-18 14:07:31 +00:00
34 lines
795 B
TypeScript
34 lines
795 B
TypeScript
|
import { rates, INITIAL_STATE } from 'reducers/rates';
|
||
|
import * as ratesActions from 'actions/rates';
|
||
|
|
||
|
describe('rates reducer', () => {
|
||
|
it('should handle RATES_FETCH_CC_SUCCEEDED', () => {
|
||
|
const fakeCCResp: ratesActions.CCResponse = {
|
||
|
symbol: 'USD',
|
||
|
rates: {
|
||
|
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.symbol]: fakeCCResp.rates
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
|
||
|
it('should handle RATES_FETCH_CC_FAILED', () => {
|
||
|
expect(rates(undefined, ratesActions.fetchCCRatesFailed())).toHaveProperty(
|
||
|
'ratesError'
|
||
|
);
|
||
|
});
|
||
|
});
|