Add descriptions to ambiguous links for screen readers (#7310)
* add title to room share link Signed-off-by: Kerry Archibald <kerrya@element.io> * add ExternalLink component Signed-off-by: Kerry Archibald <kerrya@element.io> * unit test ExternalLink Signed-off-by: Kerry Archibald <kerrya@element.io> * default target and rel for external link Signed-off-by: Kerry Archibald <kerrya@element.io> * use scss $font variables Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
parent
d7a6e3ec65
commit
1216285ed2
9 changed files with 160 additions and 8 deletions
|
@ -0,0 +1,36 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`<ExternalLink /> renders link correctly 1`] = `
|
||||
<a
|
||||
class="mx_ExternalLink myCustomClass"
|
||||
data-test-id="test"
|
||||
href="test.com"
|
||||
rel="noopener"
|
||||
target="_self"
|
||||
>
|
||||
<span>
|
||||
react element
|
||||
<b>
|
||||
children
|
||||
</b>
|
||||
</span>
|
||||
<i
|
||||
class="mx_ExternalLink_icon"
|
||||
/>
|
||||
</a>
|
||||
`;
|
||||
|
||||
exports[`<ExternalLink /> renders plain text link correctly 1`] = `
|
||||
<a
|
||||
class="mx_ExternalLink myCustomClass"
|
||||
data-test-id="test"
|
||||
href="test.com"
|
||||
rel="noreferrer noopener"
|
||||
target="_blank"
|
||||
>
|
||||
test
|
||||
<i
|
||||
class="mx_ExternalLink_icon"
|
||||
/>
|
||||
</a>
|
||||
`;
|
Loading…
Add table
Add a link
Reference in a new issue