@@ -83,7 +83,7 @@ class PasskeyItem {
8383 }
8484
8585 async rename < T > ( fn : ( dialog : RenamePasskeyDialog ) => Promise < T > ) : Promise < T > {
86- await this . locator . getByRole ( "button" , { name : "More options" } ) . click ( ) ;
86+ await this . #openMoreOptions ( ) ;
8787 await this . locator
8888 . getByRole ( "menu" )
8989 . getByRole ( "menuitem" , { name : "Rename" } )
@@ -99,7 +99,7 @@ class PasskeyItem {
9999 }
100100
101101 async remove < T > ( fn : ( dialog : RemovePasskeyDialog ) => Promise < T > ) : Promise < T > {
102- await this . locator . getByRole ( "button" , { name : "More options" } ) . click ( ) ;
102+ await this . #openMoreOptions ( ) ;
103103 await this . locator
104104 . getByRole ( "menu" )
105105 . getByRole ( "menuitem" , { name : "Remove" } )
@@ -114,11 +114,22 @@ class PasskeyItem {
114114 }
115115
116116 async assertUnremovable ( ) : Promise < void > {
117- await this . locator . getByRole ( "button" , { name : "More options" } ) . click ( ) ;
117+ await this . #openMoreOptions ( ) ;
118118 await expect (
119119 this . locator . getByRole ( "menu" ) . getByRole ( "menuitem" , { name : "Remove" } ) ,
120120 ) . toBeHidden ( ) ;
121121 }
122+
123+ async assertRemoveDisabled ( ) : Promise < void > {
124+ await this . #openMoreOptions( ) ;
125+ await expect (
126+ this . locator . getByRole ( "menu" ) . getByRole ( "menuitem" , { name : "Remove" } ) ,
127+ ) . toBeDisabled ( ) ;
128+ }
129+
130+ async #openMoreOptions( ) {
131+ await this . locator . getByRole ( "button" , { name : "More options" } ) . click ( ) ;
132+ }
122133}
123134
124135class AddDialog {
0 commit comments