import * as actions from '../sharedBanks'
import {
  ADD_SHARED_BANKS,
  REMOVE_SHARED_BANK,
  CAN_EDIT
} from '@instructure/quiz-common/lib/constants'

describe('banks actions creators', () => {
  describe('#addShareBank', () => {
    it('returns a well-formed and correct action', () => {
      expect(actions.addSharedBanks({id: 1, uuid: 1, bankId: 2, permission: CAN_EDIT})).to.deep.equal({
        type: ADD_SHARED_BANKS,
        payload: {id: 1, uuid: 1, bankId: 2, permission: CAN_EDIT}
      })
    })
  })
  describe('#removeShareBank', () => {
    it('returns a well-formed and correct action', () => {
      expect(actions.removeSharedBank({id: 1, uuid: 1, bankId: 2, permission: CAN_EDIT})).to.deep.equal({
        type: REMOVE_SHARED_BANK,
        payload: {id: 1, uuid: 1, bankId: 2, permission: CAN_EDIT}
      })
    })
  })
})
