import {
  closeTray,
  onTrayClosed,
  openTray
} from '../moderation'

import {
  CLOSE_MODERATE_TRAY,
  MODERATE_TRAY_CLOSED,
  OPEN_MODERATE_TRAY
} from '@instructure/quiz-common/lib/constants'

describe('closeTray', () => {
  it('returns a CLOSE_MODERATE_TRAY action', () => {
    expect(closeTray().type).to.equal(CLOSE_MODERATE_TRAY)
  })
})

describe('onTrayClosed', () => {
  it('returns a MODERATE_TRAY_CLOSED action', () => {
    expect(onTrayClosed().type).to.equal(MODERATE_TRAY_CLOSED)
  })
})

describe('openTray', () => {
  it('returns an OPEN_MODERATE_TRAY action', () => {
    expect(openTray().type).to.equal(OPEN_MODERATE_TRAY)
  })

  it('includes the selected participant', () => {
    const participant = 'participant'
    expect(openTray(participant).participant).to.equal(participant)
  })
})
