Skip to content

Commit

Permalink
[A11y] Render aria-label as text in the icon testenv file (#5709)
Browse files Browse the repository at this point in the history
* [A11y] Removed `aria-label` from icon `testenv` file

* [A11y] Update icon `testenv` file to render `aria-label` as text

* [A11y] Updated the changelog

* Fixed changelog file

* Updated test snapshots
  • Loading branch information
yuliacech authored Mar 14, 2022
1 parent dadd420 commit c7b8818
Show file tree
Hide file tree
Showing 19 changed files with 201 additions and 130 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## [`main`](https://github.com/elastic/eui/tree/main)

- Updated `testenv` mock for `EuiIcon` to render `aria-label` as text ([#5709](https://github.com/elastic/eui/pull/5709))

**Breaking changes**

- Removed Legacy theme including compiled CSS ([#5688](https://github.com/elastic/eui/pull/5688))
Expand Down
20 changes: 12 additions & 8 deletions src/components/avatar/__snapshots__/avatar.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ exports[`EuiAvatar props iconType and iconColor as null is rendered 1`] = `
title="name"
>
<span
aria-label="name"
class="euiAvatar__icon"
data-euiicon-type="bolt"
/>
>
name
</span>
</div>
`;

Expand All @@ -105,11 +106,12 @@ exports[`EuiAvatar props iconType and iconColor is rendered 1`] = `
title="name"
>
<span
aria-label="name"
class="euiAvatar__icon"
color="primary"
data-euiicon-type="bolt"
/>
>
name
</span>
</div>
`;

Expand All @@ -122,11 +124,12 @@ exports[`EuiAvatar props iconType and iconSize is rendered 1`] = `
title="name"
>
<span
aria-label="name"
class="euiAvatar__icon"
color="#000000"
data-euiicon-type="bolt"
/>
>
name
</span>
</div>
`;

Expand All @@ -139,11 +142,12 @@ exports[`EuiAvatar props iconType is rendered 1`] = `
title="name"
>
<span
aria-label="name"
class="euiAvatar__icon"
color="#000000"
data-euiicon-type="bolt"
/>
>
name
</span>
</div>
`;

Expand Down
70 changes: 42 additions & 28 deletions src/components/control_bar/__snapshots__/control_bar.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ exports[`EuiControlBar is rendered 1`] = `
class="euiControlBar__divider"
/>
<span
aria-label="Sample Icon"
class="euiControlBar__icon"
color="danger"
data-euiicon-type="alert"
/>
>
Sample Icon
</span>
<div
class="euiControlBar__spacer"
/>
Expand Down Expand Up @@ -214,11 +215,12 @@ exports[`EuiControlBar props leftOffset is rendered 1`] = `
class="euiControlBar__divider"
/>
<span
aria-label="Sample Icon"
class="euiControlBar__icon"
color="danger"
data-euiicon-type="alert"
/>
>
Sample Icon
</span>
<div
class="euiControlBar__spacer"
/>
Expand Down Expand Up @@ -387,11 +389,12 @@ exports[`EuiControlBar props leftOffset is rendered 1`] = `
type="alert"
>
<span
aria-label="Sample Icon"
className="euiControlBar__icon"
color="danger"
data-euiicon-type="alert"
/>
>
Sample Icon
</span>
</EuiIcon>
<div
className="euiControlBar__spacer"
Expand Down Expand Up @@ -554,11 +557,12 @@ exports[`EuiControlBar props maxHeight is rendered 1`] = `
class="euiControlBar__divider"
/>
<span
aria-label="Sample Icon"
class="euiControlBar__icon"
color="danger"
data-euiicon-type="alert"
/>
>
Sample Icon
</span>
<div
class="euiControlBar__spacer"
/>
Expand Down Expand Up @@ -727,11 +731,12 @@ exports[`EuiControlBar props maxHeight is rendered 1`] = `
type="alert"
>
<span
aria-label="Sample Icon"
className="euiControlBar__icon"
color="danger"
data-euiicon-type="alert"
/>
>
Sample Icon
</span>
</EuiIcon>
<div
className="euiControlBar__spacer"
Expand Down Expand Up @@ -893,11 +898,12 @@ exports[`EuiControlBar props mobile is rendered 1`] = `
class="euiControlBar__divider"
/>
<span
aria-label="Sample Icon"
class="euiControlBar__icon"
color="danger"
data-euiicon-type="alert"
/>
>
Sample Icon
</span>
<div
class="euiControlBar__spacer"
/>
Expand Down Expand Up @@ -1066,11 +1072,12 @@ exports[`EuiControlBar props mobile is rendered 1`] = `
type="alert"
>
<span
aria-label="Sample Icon"
className="euiControlBar__icon"
color="danger"
data-euiicon-type="alert"
/>
>
Sample Icon
</span>
</EuiIcon>
<div
className="euiControlBar__spacer"
Expand Down Expand Up @@ -1310,11 +1317,12 @@ exports[`EuiControlBar props position is rendered 1`] = `
type="alert"
>
<span
aria-label="Sample Icon"
className="euiControlBar__icon"
color="danger"
data-euiicon-type="alert"
/>
>
Sample Icon
</span>
</EuiIcon>
<div
className="euiControlBar__spacer"
Expand Down Expand Up @@ -1461,11 +1469,12 @@ exports[`EuiControlBar props rightOffset is rendered 1`] = `
class="euiControlBar__divider"
/>
<span
aria-label="Sample Icon"
class="euiControlBar__icon"
color="danger"
data-euiicon-type="alert"
/>
>
Sample Icon
</span>
<div
class="euiControlBar__spacer"
/>
Expand Down Expand Up @@ -1634,11 +1643,12 @@ exports[`EuiControlBar props rightOffset is rendered 1`] = `
type="alert"
>
<span
aria-label="Sample Icon"
className="euiControlBar__icon"
color="danger"
data-euiicon-type="alert"
/>
>
Sample Icon
</span>
</EuiIcon>
<div
className="euiControlBar__spacer"
Expand Down Expand Up @@ -1800,11 +1810,12 @@ exports[`EuiControlBar props showContent is rendered 1`] = `
class="euiControlBar__divider"
/>
<span
aria-label="Sample Icon"
class="euiControlBar__icon"
color="danger"
data-euiicon-type="alert"
/>
>
Sample Icon
</span>
<div
class="euiControlBar__spacer"
/>
Expand Down Expand Up @@ -1978,11 +1989,12 @@ exports[`EuiControlBar props showContent is rendered 1`] = `
type="alert"
>
<span
aria-label="Sample Icon"
className="euiControlBar__icon"
color="danger"
data-euiicon-type="alert"
/>
>
Sample Icon
</span>
</EuiIcon>
<div
className="euiControlBar__spacer"
Expand Down Expand Up @@ -2149,11 +2161,12 @@ exports[`EuiControlBar props size is rendered 1`] = `
class="euiControlBar__divider"
/>
<span
aria-label="Sample Icon"
class="euiControlBar__icon"
color="danger"
data-euiicon-type="alert"
/>
>
Sample Icon
</span>
<div
class="euiControlBar__spacer"
/>
Expand Down Expand Up @@ -2322,11 +2335,12 @@ exports[`EuiControlBar props size is rendered 1`] = `
type="alert"
>
<span
aria-label="Sample Icon"
className="euiControlBar__icon"
color="danger"
data-euiicon-type="alert"
/>
>
Sample Icon
</span>
</EuiIcon>
<div
className="euiControlBar__spacer"
Expand Down
Loading

0 comments on commit c7b8818

Please sign in to comment.