created:3/5/2021
updated:3/5/2021
loc
48
comments
13%
passed
14
coverage
33%

Source

avatar of atanasster

Syntax highliting source code component. Uses prism for the actual source display.

Tests results

Status
Full name
Title
Time(ms)
Source.test.ts(14 tests)
passed
Source > overview > 1
snapshot
488
passed
Source > overview > 1
accessibility
255
passed
Source > overview > 2
snapshot
151
passed
Source > overview > 2
accessibility
580
passed
Source > overview > 3
snapshot
78
passed
Source > overview > 3
accessibility
269
passed
Source > overview > 4
snapshot
127
passed
Source > overview > 4
accessibility
183
passed
Source > overview > 5
snapshot
231
total 14 tests

Tests coverage

Kind
Total
Covered
Skipped
%
Source.tsx
lines
17
12
0
70.58%
functions
3
1
0
33.33%
statements
19
13
0
68.42%
branches
7
4
0
57.14%

A11y tests

export const sample = () => {
const [state, setState] = React.useState(false);
return (
<BooleanEditor
name="prop"
onChange={(name, newVal) => setState(newVal)}
prop={{ type: ControlTypes.BOOLEAN, value: state }}
/>
);
};
 
id
description
aria-allowed-attr

Ensures ARIA attributes are allowed for an element's role...

aria-valid-attr-value

Ensures all ARIA attributes have valid values...

aria-valid-attr

Ensures attributes that begin with aria- are valid ARIA attributes...

avoid-inline-spacing

Ensure that text spacing set through style attributes can be adjusted with custom stylesheets...

button-name

Ensures buttons have discernible text...

color-contrast

Ensures the contrast between foreground and background colors meets WCAG 2 AA contrast ratio thresholds...

nested-interactive

Ensure controls are not nested as they are not announced by screen readers...

Viewport

export const sample = () => {
const [state, setState] = React.useState(false);
return (
<BooleanEditor
name="prop"
onChange={(name, newVal) => setState(newVal)}
prop={{ type: ControlTypes.BOOLEAN, value: state }}
/>
);
};
320px
export const sample = () => {
const [state, setState] = React.useState(false);
return (
<BooleanEditor
name="prop"
onChange={(name, newVal) => setState(newVal)}
prop={{ type: ControlTypes.BOOLEAN, value: state }}
/>
);
};
375px
export const sample = () => {
const [state, setState] = React.useState(false);
return (
<BooleanEditor
name="prop"
onChange={(name, newVal) => setState(newVal)}
prop={{ type: ControlTypes.BOOLEAN, value: state }}
/>
);
};
768px
export const sample = () => {
const [state, setState] = React.useState(false);
return (
<BooleanEditor
name="prop"
onChange={(name, newVal) => setState(newVal)}
prop={{ type: ControlTypes.BOOLEAN, value: state }}
/>
);
};
1024px