import { addQtiImports, clearQtiImports } from '../qtiImports'
import { ADD_QTI_IMPORTS, CLEAR_QTI_IMPORTS } from '@instructure/quiz-common/lib/constants'

describe('qtiImports actions creators', () => {
  it('returns a well-formed addQtiImports action', () => {
    const qtiImports = [
      {id: 1, status: 'started', parentId: '1', parentType: 'Quiz'},
      {id: 2, status: 'started', parentId: '2', parentType: 'Quiz'}
    ]
    const addImportsAction = addQtiImports(qtiImports)
    const expectedAction = {type: ADD_QTI_IMPORTS, payload: qtiImports}

    expect(addImportsAction).to.deep.equal(expectedAction)
  })

  it('returns a well-formed clearQtiImports action', () => {
    const addImportsAction = clearQtiImports()
    const expectedAction = {type: CLEAR_QTI_IMPORTS}

    expect(addImportsAction).to.deep.equal(expectedAction)
  })
})
