import { fromJS } from 'immutable'
import { mapStateToProps } from '../index'

describe('connected OutcomeAnalysis', () => {
  const fakeState = fromJS({
    outcomes: {
      contextUuid: 'alphabeta',
      outcomesEndpoint: 'http://outcomes',
      outcomesToken: 'tokenme'
    }
  })

  describe('mapStateToProps', () => {
    it('maps outcomes credentials from state', () => {
      const props = mapStateToProps(fakeState)
      expect(props.contextUuid).to.eq('alphabeta')
      expect(props.outcomesHost).to.eq('http://outcomes')
      expect(props.outcomesToken).to.eq('tokenme')
    })
  })
})
