import { QuizInstructions } from '../Instructions'
import styles from '../styles.css'

import Quiz from '../../../../../records/Quiz'

describe('QuizInstructions', () => {
  const testbed = createTestbed(QuizInstructions, {
    quiz: new Quiz({id: '3'}),
    actions: {
      persistModification: () => {},
      saveQuizChange: () => {}
    }
  })

  shouldRenderComponent(
    testbed,
    {},
    QuizInstructions
  )

  it('should render quiz instructions preview', () => {
    testbed.render()
    // refs aren't working for some reason, so using class finders as a backup
    // not ideal though
    const previewComponentNode = testbed.findChildrenByClass(
      styles.wrapper
    )[0]

    expect(previewComponentNode).to.not.be.undefined()
  })

  describe('a11y tests', () => {
    it('should meet a11y standards', (done) => {
      testbed.render()
      testbed.checkA11yStandards(done)
    })
  })
})
