Skip to content

Commit

Permalink
feat: Translate TopNavBar home link label (#1197)
Browse files Browse the repository at this point in the history
* feat: Translate TopNavBar home link label

* test: Update TopNavBar test to check for multiple "Home" text instances
  • Loading branch information
will0684 authored Feb 24, 2025
1 parent 253a4b1 commit 5fbd1b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/molecules/TopNavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function TopNavBar({
<div className="static lg:hidden mt-4 flex flex-col w-full mr-4">
<div className="flex justify-between">
<Link href={homeLink} className="ml-4 font-body text-p font-semibold">
Service Canada Labs
{homeLinkLabel}
</Link>
<button
aria-label={buttonAriaLabel}
Expand Down
4 changes: 2 additions & 2 deletions components/molecules/TopNavBar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("TopNavBar", () => {
render(<Primary {...Primary.args} />);
expect(screen.getByLabelText("nav-aria-label")).toBeTruthy();
expect(screen.getByLabelText("button-aria-label")).toBeTruthy();
expect(screen.getByText("Home")).toBeTruthy();
expect(screen.getAllByText("Home")).toHaveLength(2);
expect(screen.getByText("Updates")).toBeTruthy();
});

Expand All @@ -22,7 +22,7 @@ describe("TopNavBar", () => {
global.innerWidth = 500;
expect(screen.getByLabelText("nav-aria-label")).toBeTruthy();
expect(screen.getByLabelText("button-aria-label")).toBeTruthy();
expect(screen.getByText("Home")).toBeTruthy();
expect(screen.getAllByText("Home")).toHaveLength(2);
expect(screen.getByText("Updates")).toBeTruthy();
});

Expand Down

0 comments on commit 5fbd1b2

Please sign in to comment.