Skip to content

Commit

Permalink
test profile reducer
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiolcastro committed May 30, 2020
1 parent 0381a0c commit e75887f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/__tests__/store/profile/index.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import profileReducer, { Types } from '../../../store/profile';

describe('Profile Reducers', () => {
it('handle action type ADD_ONG_INCIDENTS', () => {
const action = {
type: Types.ADD_ONG_INCIDENTS,
payload: [{ title: 'Incident 1', value: 100 }, { title: 'Incident 2', value: 45 }],
};

const newReducer = profileReducer({ ongIncidents: [] }, action);

expect(newReducer).toEqual({
ongIncidents: [{ title: 'Incident 1', value: 100 }, { title: 'Incident 2', value: 45 }],
});
});
});

0 comments on commit e75887f

Please sign in to comment.