Skip to content

Commit 29cad78

Browse files
authored
[Web][UMA-1084]Rename wrong aria-label and title for AddressBookMenu button (#2472)
* fix: rename wrong aria-label and title for AddressBookMenu button * refactor: improve syntax
1 parent c4601b1 commit 29cad78

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { useSortedContacts } from "@umami/state";
2+
import { getButtonByName } from "@umami/test-utils";
3+
4+
import { AddressBookMenu } from "./AddressBookMenu";
5+
import { renderInDrawer, screen } from "../../../testUtils";
6+
7+
jest.mock("@umami/state", () => ({
8+
...jest.requireActual("@umami/state"),
9+
useSortedContacts: jest.fn(),
10+
}));
11+
12+
describe("<AddressBookMenu />", () => {
13+
beforeEach(() => {
14+
jest.mocked(useSortedContacts).mockReturnValue([
15+
{
16+
name: "randomName",
17+
pkh: "randomPkh",
18+
},
19+
]);
20+
});
21+
22+
it('renders the "More Options" button with the correct aria-label and title', async () => {
23+
await renderInDrawer(<AddressBookMenu />);
24+
expect(getButtonByName("More Options")).toBeVisible();
25+
expect(screen.getByLabelText("More Options")).toBeVisible();
26+
});
27+
});

apps/web/src/components/Menu/AddressBookMenu/AddressBookMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ const ContactItem = ({ contact }: ContactItemProps) => {
8484
<IconButton
8585
color={color("500")}
8686
transform="rotate(90deg)"
87-
aria-label="Remove Peer"
87+
aria-label="More Options"
8888
icon={<ThreeDotsIcon />}
89-
title="Remove Peer"
89+
title="More Options"
9090
variant="iconButtonSolid"
9191
/>
9292
</ActionsDropdown>

0 commit comments

Comments
 (0)