Skip to content

Commit

Permalink
add reducer unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mocheng committed Jan 13, 2017
1 parent 6c3b9eb commit b89356e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions chapter-07/weather_redux/test/weather/reducer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import * as actions from '../../src/weather/actions.js';
import * as actionTypes from '../../src/weather/actionTypes.js';
import * as Status from '../../src/weather/status.js';
import reducer from '../../src/weather/reducer.js';

describe('weather/reducer', () => {
it('should return loading status', () => {
const action = actions.fetchWeatherStarted();

const newState = reducer({}, action);

expect(newState.status).toBe(Status.LOADING);
});
});

0 comments on commit b89356e

Please sign in to comment.