import * as actions from '../reporting'
import { ADD_ITEM_ANALYSES,
  ADD_QUIZ_ANALYSIS,
  QUIZ_ANALYSIS_NOT_FOUND,
  ITEM_ANALYSIS_NOT_FOUND,
  TOGGLE_ITEM_ANALYSIS_EXPANDED
} from '@instructure/quiz-common/lib/constants'

describe('reporting actions creators', () => {
  describe('#addQuizAnalysis', () => {
    it('returns a well-formed and correct action', () => {
      expect(actions.addQuizAnalysis({})).to.deep.equal(
        {
          type: ADD_QUIZ_ANALYSIS,
          payload: {}
        }
      )
    })
  })

  describe('#addItemAnalyses', () => {
    it('returns a well-formed and correct action', () => {
      expect(actions.addItemAnalyses([])).to.deep.equal(
        {
          type: ADD_ITEM_ANALYSES,
          payload: []
        }
      )
    })
  })

  describe('#markQuizAnalysisNotFound', () => {
    it('returns a well-formed and correct action', () => {
      expect(actions.markQuizAnalysisNotFound('1')).to.deep.equal(
        {
          type: QUIZ_ANALYSIS_NOT_FOUND,
          payload: '1'
        }
      )
    })
  })

  describe('#markItemAnalysisNotFound', () => {
    it('returns a well-formed and correct action', () => {
      expect(actions.markItemAnalysisNotFound('1')).to.deep.equal(
        {
          type: ITEM_ANALYSIS_NOT_FOUND,
          payload: '1'
        }
      )
    })
  })

  describe('#toggleItemAnalysisRowExpanded', () => {
    it('returns a well-formed and correct action', () => {
      expect(actions.toggleItemAnalysisRowExpanded('1')).to.deep.equal(
        {
          type: TOGGLE_ITEM_ANALYSIS_EXPANDED,
          payload: '1'
        }
      )
    })
  })
})
