Created
October 25, 2016 02:50
-
-
Save dapperAuteur/6bcc5fb54cb2f7cfba23ddcfefed7f0c to your computer and use it in GitHub Desktop.
This file contains 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 { Map } from 'immutable'; | |
import { expect } from 'chai'; | |
import reducer from '../app/reducer'; | |
describe('reducer', () => { | |
describe("SETUP_GAME", () => { | |
const action = { | |
type: 'SETUP_GAME' | |
}; | |
describe("with empty initial state", () => { | |
//const initialState = undefined; | |
const initialState = new Map({'awayTeam': 0, 'homeTeam': 0, 'balls': 0, 'strikes': 0, 'fouls': 0, 'outs': 0, 'inning': 1}) | |
const nextState = reducer(initialState, action); | |
it('sets up game', () => { | |
expect(nextState.get('awayTeam')).to.eq(0); | |
expect(nextState.get('homeTeam')).to.eq(0); | |
expect(nextState.get('balls')).to.eq(0); | |
expect(nextState.get('strikes')).to.eq(0); | |
expect(nextState.get('fouls')).to.eq(0); | |
expect(nextState.get('outs')).to.eq(0); | |
expect(nextState.get('inning')).to.eq(1); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment