Skip to content

Commit

Permalink
Added axe tests to form controls, error boundaries and inner text doc…
Browse files Browse the repository at this point in the history
… pages
  • Loading branch information
mridulgogia authored Mar 24, 2020
1 parent 0def6f1 commit dcbcccc
Show file tree
Hide file tree
Showing 6 changed files with 217 additions and 40 deletions.
3 changes: 3 additions & 0 deletions scripts/a11y-testing.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const docsPages = async (root, page) => {
`${root}#/display/title`,
`${root}#/display/toast`,
`${root}#/display/tooltip`,
`${root}#/forms/form-controls`,
`${root}#/forms/form-layouts`,
`${root}#/forms/form-validation`,
`${root}#/forms/code-editor`,
Expand Down Expand Up @@ -74,6 +75,8 @@ const docsPages = async (root, page) => {
`${root}#/utilities/delay-hide`,
`${root}#/utilities/delay-render`,
`${root}#/utilities/highlight`,
`${root}#/utilities/error-boundary`,
`${root}#/utilities/inner-text`,
];

links = [...links, ...reflinks];
Expand Down
1 change: 1 addition & 0 deletions src-docs/src/views/form_controls/file_picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export class FilePicker extends Component {
this.onChange(files);
}}
display={this.state.large ? 'large' : 'default'}
aria-label="Use aria labels when no actual label is in use"
/>
</DisplayToggles>
<EuiSpacer />
Expand Down
78 changes: 65 additions & 13 deletions src-docs/src/views/form_controls/form_control_layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,57 +11,93 @@ import {
export default () => (
<Fragment>
<EuiFormControlLayout icon="search">
<input type="text" className="euiFieldText" />
<input
type="text"
className="euiFieldText"
aria-label="Use aria labels when no actual label is in use"
/>
</EuiFormControlLayout>

<EuiSpacer size="m" />

<EuiFormControlLayout isLoading>
<input type="text" className="euiFieldText" />
<input
type="text"
className="euiFieldText"
aria-label="Use aria labels when no actual label is in use"
/>
</EuiFormControlLayout>

<EuiSpacer size="m" />

<EuiFormControlLayout clear={{ onClick: () => {} }}>
<input type="text" className="euiFieldText" />
<input
type="text"
className="euiFieldText"
aria-label="Use aria labels when no actual label is in use"
/>
</EuiFormControlLayout>

<EuiSpacer size="m" />

<EuiFormControlLayout isLoading clear={{ onClick: () => {} }}>
<input type="text" className="euiFieldText" />
<input
type="text"
className="euiFieldText"
aria-label="Use aria labels when no actual label is in use"
/>
</EuiFormControlLayout>

<EuiSpacer size="m" />

<EuiFormControlLayout isLoading icon="search">
<input type="text" className="euiFieldText" />
<input
type="text"
className="euiFieldText"
aria-label="Use aria labels when no actual label is in use"
/>
</EuiFormControlLayout>

<EuiSpacer size="m" />

<EuiFormControlLayout isLoading icon={{ type: 'arrowDown', side: 'right' }}>
<input type="text" className="euiFieldText" />
<input
type="text"
className="euiFieldText"
aria-label="Use aria labels when no actual label is in use"
/>
</EuiFormControlLayout>

<EuiSpacer size="m" />

<EuiFormControlLayout clear={{ onClick: () => {} }} icon="search">
<input type="text" className="euiFieldText" />
<input
type="text"
className="euiFieldText"
aria-label="Use aria labels when no actual label is in use"
/>
</EuiFormControlLayout>

<EuiSpacer size="m" />

<EuiFormControlLayout
clear={{ onClick: () => {} }}
icon={{ type: 'arrowDown', side: 'right' }}>
<input type="text" className="euiFieldText" />
<input
type="text"
className="euiFieldText"
aria-label="Use aria labels when no actual label is in use"
/>
</EuiFormControlLayout>

<EuiSpacer size="m" />

<EuiFormControlLayout isLoading clear={{ onClick: () => {} }} icon="search">
<input type="text" className="euiFieldText" />
<input
type="text"
className="euiFieldText"
aria-label="Use aria labels when no actual label is in use"
/>
</EuiFormControlLayout>

<EuiSpacer size="m" />
Expand All @@ -70,13 +106,21 @@ export default () => (
isLoading
clear={{ onClick: () => {} }}
icon={{ type: 'arrowDown', side: 'right' }}>
<input type="text" className="euiFieldText" />
<input
type="text"
className="euiFieldText"
aria-label="Use aria labels when no actual label is in use"
/>
</EuiFormControlLayout>

<EuiSpacer size="m" />

<EuiFormControlLayout isLoading clear={{ onClick: () => {} }} icon="search">
<input type="text" className="euiFieldText" />
<input
type="text"
className="euiFieldText"
aria-label="Use aria labels when no actual label is in use"
/>
</EuiFormControlLayout>

<EuiSpacer size="m" />
Expand Down Expand Up @@ -111,7 +155,11 @@ export default () => (
<strong>%</strong>
</EuiText>
}>
<input type="number" className="euiFieldNumber euiFieldNumber--inGroup" />
<input
type="number"
className="euiFieldNumber euiFieldNumber--inGroup"
aria-label="Use aria labels when no actual label is in use"
/>
</EuiFormControlLayout>

<EuiSpacer size="m" />
Expand All @@ -124,7 +172,11 @@ export default () => (
Button
</EuiButtonEmpty>
}>
<input type="text" className="euiFieldText euiFieldText--inGroup" />
<input
type="text"
className="euiFieldText euiFieldText--inGroup"
aria-label="Use aria labels when no actual label is in use"
/>
</EuiFormControlLayout>
</Fragment>
);
Loading

0 comments on commit dcbcccc

Please sign in to comment.