fix accessibility issues

report challenges' completion state and remove <code> tag in test suite
This commit is contained in:
huyenltnguyen
2018-07-05 22:27:00 +07:00
committed by Mrugesh Mohapatra
parent d8bee6a7ad
commit c6c1e347d0
3 changed files with 77 additions and 70 deletions

View File

@ -13,6 +13,7 @@ const propTypes = {
function getAccessibleText(err, pass, text) { function getAccessibleText(err, pass, text) {
let accessibleText = 'Waiting'; let accessibleText = 'Waiting';
const cleanText = text.replace(/<\/?code>/g, '');
// Determine test status (i.e. icon) // Determine test status (i.e. icon)
if (err) { if (err) {
@ -22,7 +23,7 @@ function getAccessibleText(err, pass, text) {
} }
// Append the text itself // Append the text itself
return accessibleText + ' - ' + text; return accessibleText + ' - ' + cleanText;
} }
function TestSuite({ tests }) { function TestSuite({ tests }) {

View File

@ -1,9 +1,11 @@
import React from 'react'; import React, { Fragment } from 'react';
const propTypes = {}; const propTypes = {};
function GreenNotCompleted(props) { function GreenNotCompleted(props) {
return ( return (
<Fragment>
<span className='sr-only'>Not Passed</span>
<svg <svg
height='50' height='50'
viewBox='0 0 200 200' viewBox='0 0 200 200'
@ -26,6 +28,7 @@ function GreenNotCompleted(props) {
/> />
</g> </g>
</svg> </svg>
</Fragment>
); );
} }

View File

@ -1,7 +1,9 @@
import React from 'react'; import React, { Fragment } from 'react';
function GreenPass(props) { function GreenPass(props) {
return ( return (
<Fragment>
<span className='sr-only'>Passed</span>
<svg <svg
height='50' height='50'
viewBox='0 0 200 200' viewBox='0 0 200 200'
@ -47,6 +49,7 @@ function GreenPass(props) {
/> />
</g> </g>
</svg> </svg>
</Fragment>
); );
} }