import {
  ADD_FEATURES,
  REMOVE_FEATURES
} from '@instructure/quiz-common/lib/constants'

import {
  addFeatures,
  removeFeatures
} from '../features'

describe('features action creators', () => {
  it('returns a well-formed add feature action', () => {
    const featuresList = ['feature1', 'feature2']
    const action = addFeatures(featuresList)

    expect(action).to.deep.equal(
      {
        type: ADD_FEATURES,
        payload: featuresList
      }
    )
  })

  it('returns a well-formed remove feature action', () => {
    const featuresToRemove = ['feature1', 'feature2']
    const action = removeFeatures(featuresToRemove)

    expect(action).to.deep.equal(
      {
        type: REMOVE_FEATURES,
        payload: featuresToRemove
      }
    )
  })
})
