Skip to content

Commit bed7091

Browse files
committed
Extract describe parent from hints tests in RelyingPartyStartOperationSpec
1 parent a97acb6 commit bed7091

File tree

1 file changed

+33
-29
lines changed

1 file changed

+33
-29
lines changed

webauthn-server-core/src/test/scala/com/yubico/webauthn/RelyingPartyStartOperationSpec.scala

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -982,37 +982,41 @@ class RelyingPartyStartOperationSpec
982982
}
983983
}
984984

985-
it("allows setting the hints to a value not in the spec.") {
986-
val pkcco = relyingParty(userId = userId).startRegistration(
987-
StartRegistrationOptions
988-
.builder()
989-
.user(userId)
990-
.hints("hej")
991-
.build()
992-
)
993-
pkcco.getHints.asScala should equal(List("hej"))
994-
}
985+
describe("allows setting the hints") {
986+
val rp = relyingParty(userId = userId)
995987

996-
it("allows setting the hints to a value in the spec.") {
997-
val pkcco = relyingParty(userId = userId).startRegistration(
998-
StartRegistrationOptions
999-
.builder()
1000-
.user(userId)
1001-
.hints(PublicKeyCredentialHint.SECURITY_KEY)
1002-
.build()
1003-
)
1004-
pkcco.getHints.asScala should equal(List("security-key"))
1005-
}
988+
it("to a value not in the spec.") {
989+
val pkcco = rp.startRegistration(
990+
StartRegistrationOptions
991+
.builder()
992+
.user(userId)
993+
.hints("hej")
994+
.build()
995+
)
996+
pkcco.getHints.asScala should equal(List("hej"))
997+
}
1006998

1007-
it("allows setting the hints to empty") {
1008-
val pkcco = relyingParty(userId = userId).startRegistration(
1009-
StartRegistrationOptions
1010-
.builder()
1011-
.user(userId)
1012-
.hints("")
1013-
.build()
1014-
)
1015-
pkcco.getHints.asScala should equal(List(""))
999+
it("to a value in the spec.") {
1000+
val pkcco = rp.startRegistration(
1001+
StartRegistrationOptions
1002+
.builder()
1003+
.user(userId)
1004+
.hints(PublicKeyCredentialHint.SECURITY_KEY)
1005+
.build()
1006+
)
1007+
pkcco.getHints.asScala should equal(List("security-key"))
1008+
}
1009+
1010+
it("to empty") {
1011+
val pkcco = rp.startRegistration(
1012+
StartRegistrationOptions
1013+
.builder()
1014+
.user(userId)
1015+
.hints("")
1016+
.build()
1017+
)
1018+
pkcco.getHints.asScala should equal(List(""))
1019+
}
10161020
}
10171021

10181022
it("allows setting the timeout to empty.") {

0 commit comments

Comments
 (0)