michaltakac/mathworldvr

View on GitHub
src/reducers/user/index.test.js

Summary

Maintainability
B
4 hrs
Test Coverage
import reducer from '.'

const initialState = {
  position: { x: 0, y: 0, z: 0 },
}

describe('user', () => {
  it('should return the initial state', () => {
    const next = reducer(initialState, {})
    expect(next).toEqual(initialState)
  })

  it('USER_SET_POSITION', () => {
    const next = reducer(initialState, { type: 'USER_SET_POSITION', payload: { x: 10, y: 0, z: 10 } })
    expect(next).toMatchSnapshot()
  })
})