import Fetcher from '../../util/Fetcher'

import { interactionTypeFetch } from '../interactionTypes'

describe('interaction types api action', () => {
  describe('interactionTypeFetch', () => {
    const fetchStub = sinon.stub()
    const dispatchStub = sinon.stub()
    const getStateStub = sinon.stub()

    useFakeFetching({ dispatchStub, getStateStub, fetchStub })

    it('hits the correct url', () => {
      const expectedUrl = '/api/interaction_types'
      Fetcher.fakeFetch = fetchStub

      interactionTypeFetch()(dispatchStub, getStateStub)
      expect(fetchStub.calledWith(expectedUrl)).to.be.true()
    })
  })
})
