UNPKG

@instructure/quiz-interactions

Version:

A React UI component Library for quiz interaction types.

44 lines (38 loc) 1.01 kB
import React from 'react' import {expect} from '@instructure/ui-test-utils' import FileUploadResult from '../index' import {render, screen} from '@testing-library/react' import runAxeCheck from '@instructure/ui-axe-check' describe('File Upload Result', () => { const defaultProps = { itemBody: 'STEM', interactionData: { filesCount: 1, restrictCount: false, }, scoredData: { value: [ { id: 1, name: 'File', url: 'http://example.com/file.txt', size: 3184, }, ], }, } it('renders a filelist', () => { render(<FileUploadResult {...defaultProps} />) expect(screen.queryByRole('button', {name: /File 3Kb/i})).to.not.be.null() }) describe('a11y tests', () => { it('should meet a11y standards', async () => { render( <main> <FileUploadResult {...defaultProps} /> </main>, ) expect(await runAxeCheck(document.body)).to.be.true() }) }) })