@@ -818,6 +818,59 @@ class RelyingPartyStartOperationSpec
818818 }
819819 }
820820
821+ describe(" allows setting the hints" ) {
822+ val rp = relyingParty(userId = userId)
823+
824+ it(" to string values in the spec or not." ) {
825+ val pkcro = rp.startAssertion(
826+ StartAssertionOptions
827+ .builder()
828+ .hints(" hej" , " security-key" , " hoj" , " client-device" , " hybrid" )
829+ .build()
830+ )
831+ pkcro.getPublicKeyCredentialRequestOptions.getHints.asScala should equal(
832+ List (
833+ " hej" ,
834+ PublicKeyCredentialHint .SECURITY_KEY .getValue,
835+ " hoj" ,
836+ PublicKeyCredentialHint .CLIENT_DEVICE .getValue,
837+ PublicKeyCredentialHint .HYBRID .getValue,
838+ )
839+ )
840+ }
841+
842+ it(" to PublicKeyCredentialHint values in the spec or not." ) {
843+ val pkcro = rp.startAssertion(
844+ StartAssertionOptions
845+ .builder()
846+ .hints(
847+ PublicKeyCredentialHint .of(" hej" ),
848+ PublicKeyCredentialHint .HYBRID ,
849+ PublicKeyCredentialHint .SECURITY_KEY ,
850+ PublicKeyCredentialHint .of(" hoj" ),
851+ PublicKeyCredentialHint .CLIENT_DEVICE ,
852+ )
853+ .build()
854+ )
855+ pkcro.getPublicKeyCredentialRequestOptions.getHints.asScala should equal(
856+ List (
857+ " hej" ,
858+ PublicKeyCredentialHint .HYBRID .getValue,
859+ PublicKeyCredentialHint .SECURITY_KEY .getValue,
860+ " hoj" ,
861+ PublicKeyCredentialHint .CLIENT_DEVICE .getValue,
862+ )
863+ )
864+ }
865+
866+ it(" or not, defaulting to the empty list." ) {
867+ val pkcro = rp.startAssertion(StartAssertionOptions .builder().build())
868+ pkcro.getPublicKeyCredentialRequestOptions.getHints.asScala should equal(
869+ List ()
870+ )
871+ }
872+ }
873+
821874 it(" allows setting the timeout to empty." ) {
822875 val req = relyingParty(userId = userId).startAssertion(
823876 StartAssertionOptions
0 commit comments