
import {Map} from 'immutable'
import Item from '../../../../../records/Item'

import EntrySave from '../index'

describe('EntrySave', () => {
  const ConnectedItemEdit = withContext(EntrySave)
  const item = new Item({
    id: '666',
    title: 'Tough Color Question',
    itemBody: 'Which color is happiest?',
    scoringData: {
      value: 'id'
    }
  })
  sinon.stub(item, 'getWorkingInstance').returns(item)
  const testbed = createTestbed(ConnectedItemEdit, {
    entry: item,
    errorsShowing: Map(),
    isValid: true,
    isEditing: true,
    editable: true,
    clearChanges: sinon.stub()
  })

  useFakeFetching({dispatchStub: sinon.stub(),
    getStateStub: sinon.stub(),
    fetchStub: sinon.stub()})

  shouldRenderComponent(testbed, {}, EntrySave)
})
