Skip to content

Commit

Permalink
removed aria-label from menu button
Browse files Browse the repository at this point in the history
  • Loading branch information
rawanBairouti committed Aug 27, 2023
1 parent f6508a5 commit cff39a0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/navigation/NavMenu-integration.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe(`${NavMenu.name} (Integration Test)`, () => {
</MemoryRouter>
</DocumentStateProvider>
);
menuButton = screen.getByRole("button", { name: "Navigation Menu" });
menuButton = screen.getByRole("button", { name: "Menu" });
});
describe("when the user navigates via the nav menu links", () => {
let links: HTMLAnchorElement[];
Expand Down
2 changes: 1 addition & 1 deletion src/components/navigation/NavMenu.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe(NavMenu.name, () => {
</MemoryRouter>
</main>,
);
menuButton = screen.getByRole("button", { name: "Navigation Menu" });
menuButton = screen.getByRole("button", { name: "Menu" });
linkList = screen.queryByRole("list");
});

Expand Down
1 change: 0 additions & 1 deletion src/components/navigation/NavMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ export const NavMenu = ({ children }: ChildrenProps) => {
<button onClick={toggleMenu}
id={NAV_MENU_BUTTON_ID}
className={"menu-button"}
aria-label="Navigation Menu"
aria-controls={NAV_MENU_ID}
aria-expanded={isMenuOpen}>
<MenuIcon/>Menu
Expand Down
10 changes: 5 additions & 5 deletions src/components/navigation/Navigation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe(Navigation.name, () => {
expect(navMenu).toBeInTheDocument();
});
test("shows the nav links within the nav menu", async () => {
await user.click(within(navElement).getByRole("button", { name: "Navigation Menu" }));
await user.click(within(navElement).getByRole("button", { name: "Menu" }));
expect(within(navElement).getAllByRole("link").length).toBeGreaterThan(0);
});
describe("and becomes wide", () => {
Expand All @@ -85,7 +85,7 @@ describe(Navigation.name, () => {
});
describe("and becomes wide with focus on the menu button", () => {
beforeEach(async () => {
const navMenuButton = within(navElement).getByRole("button", { name: "Navigation Menu" });
const navMenuButton = within(navElement).getByRole("button", { name: "Menu" });
navMenuButton.focus();
mocked(window.matchMedia).mockReturnValue({ matches: false } as MediaQueryList);
await waitFor(() => {
Expand All @@ -100,7 +100,7 @@ describe(Navigation.name, () => {
describe("and becomes wide with focus on a link in the menu", () => {
let focusedLinkIndex: number;
beforeEach(async () => {
await user.click(within(navElement).getByRole("button", { name: "Navigation Menu" }));
await user.click(within(navElement).getByRole("button", { name: "Menu" }));

const links = within(navElement).getAllByRole("link");
focusedLinkIndex = Math.floor(Math.random() * links.length);
Expand Down Expand Up @@ -141,7 +141,7 @@ describe(Navigation.name, () => {
});
});
test("the nav menu button appears", () => {
const navMenuButton = within(navElement).getByRole("button", { name: "Navigation Menu" });
const navMenuButton = within(navElement).getByRole("button", { name: "Menu" });
expect(navMenuButton).toBeInTheDocument();
});
});
Expand All @@ -157,7 +157,7 @@ describe(Navigation.name, () => {
});
});
test("the nav menu button gains focus", () => {
const navMenuButton = within(navElement).getByRole("button", { name: "Navigation Menu" });
const navMenuButton = within(navElement).getByRole("button", { name: "Menu" });
expect(navMenuButton).toHaveFocus();
});
});
Expand Down

0 comments on commit cff39a0

Please sign in to comment.