@instructure/quiz-interactions
Version:
A React UI component Library for quiz interaction types.
45 lines (40 loc) • 1.28 kB
JavaScript
import React from 'react'
import {expect, mount, accessible} from '@instructure/ui-test-utils'
import EssayShow from '../index'
const interactionData = {
rce: true,
spellCheck: true,
wordCount: true,
wordLimitEnabled: true,
wordLimitMax: 10,
wordLimitMin: 1,
notes: 'Teachers grading notes',
}
describe('Essay Show', async () => {
describe('rendering', async () => {
it('renders the show component', async () => {
const subject = await mount(
<EssayShow itemBody="Lorem ipsum blah blah" interactionData={interactionData} />,
)
expect(subject.getDOMNode()).to.exist()
})
})
describe('a11y tests', async () => {
it('should meet a11y standards', async () => {
const subject = await mount(
<EssayShow itemBody="Lorem ipsum blah blah" interactionData={interactionData} />,
)
expect(
await accessible(subject.getDOMNode(), {
ignores: [
'aria-allowed-role', // remove this when canvas-rce is fixed
'button-name',
'region',
'aria-valid-attr-value',
'scrollable-region-focusable', // we conditionally make rceRenderer focusable when we detect content overflow
],
}),
).to.be.true()
})
})
})