4 changed files with 268 additions and 3 deletions
@ -0,0 +1,37 @@ |
|||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP |
||||
|
|
||||
|
exports[`reducers tickerReducer should correctly getTicker 1`] = ` |
||||
|
Object { |
||||
|
"btcTicker": null, |
||||
|
"crypto": "btc", |
||||
|
"currency": "btc", |
||||
|
"tickerLoading": true, |
||||
|
} |
||||
|
`; |
||||
|
|
||||
|
exports[`reducers tickerReducer should correctly receiveTicker 1`] = ` |
||||
|
Object { |
||||
|
"btcTicker": "f", |
||||
|
"crypto": "btc", |
||||
|
"currency": "btc", |
||||
|
"tickerLoading": false, |
||||
|
} |
||||
|
`; |
||||
|
|
||||
|
exports[`reducers tickerReducer should correctly setCurrency 1`] = ` |
||||
|
Object { |
||||
|
"btcTicker": null, |
||||
|
"crypto": "btc", |
||||
|
"currency": "foo", |
||||
|
"tickerLoading": false, |
||||
|
} |
||||
|
`; |
||||
|
|
||||
|
exports[`reducers tickerReducer should handle initial state 1`] = ` |
||||
|
Object { |
||||
|
"btcTicker": null, |
||||
|
"crypto": "btc", |
||||
|
"currency": "btc", |
||||
|
"tickerLoading": false, |
||||
|
} |
||||
|
`; |
@ -0,0 +1,37 @@ |
|||||
|
import tickerReducer, { |
||||
|
SET_CURRENCY, |
||||
|
GET_TICKER, |
||||
|
RECIEVE_TICKER |
||||
|
} from '../../app/reducers/ticker' |
||||
|
|
||||
|
describe('reducers', () => { |
||||
|
describe('tickerReducer', () => { |
||||
|
it('should handle initial state', () => { |
||||
|
expect(tickerReducer(undefined, {})).toMatchSnapshot() |
||||
|
}) |
||||
|
|
||||
|
it('should have SET_CURRENCY', () => { |
||||
|
expect(SET_CURRENCY).toEqual('SET_CURRENCY') |
||||
|
}) |
||||
|
|
||||
|
it('should have GET_TICKER', () => { |
||||
|
expect(GET_TICKER).toEqual('GET_TICKER') |
||||
|
}) |
||||
|
|
||||
|
it('should have RECIEVE_TICKER', () => { |
||||
|
expect(RECIEVE_TICKER).toEqual('RECIEVE_TICKER') |
||||
|
}) |
||||
|
|
||||
|
it('should correctly setCurrency', () => { |
||||
|
expect(tickerReducer(undefined, { type: SET_CURRENCY, currency: 'foo' })).toMatchSnapshot() |
||||
|
}) |
||||
|
|
||||
|
it('should correctly getTicker', () => { |
||||
|
expect(tickerReducer(undefined, { type: GET_TICKER })).toMatchSnapshot() |
||||
|
}) |
||||
|
|
||||
|
it('should correctly receiveTicker', () => { |
||||
|
expect(tickerReducer(undefined, { type: RECIEVE_TICKER, ticker: 'foo' })).toMatchSnapshot() |
||||
|
}) |
||||
|
}) |
||||
|
}) |
Loading…
Reference in new issue