Skip to content

Commit

Permalink
fix: adds missing alt to icon
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelflips committed Jun 28, 2024
1 parent 3fe236e commit f54fa8a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/components/pds-icon/pds-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export class PdsIcon {

<Host
aria-label={ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null }
alt=""
role="img"
style={style}
class={{
Expand Down
2 changes: 1 addition & 1 deletion src/components/pds-icon/test/pds-icon.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('pds-icon', () => {
it('renders', async () => {
const page = await newE2EPage();

await page.setContent('<pds-icon role="img" style="height: 16px; width: 16px;"></pds-icon>');
await page.setContent('<pds-icon alt="" role="img" style="height: 16px; width: 16px;"></pds-icon>');
const element = await page.find('pds-icon');
expect(element).toHaveClass('hydrated');
});
Expand Down
8 changes: 4 additions & 4 deletions src/components/pds-icon/test/pds-icon.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('pds-icon', () => {
html: '<pds-icon></pds-icon>',
});
expect(root).toEqualHtml(`
<pds-icon role="img" size="regular" style="height: 16px; width: 16px;">
<pds-icon alt="" role="img" size="regular" style="height: 16px; width: 16px;">
<mock:shadow-root>
<div class="icon-inner"></div>
</mock:shadow-root>
Expand All @@ -22,7 +22,7 @@ describe('pds-icon', () => {
html: '<pds-icon size="small"></pds-icon>',
});
expect(root).toEqualHtml(`
<pds-icon role="img" size="small" style="height: 12px; width: 12px;">
<pds-icon alt="" role="img" size="small" style="height: 12px; width: 12px;">
<mock:shadow-root>
<div class="icon-inner"></div>
</mock:shadow-root>
Expand All @@ -36,7 +36,7 @@ describe('pds-icon', () => {
html: '<pds-icon size="32px"></pds-icon>',
});
expect(root).toEqualHtml(`
<pds-icon role="img" size="32px" style="height: 32px; width: 32px;">
<pds-icon alt="" role="img" size="32px" style="height: 32px; width: 32px;">
<mock:shadow-root>
<div class="icon-inner"></div>
</mock:shadow-root>
Expand All @@ -50,7 +50,7 @@ describe('pds-icon', () => {
html: '<pds-icon name="archive"></pds-icon>',
});
expect(root).toEqualHtml(`
<pds-icon aria-label="archive" name="archive" role="img" size="regular" style="height: 16px; width: 16px;">
<pds-icon alt="" aria-label="archive" name="archive" role="img" size="regular" style="height: 16px; width: 16px;">
<mock:shadow-root>
<div class="icon-inner"></div>
</mock:shadow-root>
Expand Down

0 comments on commit f54fa8a

Please sign in to comment.