From 973c2311a1bdcedc01d4638d3520df5a5c706bed Mon Sep 17 00:00:00 2001 From: Pete Robinson <77154273+peterdrobinson@users.noreply.github.com> Date: Fri, 3 Oct 2025 10:55:21 +0100 Subject: [PATCH] NGR-1091 - Amended as per Michal's comments --- .../ngrraldfrontend/controllers/LandlordController.scala | 2 +- .../hmrc/ngrraldfrontend/models/forms/LandlordForm.scala | 2 +- conf/messages | 6 +++--- .../ngrraldfrontend/models/forms/LandlordFormSpec.scala | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/uk/gov/hmrc/ngrraldfrontend/controllers/LandlordController.scala b/app/uk/gov/hmrc/ngrraldfrontend/controllers/LandlordController.scala index 4480a557..edf0b00f 100644 --- a/app/uk/gov/hmrc/ngrraldfrontend/controllers/LandlordController.scala +++ b/app/uk/gov/hmrc/ngrraldfrontend/controllers/LandlordController.scala @@ -108,7 +108,7 @@ class LandlordController @Inject()(view: LandlordView, formWithErrors => val correctedFormErrors = formWithErrors.errors.map { formError => (formError.key, formError.messages) match - case ("", messages) if messages.contains("landlord.radio.empty.error") => + case ("", messages) if messages.contains("landlord.radio.emptyText.error") => formError.copy(key = "landlord-relationship") case ("", messages) if messages.contains("landlord.radio.tooLong.error") => formError.copy(key = "landlord-relationship") diff --git a/app/uk/gov/hmrc/ngrraldfrontend/models/forms/LandlordForm.scala b/app/uk/gov/hmrc/ngrraldfrontend/models/forms/LandlordForm.scala index ec23a07f..cd6e1ed3 100644 --- a/app/uk/gov/hmrc/ngrraldfrontend/models/forms/LandlordForm.scala +++ b/app/uk/gov/hmrc/ngrraldfrontend/models/forms/LandlordForm.scala @@ -32,7 +32,7 @@ object LandlordForm extends CommonFormValidators with Mappings{ private lazy val landlordNameEmptyError = "landlord.name.empty.error" private lazy val landlordNameTooLongError = "landlord.name.empty.tooLong.error" private lazy val radioUnselectedError = "landlord.radio.empty.error" - private lazy val landlordRelationshipEmptyError = "landlord.radio.empty.error" + private lazy val landlordRelationshipEmptyError = "landlord.radio.emptyText.error" private lazy val landlordRelationshipTooLongError = "landlord.radio.tooLong.error" private val landlord = "landlord-name-value" diff --git a/conf/messages b/conf/messages index f379acbf..eb120175 100644 --- a/conf/messages +++ b/conf/messages @@ -56,11 +56,11 @@ typeOfLeaseRenewal.required.error = Select what type of lease renewal it is #Landlord landlord.title = Landlord landlord.p1 = What is the landlord''s full name? -landlord.p2 = What is your relationship with the landlord? +landlord.p2 = Do you have a relationship with the landlord other than as a tenant? landlord.name.empty.error = Enter the landlord''s full name landlord.name.empty.tooLong.error = Landlord''s full name must be 50 characters or less -landlord.radio.empty.error = Select what your relationship with the landlord is -landlord.radio.empty.error = Tell us what your relationship with the landlord is +landlord.radio.empty.error = Select yes if you have any relationship with landlord +landlord.radio.emptyText.error = Tell us what your relationship with the landlord is landlord.radio.tooLong.error = Maximum character allowed is 250 landlord.radio.yes = Can you tell us what your relationship with the landlord is? landlord.radio.yes.hint = For example, the landlord is a family member, business partner, shared director or company pension fund diff --git a/test/uk/gov/hmrc/ngrraldfrontend/models/forms/LandlordFormSpec.scala b/test/uk/gov/hmrc/ngrraldfrontend/models/forms/LandlordFormSpec.scala index 831c22df..5d9f5015 100644 --- a/test/uk/gov/hmrc/ngrraldfrontend/models/forms/LandlordFormSpec.scala +++ b/test/uk/gov/hmrc/ngrraldfrontend/models/forms/LandlordFormSpec.scala @@ -65,7 +65,7 @@ class LandlordFormSpec extends AnyFlatSpec with Matchers { val boundForm = LandlordForm.form.bind(data) - boundForm.errors shouldBe List(FormError("", List("landlord.radio.empty.error"), List())) + boundForm.errors shouldBe List(FormError("", List("landlord.radio.emptyText.error"), List())) } it should "pass when 'Yes' is selected and description is provided" in {