Skip to content

Commit

Permalink
Merge pull request #69 from hmrc/DAC6-3042
Browse files Browse the repository at this point in the history
Updated routing for FI name page if FI=User
  • Loading branch information
Vishakha1903 authored Jun 3, 2024
2 parents c8fec9a + 238c6de commit e4d05f3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/navigation/Navigator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ class Navigator @Inject() () {
private val normalRoutes: Page => UserAnswers => Call = {

case NameOfFinancialInstitutionPage =>
_ => routes.HaveUniqueTaxpayerReferenceController.onPageLoad(NormalMode)
userAnswers =>
isFiUser(
userAnswers,
routes.SendReportsController.onPageLoad(NormalMode),
routes.HaveUniqueTaxpayerReferenceController.onPageLoad(NormalMode)
)
case WhatIsUniqueTaxpayerReferencePage =>
_ => routes.SendReportsController.onPageLoad(NormalMode)
case SendReportsPage =>
Expand Down
8 changes: 7 additions & 1 deletion test/navigation/NavigatorSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@ class NavigatorSpec extends SpecBase {
routes.CheckYourAnswersController.onPageLoad
}

"must go from NameOfFinancialInstitutionPage to HaveUniqueTaxpayerReferencePage" in {
"must go from NameOfFinancialInstitutionPage to SendReportsPage when user is FI" in {
val userAnswers = emptyUserAnswers.withPage(ReportForRegisteredBusinessPage, true)
navigator.nextPage(NameOfFinancialInstitutionPage, NormalMode, userAnswers) mustBe
routes.SendReportsController.onPageLoad(NormalMode)
}

"must go from NameOfFinancialInstitutionPage to HaveUniqueTaxpayerReferencePage when user is not FI" in {
val userAnswers = emptyUserAnswers.withPage(NameOfFinancialInstitutionPage, "FI")
navigator.nextPage(NameOfFinancialInstitutionPage, NormalMode, userAnswers) mustBe
routes.HaveUniqueTaxpayerReferenceController.onPageLoad(NormalMode)
Expand Down

0 comments on commit e4d05f3

Please sign in to comment.