Skip to content

Commit

Permalink
Merge pull request #194 from jes708/test-reducers
Browse files Browse the repository at this point in the history
For Jansen's Reference - Test reducers
  • Loading branch information
jancodes committed Aug 24, 2016
2 parents 203c30f + b8b0063 commit fd7b1e5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 222 deletions.
222 changes: 0 additions & 222 deletions .eslintrc

This file was deleted.

24 changes: 24 additions & 0 deletions browser/js/reducers/assessments/__tests__/assessments.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use strict'

import { expect } from 'chai'
import { byId, isFetching } from '../index'

describe('Assessments Reducer', () => {

describe('byId', () => {
const id = '1'
const assessment = { id, name: 'Test' }
const loadAction = { type: 'LOAD_ASSESSMENTS_SUCCESS', assessments: [assessment] }

it('provides the initial state', () => {
expect(byId(undefined, {})).to.deep.equal({})
})

it('handles LOAD_ASSESSMENTS_SUCCESS action', () => {
const nextState = byId(undefined, loadAction)
expect(nextState[id]).to.deep.equal(assessment)
})

})
})

0 comments on commit fd7b1e5

Please sign in to comment.