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

describe('ModerateTray', () => {
  describe('mapStateToProps', () => {
    it('passes open/closed state to the component', () => {
      [true, false].forEach((open) => {
        const state = fromJS({ moderation: { trayOpen: open } })
        expect(mapStateToProps(state).isOpen).to.equal(open)
      })
    })

    it('passes participantName to the component', () => {
      const name = 'ohai'
      const state = fromJS({ moderation: { selectedParticipantName: name } })
      expect(mapStateToProps(state).participantName).to.equal(name)
    })
  })
})
