import ResetQuiz from '../presenter'
import Button from '@instructure/ui-buttons/lib/components/Button'

describe('TakeStimulus presenter', () => {

  const defaultProps = {
    reopenOn: true,
    sessionId: '1'
  }

  const testbed = createTestbed(withContext(ResetQuiz), defaultProps)

  it('does not render a Button if reopenOn false', () => {
    testbed.render({ reopenOn: false })
    expect(testbed.findChildrenByType(Button)).to.be.empty()
  })

  it('renders a Button if reopenOn true', () => {
    testbed.render()
    expect(testbed.findChildrenByType(Button)).to.not.be.empty()
  })

  it('renders nothing if reopenOn false', () => {
    testbed.render({ reopenOn: false })
    expect(testbed.findChildrenByTagName('div')).to.be.empty()
  })
})
