michaltakac/mathworldvr

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

Summary

Maintainability
A
0 mins
Test Coverage
import reducer from '.'

const initialState = {
  equation: 'x^2 + y^2',
}

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

  it('PARAMETRIC_FUNCTION_SET_EQUATION', () => {
    const next = reducer(initialState, { type: 'PARAMETRIC_FUNCTION_SET_EQUATION', payload: 'x^2 - y^2' })
    expect(next).toMatchSnapshot()
  })
})