Test cases: 9 passing, 16 failing, 1 warning (26 total)
This page contains various link elements to test accessible name computation according to WCAG guidelines.
This link has descriptive text that clearly explains where it leads.
Contact our support team<a id="link-descriptive-pass" href="https://example.com/contact">Contact our support team</a>
This link has both an icon and text, which together form its accessible name.
🏠 Return to homepage<a id="link-icon-text-pass" href="https://example.com/home" class="icon-link"><span>🏠</span> Return to homepage</a>
This link has an aria-label attribute that provides a more descriptive name than its visual text.
Products<a id="link-aria-label-pass" href="https://example.com/products" aria-label="View all available products and services">Products</a>
This link uses aria-labelledby to reference text elsewhere on the page for its accessible name.
Search the knowledge base 🔍<span id="search-label">Search the knowledge base</span>
<a id="link-aria-labelledby-pass" href="https://example.com/search" aria-labelledby="search-label">🔍</a>
This link has no text content or accessible name.
<a id="link-empty-fail" href="https://example.com"></a>
This link has generic text that doesn't explain its purpose or destination.
Click here<a id="link-click-here-fail" href="https://example.com/about">Click here</a>
This link has generic text that doesn't explain its purpose or destination.
Read more<a id="link-read-more-fail" href="https://example.com/article">Read more</a>
This link uses a raw URL as its text, which can be difficult for screen readers to process. This is a best practice issue, not a WCAG requirement.
https://example.com/policy<a id="link-raw-url-warn" href="https://example.com/policy">https://example.com/policy</a>
This link has only an icon with no accessible name.
⚙️<a id="link-icon-only-fail" href="https://example.com/settings" class="icon-link">⚙️</a>
This link has an empty aria-label attribute.
FAQ<a id="link-empty-arialabel-fail" href="https://example.com/faq" aria-label="">FAQ</a>
This link has an aria-labelledby attribute pointing to an ID that doesn't exist.
Support<a id="link-broken-labelledby-fail" href="https://example.com/support" aria-labelledby="non-existent-id">Support</a>
This link contains only whitespace characters, which doesn't provide a proper accessible name.
<a id="link-whitespace-fail" href="https://example.com/blank"> </a>
The following tests use <div role="link"> or <span role="link"> instead of semantic anchor elements.
This div with role="link" has descriptive text that explains its purpose.
<div id="aria-link-text-pass" role="link" tabindex="0">Download our annual report</div>
This span with role="link" has both an icon and text, which together form its accessible name.
📧 Contact us via email<span id="aria-link-icon-text-pass" role="link" tabindex="0" class="icon-link"><span>📧</span> Contact us via email</span>
This div with role="link" has an aria-label attribute that provides its accessible name.
<div id="aria-link-arialabel-pass" role="link" tabindex="0" aria-label="Find us on social media">Social</div>
This div with role="link" uses aria-labelledby to reference text elsewhere on the page for its accessible name.
Download latest version<span id="download-label">Download latest version</span>
<div id="aria-link-labelledby-pass" role="link" tabindex="0" aria-labelledby="download-label">↓</div>
This div with role="link" has no text content or accessible name.
<div id="aria-link-empty-fail" role="link" tabindex="0"></div>
This div with role="link" has generic text that doesn't describe its purpose.
<div id="aria-link-generic-text-fail" role="link" tabindex="0">Click here</div>
This div with role="link" has only an icon but no accessible name.
<div id="aria-link-icon-only-fail" role="link" tabindex="0" class="icon-link">🔗</div>
This div with role="link" has an empty aria-label attribute.
<div id="aria-link-empty-arialabel-fail" role="link" tabindex="0" aria-label="">Help</div>
This div with role="link" has an aria-labelledby attribute pointing to an ID that doesn't exist.
<div id="aria-link-broken-labelledby-fail" role="link" tabindex="0" aria-labelledby="non-existent-id-aria">Docs</div>
This div with role="link" contains only whitespace characters, which doesn't provide a proper accessible name.
<div id="aria-link-whitespace-fail" role="link" tabindex="0"> </div>
This div with role="link" has an aria-label with only punctuation, which may not be announced by some screen readers.
<div id="aria-link-punctuation-arialabel-fail" role="link" tabindex="0" aria-label="..."></div>