import {TEMPORARY_STIMULUS_ID} from '@instructure/quiz-common/lib/constants'
import Stimulus from '../Stimulus'

describe('Stimulus Record', () => {
  describe('#constructor', () => {
    it('defaults stimulusType to "text"', () => {
      const stimulus = new Stimulus()
      expect(stimulus.get('stimulusType')).to.eq('text')
    })
  })

  describe('#isTemporary', () => {
    it('is true for a temporary record', () => {
      const stimulus = new Stimulus({id: TEMPORARY_STIMULUS_ID})
      expect(stimulus.isTemporary()).to.be.true()
    })

    it('is false for a temporary record', () => {
      const stimulus = new Stimulus({id: '33'})
      expect(stimulus.isTemporary()).to.be.false()
    })
  })
})
