import {
  toggleSidebar,
  setSidebarStimulusIsShowing
} from '../sidebar'

import {
  TOGGLE_SIDEBAR,
  SET_SIDEBAR_STIMULUS_IS_SHOWING
} from '@instructure/quiz-common/lib/constants'

describe('sidebar action creators', () => {
  it('returns a well-formed toggle sidebar action', () => {
    const toggleSidebarAction = toggleSidebar('12')

    expect(toggleSidebarAction)
      .to.deep.equal({
        type: TOGGLE_SIDEBAR
      })
  })

  it('returns a well-formed setSidebarStimulusIsShowing action', () => {
    const action = setSidebarStimulusIsShowing('1', false)
    expect(action).to.deep.eq({
      type: SET_SIDEBAR_STIMULUS_IS_SHOWING,
      payload: {stimulusId: '1', bool: false}
    })
  })
})
