import { fromJS } from 'immutable'
import { mapStateToProps } from '../index'
import Quiz from '../../../../../common/records/Quiz'

describe('connected QuizAndItemAnalysis', () => {
  const fakeState = fromJS({
    reporting: {
      item_analysis_row_open:{}
    },
    quizzes: {
      '1': { foo: 'bar'}
    },
    outcomes: {}
  })

  describe('mapStateToProps', () => {
    it('maps active quiz id', () => {
      const props = mapStateToProps(fakeState, { activeQuizId: '1' })
      expect(props.quiz).to.deep.eq(Quiz.create({ foo: 'bar' }))
    })
  })
})
