Skip to content

Commit

Permalink
Add reducer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OlafSzmidt committed May 9, 2018
1 parent 8225623 commit ca15f93
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`<IDEEditor /> matches snapshot 1`] = `
enableBasicAutocompletion={false}
enableLiveAutocompletion={false}
focus={false}
fontSize={14}
fontSize={12}
height="100%"
highlightActiveLine={true}
maxLines={null}
Expand Down
22 changes: 22 additions & 0 deletions game_frontend/src/redux/features/Editor/reducers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,26 @@ describe('editorReducer', () => {
const action = actions.changeCode('class Avatar')
expect(editorReducer({}, action)).toEqual(expectedState)
})

it('should handle ZOOM_IN_REQUEST', () => {
const stateBeforeReducing = {
textSize: 14
}
const expectedState = {
textSize: 16
}
const action = actions.zoomInRequest()
expect(editorReducer(stateBeforeReducing, action)).toEqual(expectedState)
})

it('should handle ZOOM_OUT_REQUEST', () => {
const stateBeforeReducing = {
textSize: 14
}
const expectedState = {
textSize: 12
}
const action = actions.zoomOutRequest()
expect(editorReducer(stateBeforeReducing, action)).toEqual(expectedState)
})
})

0 comments on commit ca15f93

Please sign in to comment.