Last active
August 29, 2016 18:24
-
-
Save KensoDev/955a0946031d00fb600e0a3e934ab752 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as actions from '../../actions' | |
| import * as types from '../../constants/actionTypes' | |
| import itemTypeReducer from './ItemTypeReducer' | |
| describe('itemTypeReducer', () => { | |
| it('Toggles the Hotel item into the selected array', function() { | |
| let initialState = { | |
| selected: [] | |
| }; | |
| let action = { | |
| itemType: 'Hotel', | |
| type: types.TOGGLE_ITEM_TYPE | |
| }; | |
| let newState = itemTypeReducer(initialState, action); | |
| expect(newState.selected[0]).to.eq("Hotel"); | |
| }); | |
| it('toggles out the Hotel if its already included', function() { | |
| let initialState = { | |
| selected: ['Hotel'] | |
| }; | |
| let action = { | |
| itemType: 'Hotel', | |
| type: types.TOGGLE_ITEM_TYPE | |
| }; | |
| let newState = itemTypeReducer(initialState, action); | |
| expect(newState.selected).to.have.length(0); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment