~jan0sch/smederee
Showing details for patch a55031fe01e62cc043a47ff9c5d9ab972bf6c080.
diff -rN -u old-smederee/modules/hub/src/test/scala/de/smederee/hub/AuthenticationRoutesTest.scala new-smederee/modules/hub/src/test/scala/de/smederee/hub/AuthenticationRoutesTest.scala --- old-smederee/modules/hub/src/test/scala/de/smederee/hub/AuthenticationRoutesTest.scala 2025-01-15 16:26:13.371695774 +0000 +++ new-smederee/modules/hub/src/test/scala/de/smederee/hub/AuthenticationRoutesTest.scala 2025-01-15 16:26:13.371695774 +0000 @@ -35,7 +35,8 @@ import munit._ class AuthenticationRoutesTest extends CatsEffectSuite { - val loginPath = uri"/login" + val loginPath = uri"/login" + private val resetPath = uri"/forgot-password" protected final val configuration: SmedereeHubConfig = ConfigSource @@ -44,7 +45,7 @@ .loadOrThrow[SmedereeHubConfig] test("GET /login must return the login form for guest users") { - val expectedHtml = views.html.login()(loginPath, None, title = "Smederee - Login to your account".some)() + val expectedHtml = views.html.login()(loginPath, None, resetPath, title = "Smederee - Login to your account".some)() val clock = java.time.Clock.systemUTC val authenticationConfig = configuration.service.authentication @@ -108,7 +109,9 @@ test("POST /login must return 400 - Bad Request if the form data is invalid") { val expectedErrors = LoginForm.validate(Map.empty).leftMap(FormErrors.fromNec).swap.toOption.get val expectedHtml = - views.html.login()(loginPath, None, title = "Smederee - Login to your account".some)(formErrors = expectedErrors) + views.html.login()(loginPath, None, resetPath, title = "Smederee - Login to your account".some)(formErrors = + expectedErrors + ) val clock = java.time.Clock.systemUTC val authenticationConfig = configuration.service.authentication @@ -165,7 +168,7 @@ def request = Request[IO](method = Method.POST, uri = loginPath).withEntity(payload) val expectedHtml = - views.html.login()(loginPath, None, title = "Smederee - Login to your account".some)( + views.html.login()(loginPath, None, resetPath, title = "Smederee - Login to your account".some)( formData = Map(LoginForm.fieldName.toString -> account.name.toString), Map(LoginForm.fieldGlobal -> List(FormFieldError("Invalid credentials!"))) ) @@ -218,7 +221,7 @@ def request = Request[IO](method = Method.POST, uri = loginPath).withEntity(payload) val expectedHtml = - views.html.login()(loginPath, None, title = "Smederee - Login to your account".some)( + views.html.login()(loginPath, None, resetPath, title = "Smederee - Login to your account".some)( formData = Map(LoginForm.fieldName.toString -> account.name.toString), Map(LoginForm.fieldGlobal -> List(FormFieldError("Invalid credentials!"))) ) @@ -268,7 +271,7 @@ def request = Request[IO](method = Method.POST, uri = loginPath).withEntity(payload) val expectedHtml = - views.html.login()(loginPath, None, title = "Smederee - Login to your account".some)( + views.html.login()(loginPath, None, resetPath, title = "Smederee - Login to your account".some)( formData = Map(LoginForm.fieldName.toString -> account.name.toString), Map(LoginForm.fieldGlobal -> List(FormFieldError("Invalid credentials!"))) )