@@ -504,17 +504,22 @@ test.describe("decode JWTs", () => {
504504 status : MessageStatusValue . VISIBLE ,
505505 } ) ;
506506
507- const formatPicker = page . locator (
508- ".react-select__single-value"
509- ) ;
510-
511- await formatPicker . click ( ) ;
512-
507+ const pemFormatPickerControl = page
508+ . locator ( ".react-select__single-value" )
509+ . filter ( { hasText : entry . publicKeyFormat } )
510+ . locator (
511+ 'xpath=ancestor::div[contains(@class, "react-select__control")]'
512+ ) ;
513+ await pemFormatPickerControl . dispatchEvent ( "mousedown" , {
514+ button : 0 ,
515+ } ) ;
513516 await page
517+ . getByRole ( "listbox" )
514518 . getByRole ( "option" , {
515519 name : entrywithJwkKey . publicKeyFormat ,
520+ exact : true ,
516521 } )
517- . click ( ) ;
522+ . dispatchEvent ( "click" ) ;
518523
519524 await expect
520525 . poll ( async ( ) => {
@@ -569,13 +574,22 @@ test.describe("decode JWTs", () => {
569574 expect ( decodedHeader ) . toBe ( entrywithJwkKey . header ) ;
570575 expect ( decodedPayload ) . toBe ( entrywithJwkKey . payload ) ;
571576
572- await formatPicker . click ( ) ;
573-
577+ const jwkFormatPickerControl = page
578+ . locator ( ".react-select__single-value" )
579+ . filter ( { hasText : entrywithJwkKey . publicKeyFormat } )
580+ . locator (
581+ 'xpath=ancestor::div[contains(@class, "react-select__control")]'
582+ ) ;
583+ await jwkFormatPickerControl . dispatchEvent ( "mousedown" , {
584+ button : 0 ,
585+ } ) ;
574586 await page
587+ . getByRole ( "listbox" )
575588 . getByRole ( "option" , {
576589 name : entry . publicKeyFormat ,
590+ exact : true ,
577591 } )
578- . click ( ) ;
592+ . dispatchEvent ( "click" ) ;
579593
580594 await expect ( secretKeyEditorInput ) . toHaveValue ( entry . publicKey ) ;
581595
@@ -609,17 +623,22 @@ test.describe("decode JWTs", () => {
609623 status : MessageStatusValue . VISIBLE ,
610624 } ) ;
611625
612- const formatPicker = page . locator (
613- ".react-select__single-value"
614- ) ;
615-
616- await formatPicker . click ( ) ;
617-
626+ const pemFormatPickerControl = page
627+ . locator ( ".react-select__single-value" )
628+ . filter ( { hasText : entry . publicKeyFormat } )
629+ . locator (
630+ 'xpath=ancestor::div[contains(@class, "react-select__control")]'
631+ ) ;
632+ await pemFormatPickerControl . dispatchEvent ( "mousedown" , {
633+ button : 0 ,
634+ } ) ;
618635 await page
636+ . getByRole ( "listbox" )
619637 . getByRole ( "option" , {
620638 name : entrywithJwkKey . publicKeyFormat ,
639+ exact : true ,
621640 } )
622- . click ( ) ;
641+ . dispatchEvent ( "click" ) ;
623642
624643 await secretKeyEditorInput . fill (
625644 JSON . stringify ( entrywithJwkKey . publicKey ) ,
0 commit comments