mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-08-21 05:51:46 +10:00
feat: update links for improved accessibility
This commit is contained in:
@@ -35,12 +35,12 @@ const renderButton = () =>
|
||||
);
|
||||
|
||||
describe("GithubStarsButton", () => {
|
||||
it("renders an anchor pointing at the project repo with rel=noopener and target=_blank", () => {
|
||||
it("renders an anchor pointing at the project repo with rel=noopener noreferrer and target=_blank", () => {
|
||||
renderButton();
|
||||
const link = screen.getByRole("button") as HTMLAnchorElement;
|
||||
expect(link.href).toBe("https://github.com/amruthpillai/reactive-resume");
|
||||
expect(link.target).toBe("_blank");
|
||||
expect(link.rel).toBe("noopener");
|
||||
expect(link.rel).toBe("noopener noreferrer");
|
||||
});
|
||||
|
||||
it("uses the no-count aria-label when star count hasn't loaded yet", () => {
|
||||
|
||||
@@ -18,7 +18,12 @@ export function GithubStarsButton() {
|
||||
variant="outline"
|
||||
nativeButton={false}
|
||||
render={
|
||||
<a target="_blank" href="https://github.com/amruthpillai/reactive-resume" aria-label={ariaLabel} rel="noopener">
|
||||
<a
|
||||
target="_blank"
|
||||
href="https://github.com/amruthpillai/reactive-resume"
|
||||
aria-label={ariaLabel}
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<GithubLogoIcon aria-hidden="true" />
|
||||
{starCount != null ? (
|
||||
<CountUp to={starCount} duration={0.5} separator="," className="font-bold" aria-hidden="true" />
|
||||
|
||||
Reference in New Issue
Block a user