File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed
Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 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+ } ) ;
Original file line number Diff line number Diff 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 >
You can’t perform that action at this time.
0 commit comments